Home » SQL & PL/SQL » SQL & PL/SQL » inserting names with single quotations at SQL prompt
inserting names with single quotations at SQL prompt [message #3070] Tue, 03 September 2002 02:54 Go to next message
Aparna
Messages: 9
Registered: April 2001
Junior Member
Is there a way to insert names with single quotations at runtime. eg:- Inserting names with single quotations is handled by forms at runtime.
How this can be handled at the database side?

Any answers.
Re: inserting names with single quotations at SQL prompt [message #3071 is a reply to message #3070] Tue, 03 September 2002 03:16 Go to previous message
Mark
Messages: 284
Registered: July 1998
Senior Member
If you are inserting data directly into the DB (eg through Worksheet) there are 2 easy methods:

1) use 2 single quotes ('') eg

insert into TABLE (name)
values ('Mc''Person')

2) use the ACSII code eg

instert into TABLE (name)
values ('Mc' || chr(39) || 'Person')

Both methods enter the value: Mc'Person

Hope this helps?!
Previous Topic: ORA-01002: Fetch Out of Sequence
Next Topic: calculte the hours :minutes:sec
Goto Forum:
  


Current Time: Thu Apr 25 10:28:19 CDT 2024