How to Execute SQLString in procedure?
|
|
|
Question / Problem
|
We need SQLString(Nested Select statement) execute for find count and assign one variable. That variable will use in condition
|
Solution
|
Example :
M_STATUS VARCHAR2(50);
SQLStr VARCHAR2(4000);
SQLStr := 'Select count(*) from Tablename Where fldId IN(select fldName from tablename
Where fldCity IN(select fldId from tablename where fldPin ('||@val1||')) ';
EXECUTE IMMEDIATE SQLStr INTO M_STATUS;
/* Use Excute Immediate command for assign count into variable */
|
Applies to |
|
Oracle 9i Sql
|
Rank It |
|