on ‎2011 Jun 03 1:13 PM
I'm trying to set up a stored procedure that will handle calling another stored procedure that is passed in as a long varchar variable. I've been experimenting with EXECUTE IMMEDIATE, but so far I'm not getting anywhere with it.
I feel like I'm missing something simple, but haven't stumbled across it yet. Is there a way to do this or do I need to change the call to use the second stored proc normally?
Request clarification before answering.
Here is an example:
1) first create the procedure that is going to be called:
create or replace procedure callme( in @v long varchar ) begin message 'callme has been called with length(v) = ' || length(@v); end;
2) now call the "callme" procedure using execute immediate:
begin declare @bigv long varchar; set @bigv = repeat( 'x', 10000 ); execute immediate 'call callme( @bigv )'; end;
You should see in your database server console the message:
callme has been called with length(v) = 10000
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.