Use DCT Table defined as PostgreSQL Function Returned Table

PG views defined as files in the DCT can readily be used in browse procedures. One simply gives the view a filename in the DCT just like a PG table (myschema.myviewname).

However, I’ve hit a snag if the DCT file happens to be a table returned from a PG function with a single parameter. The problem is that whatever filename and access level I have defined, I get a File Not Opened error from the FileManager.OpenFile method. I have confirmed that mypschema.myfuncname(date) is acceptable to PG, so I assumed this would be good to go in the DCT.

If anyone has successfully defined & used a PG returned table in the DCT, I would be thrilled to hear from you.


Hi Douglas,
I don’t think you are going to get that to work. Directly referencing a stored procedure as a table name doesn’t work.
Possibly you could create the table with a dummy name and the TURBOSQL option turned on.
Then use Prop:SQL on the table to call the stored procedure in your clarion procedure.
If it is a browse, the take over the Reset method and use your Prop:SQL call. Might work.



I appreciate the thoughts. In several instances I have used the steps you outline. They work well for filling queues used with DROP & COMBO controls, especially when it is EIP.

Because this specific situation uses UltaTree, I thought “just maybe” there might be a simple way to move forward. I had forgotten about TURBOSQL so I just now added it and tested. Sure enough, FIleManager.OpenFile no longer yields an error. I believe (and hope) it is now just a problem of appropriately using PROP:Sql for the table in UltraTree.