324
Views
7
Comments
How to check if a column is present in a physical table
Question
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 
2024-01-22 15-21-29
Pedro Cardoso

Hello!

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

2012-08-24 04-32-41
Juan Carlos Elorde

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

2023-12-07 07-51-40
Remco Dekkinga
 
MVP

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

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

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.

2024-01-22 15-21-29
Pedro Cardoso

Infact Kilian, but maybe it can help others.

UserImage.jpg
Narendra Maheshwari

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

2024-01-22 15-21-29
Pedro Cardoso

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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.