174
Views
8
Comments
Solved
Oracle function doesn't work in advanced SQL
Question

I have connected to an external Oracle DB.

I need to run an SQL with some Oracle function like these :

LPAD, TO_CHAR, TO_NUMBER ...
But Outsystems don't support those functions, and show the error below.

Does someone have solution for this problem.

Thank you.!

2025-12-04 09-01-03
Kiet Phan
Champion
Solution

Thank you all for helping me, 

@Krishnanand Pathak @Gitansh Anand  @Daniel Kuhlmann 

since I need to make a query from Oracle DB so SQL function won't work for this case.

But when I try using @Krishnanand Pathak 's suggestion with SQL function, I found the way to "target" the SQL to the right DB platform.

First, the default advanced SQL will just accepted SQL function, so when I create a new SQL, it won't accept function from Oracle like this:

But after i try to put the From {Entity} to complete the query

Then I close the editor and reopen it. The SQL will target Oracle DB and all the oracle function are shown in suggestion, and the query works as well.

Hope this will give you a little information if you guys need to connect external oracle DB with some built in function query.

Thanks.!

2024-12-10 04-40-04
Gitansh Anand

Hi @Kiet Phan, You can use the built-in function FormatText (look at the screenshot below). If you want to use it on an input parameter or a static text, you can use this before the SQL and then pass it to SQL, and if you want to use it on an entity attribute, then write a query and get the required columns without the LPAD, then after the query execution use this function on the column you want.

Thanks
Gitansh Anand

2024-09-12 02-43-38
Deepsagar Dubey

Hi @Kiet Phan 

Outsystems support SQL server database engine and you are using Oracle database function that's why it's giving you error,

I hope it'll help you,

Thanks
Deep

2024-07-05 14-16-55
Daniël Kuhlmann
Ā 
MVP

It is clearly stated in the question:

ā€žI  have connected to an external Oracle DB"

Regards,

Daniel

2024-09-12 02-43-38
Deepsagar Dubey

Hi @Daniel Kuhlmann 

Thanks for your suggestion but may i know what i posted wrong, If you read original post then there is a snapshot attached and we can see there is no entity used, so default it'll take function and keywords from SQL not from Oracle, 

and this is what @Kiet Phan mentioned in his solution,

Please correct me if i am wrong,

Thanks
Deep   

2024-07-05 14-16-55
Daniël Kuhlmann
Ā 
MVP


As I wrote before, the question is about SQL for Oracle. Then you talk about that OutSytems is on MS SQL Server, and telling the user that that is the reason of the error.  SQL statements are always written to the database you access. So Oracle syntax for Oracle database, SQL Server syntax for SQL server database.

2023-04-16 15-25-31
Krishnanand Pathak

Hi @Kiet Phan,

 
There are equivalent functions available in SQL Server to achieve same result as shown below



Check the below links for more equivalent functions are available.
https://www.c-sharpcorner.com/UploadFile/c5c6e2/sql-server-functions-and-oracle-equivalent/

https://www.akadia.com/services/sqlsrv_oracle_functions.html

You can also search on google directly.

Regards
Krishnanand Pathak

2024-07-05 14-16-55
Daniël Kuhlmann
Ā 
MVP

How does this reply help if the orginal poster clear states he is using an external Oracle database?

2025-12-04 09-01-03
Kiet Phan
Champion
Solution

Thank you all for helping me, 

@Krishnanand Pathak @Gitansh Anand  @Daniel Kuhlmann 

since I need to make a query from Oracle DB so SQL function won't work for this case.

But when I try using @Krishnanand Pathak 's suggestion with SQL function, I found the way to "target" the SQL to the right DB platform.

First, the default advanced SQL will just accepted SQL function, so when I create a new SQL, it won't accept function from Oracle like this:

But after i try to put the From {Entity} to complete the query

Then I close the editor and reopen it. The SQL will target Oracle DB and all the oracle function are shown in suggestion, and the query works as well.

Hope this will give you a little information if you guys need to connect external oracle DB with some built in function query.

Thanks.!

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