Return names of bind variables [message #680585] |
Sat, 23 May 2020 06:50  |
 |
nbs
Messages: 4 Registered: May 2020
|
Junior Member |
|
|
Hi.
Is there a way to return the names of all bind-variables in a plsql-script?
I'm calling the script from a C#-application.
Here's an example:
DECLARE
ORDER_NO_ VARCHAR2(20) := :ORDER_NO;
LINE_NO_ VARCHAR2(20) := :LINE_NO;
RELEASE_NO_ VARCHAR2(20) := :RELEASE_NO;
BEGIN
SOLUTION_API.PO_RECEIVE(ORDER_NO_,
LINE_NO_,
RELEASE_NO_);
END;
Friendly regards
nbs
|
|
|
Re: Return names of bind variables [message #680589 is a reply to message #680585] |
Sat, 23 May 2020 09:48   |
 |
Michel Cadot
Messages: 68418 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
Welcome to the forum.
Please read the OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Indent the code, use code tags and align the columns in result.
Also always post your Oracle version, with 4 decimals (query v$version), as often solution depends on it.
Are you sure "9.0.4.1644..." is your Oracle client or database version?
If you want the name of the bind variables in the script test it is more a (custom) syntax analyzer stuff than a PL/SQL one.
It could be as simple as (for the case at most one bind variable per line, this is just an example not a solution):
$ echo 'DECLARE
> ORDER_NO_ VARCHAR2(20) := :ORDER_NO;
> LINE_NO_ VARCHAR2(20) := :LINE_NO;
> RELEASE_NO_ VARCHAR2(20) := :RELEASE_NO;
>
> BEGIN
> SOLUTION_API.PO_RECEIVE(ORDER_NO_,
> LINE_NO_,
> RELEASE_NO_);
> END;' | grep -i ':[A-Z]' | sed -r -e 's/^.*(:[A-Z_#\$]+).*$/\1/i'
:ORDER_NO
:LINE_NO
:RELEASE_NO
Note that at Oracle level, they may not see your bind variable names. See some examples there.
[Updated on: Sat, 23 May 2020 09:51] Report message to a moderator
|
|
|
|
|
|
|
|