Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

PSOS ExecuteSQL query of FileMaker_Fields not returning related file fields


Go to solution Solved by bcooney,

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

Recommended Posts

  • Newbies
Posted

At some point the results of this query has stopped returning any fields from related files. The FMS version is 19.5.2.201. The related files are hosted on the same server, defined in External Data Sources, and have multiple table occurrences on the relationship graph.

SELECT TableName,FieldName,FieldType FROM FileMaker_Fields 
WHERE FieldClass='Normal' AND 
TableName IN (SELECT TableName FROM FileMaker_Tables WHERE BaseFileName NOT LIKE '"& Get(FileName) &" %' )

This returns an empty result. If I just query the FileMaker_Fields table without a WHERE clause, it returns lines only for fields in the local file. 

Here's another query for investigation and result...

SELECT TableName,BaseFileName FROM FileMaker_Tables WHERE BaseFileName NOT LIKE '"& Get(FileName) &" %'

Result:

Activity,
Person,
Registration,

The three TOs from the related file are listed, but notice there is no BaseFileName returned. Queries like the one below return no results.

SELECT TableName,FieldName,FieldType FROM FileMaker_Fields 
WHERE FieldClass='Normal' AND 
TableName = 'Person'

These queries DO return field data as expected for the related file when executed in the local client (19.5.201). This was working in earlier versions of FMS.

Any thoughts about the change in behavior over time and now between the local client and PSOS?

 

Posted

might be the wild card '%', try adding an OR to the WHERE;

Quote

(BaseFileName NOT LIKE '"& Get(FileName) &" %' OR BaseFileName NOT LIKE '%"& Get(FileName) &" ' )

 

  • Newbies
Posted

Unfortunately as I mentioned above, even if I just query the FileMaker_Fields table without a WHERE clause, it returns lines only for fields in the local file…so the records are missing!

  • Solution
Posted

Are the credentials cascading to the second file? Is the second file open on the client when you call the psos script?

  • Newbies
Posted (edited)

@bcooney You are 100% on the right track. I forgot I was logged into the local file with a full access admin account, that does not exist in the related file. It was working locally because I had the related file open already before testing. I didn't think it through to realize the credentials for the related file on the client was not carried through.

I'm slapping my forehead. Thanks.

Edited by Daniel Berkman

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