Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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


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

Recommended Posts

Posted

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

Posted

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.

  • Like 1
Posted

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

Posted

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 ) ]

Posted

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

This topic is 4118 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.