Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Obtain string of IN variable name in PL/SQL

chris001Nov 20 2012 — edited Nov 26 2012
Hi,
Odd question. Is there a way to access an IN variable's object name in a procedure?

eg.
procedure (var1    IN VARCHAR2(6),
                var2    IN VARCHAR2(6),
                var3    IN VARCHAR2(6))

IS....
You run this procedure and pass in parameters of:

var1 => 'abcdef',
var2 => 'defghi',
var3 => 'ghikjl';

In the code, I want to access the number in the string of the +variable name: var1+

In a naive sense,
num_of_in_var := substr(var1, 4,1) 
would be what i was hoping to achieve, but,

var1 is set to 'abcdef' so,
num_of_in_var := substr(var1, 4,1) 
would return 'd'.

Any thoughts?

Thanks

Edited by: chris001 on Nov 20, 2012 1:16 PM
This post has been answered by Gaurav Bhide on Nov 21 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 24 2012
Added on Nov 20 2012
10 comments
1,352 views