Outsystems,

I want to check if a column is present in the table .I have the physical table name with me .
I wrote query like this and there is api named GetResultSet to which the argument is SQL below.
Is it right way of doing it. My constaraint is I only have physical table name with me at runtime.


"SELECT COLUMN_NAME
FROM " + PhysicalTableName 

Hello!

Sorry for not being a direct answer, but why do you need this? Maybe you should look at the this component.

Is the physical table outside you OutSystems platform? Have you tried to use the Integration Studio to connect this table to you platform instead?

If you want to run a query on a physical tablename, you should use the following advanced query:

SELECT column_name FROM os@PhysicalTableName

Where you strip the first two characters from the input parameter PhysicalTableName.

For instance: ossys_entity will be sys_entity, because the ossys, oslog, etc. are reserved words and this way you can bypass these.

Kind regards,

Remco Dekkinga

Guys the question is over a year old. I'm pretty sure the OP doesn't need an answer anymore :).

@Remco: that's a cool solution for querying an ossys table. I think I used a declare + inline parameter, but this is easier.

Infact Kilian, but maybe it can help others.

Hi Pedro,

I am reopening this topic again after 3 years, do you have any solution to execute the Physical entity name from Advance Query. 


Thanks,

Narendra

Hello.


I have no solution to query the database using the physical table name from an advanced query, but maybe you can use this API: https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/RuntimePublic.Db_API and connect to the OS database