on 04-03-2014 12:25 PM
Hello Community,
Refer to screen-shot for table structure.
I have to create a stored procedure with an input parameter as USER_INPUT which will be checked with "TEXT" - when User Input matches the data stored in the TEXT then the corresponding query should get executed.
Please guide me how to achieve the same.
Regards
Kumar
You got to use EXEC or EXECUTE IMMEDIATE to achieve it.
When the user input matches, the corresponding query should be taken into a String variable.
Example:
SQL_STRING := 'Select Count(*) from TABLE'
EXECUTE IMMEDIATE (:SQL_STRING)
Have a look on the sample proc created using EXECUTE IMMEDIATE below.
Regards,
Krishna Tangudu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Krishna
Thanks for the reply. when I am executing the procedure, I am getting the output as :
But the expected output is the total no of records present in the table !!
Following is the code I used :
I think I am missing something !!
Please guide.
Regards
Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.