174
Views
5
Comments
how to type convert from integer to string in sql widget
Question

Hello ALL,


I am trying to convert the text to Integer in sql widget passing the input parameter as a text. Please see the screenshot for reference.


Getting this error:


2018-08-27 08-29-35
Fábio Vaz

Hello,

Your ProductId in Test Inputs are filled with an existing product?

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi @vibhor Agarwal ,

i would make it easy on myself and do the conversion in the input parameter before passing in.

but that being said, it looks like you are trying to use a SQL SERVER function on an Oracle database.

In Oracle, CONVERT is not for typecasting, try using CAST instead.

Dorine

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

In addition, why use "IN" when there's only a single value? That doesn't make sense...

2026-02-26 06-29-24
Rahul
 
MVP

Hi,

Pass Test input value and check.

 I will suggest change the type of product Id as integer or Identifier of product if have.

Or if you passing list of id in input and checking in condition then you should use BuildSafe_InClauseIntegerList  function.


https://success.outsystems.com/documentation/11/reference/outsystems_apis/sanitization_api/


Hope this will help you.


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

Hi @vibhor Agarwal 

I am not sure you tried this or not but suppose your entity column is Integer type and you check with IN operator then you don't need to convert your string of ID's.

SELECT * FROM Customers WHERE CustomerID IN ('1', '2', '3');

In above example CustomerID  is primary key of Customers table, would you try the same at your side.

I hope it'll help you.

Thanks
Deep

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