Home » RDBMS Server » Server Administration » inserting into the table
inserting into the table [message #372650] Fri, 02 March 2001 01:32 Go to next message
JOHN
Messages: 182
Registered: April 1998
Senior Member
how can I insert special characters like ' , into the table

for ex: in one table i have a column by name favourite things and when I want to insert the data into that under favourites column I have to enter multiple selections, so i want to use , in between them.

pls help me regarding this.
Re: inserting into the table [message #372655 is a reply to message #372650] Fri, 02 March 2001 08:02 Go to previous messageGo to next message
Joachim Lindner
Messages: 30
Registered: February 2001
Member
Don't know if I got you right, but this should help ...

insert into tab (name, favourite_things)
values ('John', 'Don''t know');

Two subsequent quotes in the insert string command produce a single quote in the table column value.
Re: inserting into the table [message #372656 is a reply to message #372650] Fri, 02 March 2001 08:47 Go to previous messageGo to next message
ramu
Messages: 82
Registered: February 2001
Member
Hi,
You can insert the special characters into a character datatype.

If you want to add other than ('), you can insert the characters as it is:

For example,

If you have the table A with FAVOURITES then do the following:

insert into A values('&FAVOURITES');

and give the values as your wish like

~
@
#
$
,
"
|
and so on..

But you want to insert ' for that column, you should careful..

Enter ''(single quote twice)..

If you want to insert a value like abc&co., into FAVOURITES then what will you do?

Try this..

insert into A values('abc'||'&'||'co.,');

Thanks..
Ramu..
Re: inserting into the table [message #372664 is a reply to message #372656] Fri, 02 March 2001 13:57 Go to previous messageGo to next message
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
Regarding the & character. In sqlplus this can cause conflicts because it is used for variable substitution. You can however disable it or define it as something else.

SQL> set scan off
SQL> insert into a values ('abc&co');

1 row created.

SQL> set scan on
SQL> set define '|'
SQL> insert into a values ('abc&co');

1 row created.
Re: inserting into the table [message #372665 is a reply to message #372655] Fri, 02 March 2001 14:53 Go to previous messageGo to next message
JOHN
Messages: 182
Registered: April 1998
Senior Member
Thanks you very much for your help. I am so sorry not able to explain my doubt properly.

I have a form and the field label is which product the user likes want to know. supoose if he want to emters microsoft's what I have to write in the statement.

when i am testing the form it's not allowing me to enter like that? I know that my sql statement is wrong, how can I concatenate that special character(') to that field with in a single statement and allow changes commit to database?

can you please help me in this regard?

john
Re: inserting into the table [message #372666 is a reply to message #372655] Fri, 02 March 2001 14:54 Go to previous messageGo to next message
JOHN
Messages: 182
Registered: April 1998
Senior Member
Thanks you very much for your help. I am so sorry not able to explain my doubt properly.

I have a form and the field label is which product the user likes want to know. supoose if he want to emters microsoft's what I have to write in the statement.

when i am testing the form it's not allowing me to enter like that? I know that my sql statement is wrong, how can I concatenate that special character(') to that field with in a single statement and allow changes commit to database?

can you please help me in this regard?

john
Re: inserting into the table [message #372667 is a reply to message #372655] Fri, 02 March 2001 14:54 Go to previous messageGo to next message
JOHN
Messages: 182
Registered: April 1998
Senior Member
Thanks you very much for your help. I am so sorry not able to explain my doubt properly.

I have a form and the field label is which product the user likes want to know. supoose if he want to emters microsoft's what I have to write in the statement.

when i am testing the form it's not allowing me to enter like that? I know that my sql statement is wrong, how can I concatenate that special character(') to that field with in a single statement and allow changes commit to database?

can you please help me in this regard?

john
Re: inserting into the table [message #372668 is a reply to message #372655] Fri, 02 March 2001 14:55 Go to previous messageGo to next message
JOHN
Messages: 182
Registered: April 1998
Senior Member
Thanks you very much for your help. I am so sorry not able to explain my doubt properly.

I have a form and the field label is which product the user likes want to know. supoose if he want to emters microsoft's what I have to write in the statement.

when i am testing the form it's not allowing me to enter like that? I know that my sql statement is wrong, how can I concatenate that special character(') to that field with in a single statement and allow changes commit to database?

can you please help me in this regard?

john
Re: inserting into the table [message #372669 is a reply to message #372655] Fri, 02 March 2001 14:56 Go to previous messageGo to next message
JOHN
Messages: 182
Registered: April 1998
Senior Member
Thanks you very much for your help. I am so sorry not able to explain my doubt properly.

I have a form and the field label is which product the user likes want to know. supoose if he want to emters microsoft's what I have to write in the statement.

when i am testing the form it's not allowing me to enter like that? I know that my sql statement is wrong, how can I concatenate that special character(') to that field with in a single statement and allow changes commit to database?

can you please help me in this regard?

john
Re: inserting into the table [message #372670 is a reply to message #372655] Fri, 02 March 2001 14:57 Go to previous messageGo to next message
JOHN
Messages: 182
Registered: April 1998
Senior Member
Thanks you very much for your help. I am so sorry not able to explain my doubt properly.

I have a form and the field label is which product the user likes want to know. supoose if he want to emters microsoft's what I have to write in the statement.

when i am testing the form it's not allowing me to enter like that? I know that my sql statement is wrong, how can I concatenate that special character(') to that field with in a single statement and allow changes commit to database?

can you please help me in this regard?

john
Re: inserting into the table [message #372671 is a reply to message #372655] Fri, 02 March 2001 14:57 Go to previous messageGo to next message
JOHN
Messages: 182
Registered: April 1998
Senior Member
Thanks you very much for your help. I am so sorry not able to explain my doubt properly.

I have a form and the field label is which product the user likes want to know. supoose if he want to emters microsoft's what I have to write in the statement.

when i am testing the form it's not allowing me to enter like that? I know that my sql statement is wrong, how can I concatenate that special character(') to that field with in a single statement and allow changes commit to database?

can you please help me in this regard?

john
Re: inserting into the table [message #372672 is a reply to message #372655] Fri, 02 March 2001 14:58 Go to previous messageGo to next message
JOHN
Messages: 182
Registered: April 1998
Senior Member
Thanks you very much for your help. I am so sorry not able to explain my doubt properly.

I have a form and the field label is which product the user likes want to know. supoose if he want to emters microsoft's what I have to write in the statement.

when i am testing the form it's not allowing me to enter like that? I know that my sql statement is wrong, how can I concatenate that special character(') to that field with in a single statement and allow changes commit to database?

can you please help me in this regard?

john
Re: inserting into the table [message #372673 is a reply to message #372656] Fri, 02 March 2001 15:00 Go to previous messageGo to next message
JOHN
Messages: 182
Registered: April 1998
Senior Member
Thanks you very much for your help. I am so sorry not able to explain my doubt properly.

I have a form and the field label is which product the user likes want to know. supoose if he want to emters microsoft's what I have to write in the statement.

when i am testing the form it's not allowing me to enter like that? I know that my sql statement is wrong, how can I concatenate that special character(') to that field with in a single statement and allow changes commit to database?

can you please help me in this regard?
Re: inserting into the table [message #372675 is a reply to message #372656] Fri, 02 March 2001 15:04 Go to previous message
JOHN
Messages: 182
Registered: April 1998
Senior Member
Thanks you very much for your help. I am so sorry not able to explain my doubt properly.

I have a form and the field label is which product the user likes want to know. supoose if he want to emters microsoft's what I have to write in the statement.

when i am testing the form it's not allowing me to enter like that? I know that my sql statement is wrong, how can I concatenate that special character(') to that field with in a single statement and allow changes commit to database?

can you please help me in this regard?
Previous Topic: How to insert an & in a varchar2 throw a SQL script ?
Next Topic: Re: How to insert an & in a varchar2 throw a SQL script ?
Goto Forum:
  


Current Time: Sun Jun 30 16:54:34 CDT 2024