I'm trying to pass a comma-separated value (which are actually the values of selected list items in a listbox separated by commas) from C#.NET to oracle stored procedure. The Stored procedure parameter is a CLOB. In the WHERE condition of the query, this CLOB value, which is being stored in VARCHAR2(30000) variable, is being used since the CLOB parameter can't be directly used in a WHERE condition. The below query is used for splitting the comma separated values into separate record each.
SELECT COL_NAME FROM TBL WHERE
CUSTOMER_ID IN (select REGEXP_SUBSTR(V_SELECTED_CUSTOMER,'[^,]+', 1, LEVEL) FROM DUAL
CONNECT BY REGEXP_SUBSTR(V_SELECTED_CUSTOMER, '[^,]+', 1, LEVEL) is NOT NULL);
Now the issue which I'm facing is, when the user selects all the ListBox values, the input parameter is amounting to a length of around 23,000. In this scenario, the Stored Procedure is throwing the below error:
ORA-01460: unimplemented or unreasonable conversion requested
The issue could be due to the REGEXP_SUBSTR function which usually takes STRING upto 4000 characters. The V_SELECTED_CUSTOMER variable is a VARCHAR2(30000). Is there a way to make this work for CLOB values as well. Or is there any other alternative by which this can be achieved?