DDL:
CREATE TABLE "TB_IMPORTDT"
( "AUTOID" NUMBER,
"POPULATION" VARCHAR2(6),
"DEATH" VARCHAR2(6),
"DISEASEID" NUMBER(4)
)
/
DATA:
INSERT INTO TB_IMPORTDT VALUES(1,'394849','100',1)
/
INSERT INTO TB_IMPORTDT VALUES(2,'394849','100',2)
/
INSERT INTO TB_IMPORTDT VALUES(3,'394849','100',3)
/
INSERT INTO TB_IMPORTDT VALUES(4,'394849','100',3)
/
INSERT INTO TB_IMPORTDT VALUES(5,'394849','100',1)
/
INSERT INTO TB_IMPORTDT VALUES(6,'394849','100',2)
/
COMMIT;
DATA PREVIEW:
AUTOID POPULA DEATH DISEASEID
---------- ------ ------ ----------
1 394849 100 1
2 394849 100 2
3 394849 100 3
4 394849 100 3
5 394849 100 1
6 394849 100 2
6 rows selected.
PROBLEM:
MULTIPLE VALUE PASSING into "IN" operator from "MULTI SELECT LIST".
BELOW OUTPUT IS EXPECTED AND OK
SQL> SELECT * FROM TB_IMPORTDT WHERE DISEASEID IN ('1','2','3');
AUTOID POPULA DEATH DISEASEID
---------- ------ ------ ----------
1 394849 100 1
2 394849 100 2
3 394849 100 3
4 394849 100 3
5 394849 100 1
6 394849 100 2
6 rows selected.
BELOW CODE NOT WORKING:(not getting the output)
SELECT * FROM TB_IMPORTDT WHERE DISEASEID IN (:P_DISEASELIST)
NOTE: Here "P_DISEASELIST" IS A "MULTI SELECT LIST" that returning value as 1:2:3 and before putting into IN parameter i am replacing ':' value to ',' as
Replace(:P_DISEASELIST,':',',')
--Thanks
[Updated on: Tue, 03 March 2009 00:37]
Report message to a moderator