1

I am not familiar with Oracle syntax, but I am getting a missing right parenthesis error when I am passing this string to an .Net Oracle Command and then it tries to fill the data adapter.

 string cT = "SELECT 'PRODUCT' AS ItemType, 'x' || CAST(LPROD.QUANTITY AS VARCHAR2(50)), " +
                  "PNAME.NAME || ' (' || CAST((PRODS.\"SIZE\" AS VARCHAR2(50))) || ' ' || PRODS.MEASURE || ')' AS Name, " +
                  "PRODS.PRODUCT_ID as ProductSizeID, PRODS.UPC_CODE as BarCode FROM ORDERS ORDR, LI_PROD LPROD, PRODUCT_NAME PNAME, " +
                  "PRODUCT PRODS WHERE ORDR.INV_NUM = :Invoice_Num AND ORDR.ORDER_NUM = LPROD.ORDER_NUM " +
                  "AND LPROD.PRODUCT_ID = PRODS.PRODUCT_ID AND PRODS.PRODUCT_NAME_ID = PNAME.ID";

Can anyone spot the error that may be causing this? Thanks for your help.

4

2 回答 2

3

尝试:

cast(prods."SIZE" as varchar2(50))

代替:

cast((prods."SIZE" as varchar2(50)))
于 2013-09-16T18:40:28.247 回答
0

我最近想出了完全相同的问题,但找不到解决方案。最终发生的事情是,我从 SQLServer 获得了以下代码,我试图将其转换为 Oracle。

CAST(col AS NVARCHAR(250)) AS col_name,

我能够通过将其更改为来修复它

CAST(col AS NVARCHAR2(250)) AS col_name,
于 2016-07-14T18:08:45.590 回答