Dynamic Query in Advanced SQL

Dynamic Query in Advanced SQL

  

I am passing the query code to the advanced sql as an input parameter which has its expand inline property set to true.

"select 1
 from {TABLE_NAME}
where {TABLE_NAME}.[COLUMN_NAME]=1"

and i am getting this error: ORA-00942: table or view does not exist

while if i write this query normally in the advanced sql , it works.

any ideas?

thanks


Hi Mariam,

is your table referenced in your module?

Is it an OutSystems table or an external one?

It is an external table. 

and i reference it.

Solution

How are you referencing it? I suppose through an extension...

So you must grant select on those objects to the database users osadmin and osruntime.

Are you doing this?

Solution

Yes i reference it through an extension.

I have tried granting the select privilege , but the issue is still there.


Have you tried the SQL without passing it in an input? Just to see if the "normal" case works...

By "normal", I mean having the SQL expression in the editor.

It has worked, sorry i granted the privilege to the wrong table.

Thank you so much!

João Heleno wrote:

Have you tried the SQL without passing it in an input? Just to see if the "normal" case works...

By "normal", I mean having the SQL expression in the editor.



Nice!

Glad to be of help.