Home » SQL & PL/SQL » SQL & PL/SQL » How to pass string having '&' in it to procedure IN parameter
How to pass string having '&' in it to procedure IN parameter [message #184933] Fri, 28 July 2006 15:26 Go to next message
ramesh_samane
Messages: 63
Registered: May 2006
Member
I have a procedure which has IN VARCHAR2 parameter. I want to call it with a string which has '&' in it, for example 'aa&b'. How will I make the procedure aware that '&' is part of actual string and not ask for value of b when the procedure is executed.

Any expert comments please....Thanks in advance.
Re: How to pass string having '&' in it to procedure IN parameter [message #184943 is a reply to message #184933] Fri, 28 July 2006 17:02 Go to previous messageGo to next message
scottwmackey
Messages: 505
Registered: March 2005
Senior Member
It depends what tool you are using. With SQL+ you would use

SET DEFINE OFF

Other tools like Toad have a button you press to turn off scanning.
Re: How to pass string having '&' in it to procedure IN parameter [message #184976 is a reply to message #184933] Sat, 29 July 2006 06:36 Go to previous messageGo to next message
ramesh_samane
Messages: 63
Registered: May 2006
Member
I am calling it from front end application (Webfocus). I thought of creating one more procedure which will have "EXECUTE IMMEDIATE 'ALTER SESSSION...'" command to set session properties and calling this procedure before calling any other procedures. This method works but I couldn't find any way to set ESCAPE character at session level using "ALTER SESSION...."
Re: How to pass string having '&' in it to procedure IN parameter [message #185064 is a reply to message #184976] Sun, 30 July 2006 17:57 Go to previous messageGo to next message
William Robertson
Messages: 1640
Registered: August 2003
Location: London, UK
Senior Member
If you are not using SQL*Plus or other interactive tools which emulate the SQL*Plus substitution variable feature, I am surprised that you are encountering any problems. Perhaps they are to do with Webfocus or HTML itself, e.g. " " = nonbreaking space?

The "&" character has no special meaning in PL/SQL.
Re: How to pass string having '&' in it to procedure IN parameter [message #185147 is a reply to message #185064] Mon, 31 July 2006 04:00 Go to previous messageGo to next message
gold_oracl
Messages: 129
Registered: July 2006
Location: Westborough, MA
Senior Member
you can pass the values like this... procedure_name('aa'||chr(38)||'b');
Re: How to pass string having '&' in it to procedure IN parameter [message #185244 is a reply to message #184933] Mon, 31 July 2006 13:11 Go to previous message
ramesh_samane
Messages: 63
Registered: May 2006
Member
Guys thank you very much to you all for your help. As William said, I will need to check how frontend (webfocus) can be configured to disable this SQL Plus like feature. I have asked the frontend developer to check this as I am not aware about webfocus.

If anybody expert in Webfocus please let me know how to fix it. Your help highly apprciated.

Thanks again...

RAMESH.
Previous Topic: SQL CHALLENGE TO THE EXPERTS OUT THERE
Next Topic: view user privileges
Goto Forum:
  


Current Time: Sun Dec 04 00:48:26 CST 2016

Total time taken to generate the page: 0.14844 seconds