Home » Other » Client Tools » substr
substr [message #38660] Sat, 04 May 2002 16:05 Go to next message
mani
Messages: 105
Registered: September 1999
Senior Member
Hi,

iam trying to insert a ' in a string which is passed as input to my procedure.
ex: inputstr_i = 'AA, BB,CC';

how to put ' before and after ,.
basilcally i want output something like this.
inputstr_i = 'AA', 'BB', 'CC';

Appreciate any help
Re: substr [message #38662 is a reply to message #38660] Sat, 04 May 2002 20:08 Go to previous messageGo to next message
Vikas Gupta
Messages: 115
Registered: February 2002
Senior Member
You have to punch the quote twice.

ie. 'AA','BB','CC' will be ''AA'',''BB'',''CC''...
Re: substr [message #38668 is a reply to message #38662] Sun, 05 May 2002 06:20 Go to previous messageGo to next message
mani
Messages: 105
Registered: September 1999
Senior Member
vikas,

I want to know how to punch the string...

thanks
Re: substr [message #38689 is a reply to message #38660] Mon, 06 May 2002 11:48 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Assume p_string is your input parameter to the procedure and v_string is a variable.

v_string := '''' || replace(p_string, ',', ''',''') || '''';


An input string of AA,BB,CC will become: 'AA','BB','CC'
Previous Topic: Proc. called automatically from dB
Next Topic: How to create a auto indent primary key ?
Goto Forum:
  


Current Time: Thu Mar 28 08:51:42 CDT 2024