Home » Other » Test » test
test [message #283770] Wed, 28 November 2007 02:13 Go to next message
soujanya_srk
Messages: 111
Registered: November 2006
Location: HYDERABAD
Senior Member

CREATE OR REPLACE FUNCTION Quoted_String (
    n_String       IN VARCHAR2)
RETURN VARCHAR2 -- Quoted string
AS
    l_Prg_Name VARCHAR2(30) := 'Quoted_String';
    o_String VARCHAR2(32767);
BEGIN
    o_String := ''''||REPLACE(n_String,'''','''''')||'''';
    RETURN o_String;
EXCEPTION
    WHEN OTHERS THEN
        RETURN SQLERRM||' in PL/SQL '||l_Prg_Name;
END Quoted_String;
/


Re: test [message #283772 is a reply to message #283770] Wed, 28 November 2007 02:18 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Good test.

Next step (with line numbers):
SQL> CREATE OR REPLACE FUNCTION Quoted_String (
  2      n_String       IN VARCHAR2)
  3  RETURN VARCHAR2 -- Quoted string
  4  AS
  5      l_Prg_Name VARCHAR2(30) := 'Quoted_String';
  6      o_String VARCHAR2(32767);
  7  BEGIN
  8      o_String := ''''||REPLACE(n_String,'''','''''')||'''';
  9      RETURN o_String;
 10  EXCEPTION
 11      WHEN OTHERS THEN
 12          RETURN SQLERRM||' in PL/SQL '||l_Prg_Name;
 13  END Quoted_String;
 14  /

Function created.

Regards
Michel

[Updated on: Wed, 28 November 2007 03:32]

Report message to a moderator

Re: test [message #283802 is a reply to message #283770] Wed, 28 November 2007 03:17 Go to previous message
kir_ait
Messages: 198
Registered: November 2007
Location: Bangalore,India
Senior Member

Nice one Mrs Soujanya!

Regards,
Kiran
Previous Topic: Its Cooooooooooooooooooool
Next Topic: Test image
Goto Forum:
  


Current Time: Fri Dec 02 18:40:39 CST 2016

Total time taken to generate the page: 0.31675 seconds