Jeff Hough Posted August 25, 2013 Posted August 25, 2013 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
Rick Whitelaw Posted August 25, 2013 Posted August 25, 2013 I'm not sure, but I believe a TO of the table you're querying must be on the relationship graph of the file from which you are doing the query. They don't have to be related though. 1
Jeff Hough Posted August 26, 2013 Author Posted August 26, 2013 That's what I am beginning to think. I was hoping to not have to create file references and TOs to extract the data. If anyone can think of a method, I'd appreciate it. Thanks, Jeff
mr_vodka Posted August 26, 2013 Posted August 26, 2013 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 ) ]
Jeff Hough Posted August 26, 2013 Author Posted August 26, 2013 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now