Jump to content

Can ExecuteSQL return the table values from another file without a TO in the first?


This topic is 3918 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have two files. FileA and FileB. I have a script in FileA in which I'd like to query data in FileB.

 

Here are my parameters:

    - FileA does not have a table occurrence for the table in FileB.

    - FileB is open with sufficient privileges

    - The process in FileA does have the correct TO and FIELDNAMES to query the data

 

I believe I am having an issue with scope.

 

Is there a way, without creating a TO in FileA, for the script in FileA to query the table in FileB using ExecuteSQL?

 

Thanks,

Jeff

Link to comment
Share on other sites

Well you can kind of do it without a TO but you would still need a file reference...

 

You can create a script in FileB that performs the ExecuteSQL and passes it as a result back to FileA into a global field or variable, etc.

 

 

For example:

 

File A Script

 

Freeze Window

Perform Script ["runQuery" from file: "FileB" ]

Set Field [ zzg_results; Get(ScriptResult) ]

Close File ["FileB"]

 

 

File B Script

 

Exit Script [ Result: ExecuteSQL ( Your SQL Statement BLAH BLAH BLAH ) ]

Link to comment
Share on other sites

Hi John,

 

That's assuming you have a file reference and a script in FileB to call.

 

I am working another theory... If I somehow give the user a script to paste into FileB, I can reference the script using ScriptMaster's Run Script Immediately function. The function uses the FILENAME, SCRIPTNAME and PARAMETERS as inputs. The script the users pastes in would be a single line return like the one you posted.

 

Now, to put the script on the paste board without going into Manage Scripts and copy...

 

Thanks,

Jeff

Link to comment
Share on other sites

This topic is 3918 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.