0

I have a string variable passed to plsql procedure from front end which contain comma selerated integers, to retrieve these integers i am using TO_CHAR (P_LISTID). P_LISTID is variable passed.

THIS is working in many procedures written by others, but giving invalid number error for me.

Code:

Create procedure  p(p_listid in  VARCHAR2)
AS
TYPE IDTYPE TABLE OF TBLFILE%ID. TYPE
FILEID IDTYPE

BEGIN

SELECT *FROM TBLFILE WHERE ID IN (TO_CHAR (p_listid) 
...... 
..... 
End procedure
mahi_0707
  • 1,030
  • 9
  • 17
Vishwas Rao
  • 121
  • 1
  • 1
  • 11
  • 5
    This is a data conversion: you need to provide a sample of the data , both of the table and the value of `p_listid`. I could guess what the problem is but I would rather answer a clear question. – APC Jun 27 '15 at 08:56
  • If you have a character string you wish to convert to a number you should use the `TO_NUMBER` function. Best of luck. – Bob Jarvis - Слава Україні Jun 27 '15 at 19:15
  • if p_listid is a VARCHAR2 the to_char method would do nothing. Besides, the IN does only work with array types (or multiple parameters). – eckes Jun 27 '15 at 21:47

0 Answers0