August 25, 201312 yr 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
August 25, 201312 yr 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.
August 26, 201312 yr Author 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
August 26, 201312 yr 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 ) ]
August 26, 201312 yr Author 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
Create an account or sign in to comment