,
Share with your friends 

How to Execute SQLString in procedure?

7 ratings Views 144 
Author: MARIMUTHU K (Marimuthu K)  View Profile |  View other solutions by this author

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

Login to rank it

Report


Advertisement