dbTalk Databases Forums  

Inserting string data including &

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss Inserting string data including & in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tim Slattery
 
Posts: n/a

Default Inserting string data including & - 08-12-2008 , 12:58 PM






I'm trying to load a database table. The table contains several string
columns, and in many places the value of that string must contain an
ampersand (&).

When I code an insert statement like this:

insert into edit_messages (edit_number, title, intro)
values(123, '--  line of error message', '--  line 2 of
message);

SQL*Plus assumes that &nbsp is a variable and prompts me for a value
for it. Is there a way to escape the & so that it becomes just part of
the string?

--
Tim Slattery
Slattery_T (AT) bls (DOT) gov
http://members.cox.net/slatteryt

Reply With Quote
  #2  
Old   
Aya the Vampire Slayer
 
Posts: n/a

Default Re: Inserting string data including & - 08-12-2008 , 01:23 PM






Tim Slattery <Slattery_T (AT) bls (DOT) gov> wa:
Quote:
I'm trying to load a database table. The table contains several string
columns, and in many places the value of that string must contain an
ampersand (&).

When I code an insert statement like this:

insert into edit_messages (edit_number, title, intro)
values(123, '--&nbsp; line of error message', '--&nbsp; line 2 of
message);

SQL*Plus assumes that &nbsp is a variable and prompts me for a value
for it. Is there a way to escape the & so that it becomes just part of
the string?
Preface it with and follow it up with:

set def off

insert into edit_messages (edit_number, title, intro)
values(123, '--&nbsp; line of error message', '--&nbsp; line 2 of
message);

set def on

(you can also change the def character, "set def `" or some other
character you don't use)



Or, you can use the chr() function for amp in it:

insert into edit_messages (edit_number, title, intro)
values(123, '--'||chr(38)||'nbsp; stuff...', '--'||chr(38)||'nbsp;
more stuff');


--
"Care must be exorcised when handring Opiticar System as it is apts to
be sticked by dusts and hand-fat." --Japanese Translators

"Keep your fingers off the lens." --Elton Byington, English Translator


Reply With Quote
  #3  
Old   
Aya the Vampire Slayer
 
Posts: n/a

Default Re: Inserting string data including & - 08-12-2008 , 01:23 PM



Tim Slattery <Slattery_T (AT) bls (DOT) gov> wa:
Quote:
I'm trying to load a database table. The table contains several string
columns, and in many places the value of that string must contain an
ampersand (&).

When I code an insert statement like this:

insert into edit_messages (edit_number, title, intro)
values(123, '--&nbsp; line of error message', '--&nbsp; line 2 of
message);

SQL*Plus assumes that &nbsp is a variable and prompts me for a value
for it. Is there a way to escape the & so that it becomes just part of
the string?
Preface it with and follow it up with:

set def off

insert into edit_messages (edit_number, title, intro)
values(123, '--&nbsp; line of error message', '--&nbsp; line 2 of
message);

set def on

(you can also change the def character, "set def `" or some other
character you don't use)



Or, you can use the chr() function for amp in it:

insert into edit_messages (edit_number, title, intro)
values(123, '--'||chr(38)||'nbsp; stuff...', '--'||chr(38)||'nbsp;
more stuff');


--
"Care must be exorcised when handring Opiticar System as it is apts to
be sticked by dusts and hand-fat." --Japanese Translators

"Keep your fingers off the lens." --Elton Byington, English Translator


Reply With Quote
  #4  
Old   
Aya the Vampire Slayer
 
Posts: n/a

Default Re: Inserting string data including & - 08-12-2008 , 01:23 PM



Tim Slattery <Slattery_T (AT) bls (DOT) gov> wa:
Quote:
I'm trying to load a database table. The table contains several string
columns, and in many places the value of that string must contain an
ampersand (&).

When I code an insert statement like this:

insert into edit_messages (edit_number, title, intro)
values(123, '--&nbsp; line of error message', '--&nbsp; line 2 of
message);

SQL*Plus assumes that &nbsp is a variable and prompts me for a value
for it. Is there a way to escape the & so that it becomes just part of
the string?
Preface it with and follow it up with:

set def off

insert into edit_messages (edit_number, title, intro)
values(123, '--&nbsp; line of error message', '--&nbsp; line 2 of
message);

set def on

(you can also change the def character, "set def `" or some other
character you don't use)



Or, you can use the chr() function for amp in it:

insert into edit_messages (edit_number, title, intro)
values(123, '--'||chr(38)||'nbsp; stuff...', '--'||chr(38)||'nbsp;
more stuff');


--
"Care must be exorcised when handring Opiticar System as it is apts to
be sticked by dusts and hand-fat." --Japanese Translators

"Keep your fingers off the lens." --Elton Byington, English Translator


Reply With Quote
  #5  
Old   
Aya the Vampire Slayer
 
Posts: n/a

Default Re: Inserting string data including & - 08-12-2008 , 01:23 PM



Tim Slattery <Slattery_T (AT) bls (DOT) gov> wa:
Quote:
I'm trying to load a database table. The table contains several string
columns, and in many places the value of that string must contain an
ampersand (&).

When I code an insert statement like this:

insert into edit_messages (edit_number, title, intro)
values(123, '--&nbsp; line of error message', '--&nbsp; line 2 of
message);

SQL*Plus assumes that &nbsp is a variable and prompts me for a value
for it. Is there a way to escape the & so that it becomes just part of
the string?
Preface it with and follow it up with:

set def off

insert into edit_messages (edit_number, title, intro)
values(123, '--&nbsp; line of error message', '--&nbsp; line 2 of
message);

set def on

(you can also change the def character, "set def `" or some other
character you don't use)



Or, you can use the chr() function for amp in it:

insert into edit_messages (edit_number, title, intro)
values(123, '--'||chr(38)||'nbsp; stuff...', '--'||chr(38)||'nbsp;
more stuff');


--
"Care must be exorcised when handring Opiticar System as it is apts to
be sticked by dusts and hand-fat." --Japanese Translators

"Keep your fingers off the lens." --Elton Byington, English Translator


Reply With Quote
  #6  
Old   
Aya the Vampire Slayer
 
Posts: n/a

Default Re: Inserting string data including & - 08-12-2008 , 01:23 PM



Tim Slattery <Slattery_T (AT) bls (DOT) gov> wa:
Quote:
I'm trying to load a database table. The table contains several string
columns, and in many places the value of that string must contain an
ampersand (&).

When I code an insert statement like this:

insert into edit_messages (edit_number, title, intro)
values(123, '--&nbsp; line of error message', '--&nbsp; line 2 of
message);

SQL*Plus assumes that &nbsp is a variable and prompts me for a value
for it. Is there a way to escape the & so that it becomes just part of
the string?
Preface it with and follow it up with:

set def off

insert into edit_messages (edit_number, title, intro)
values(123, '--&nbsp; line of error message', '--&nbsp; line 2 of
message);

set def on

(you can also change the def character, "set def `" or some other
character you don't use)



Or, you can use the chr() function for amp in it:

insert into edit_messages (edit_number, title, intro)
values(123, '--'||chr(38)||'nbsp; stuff...', '--'||chr(38)||'nbsp;
more stuff');


--
"Care must be exorcised when handring Opiticar System as it is apts to
be sticked by dusts and hand-fat." --Japanese Translators

"Keep your fingers off the lens." --Elton Byington, English Translator


Reply With Quote
  #7  
Old   
Aya the Vampire Slayer
 
Posts: n/a

Default Re: Inserting string data including & - 08-12-2008 , 01:23 PM



Tim Slattery <Slattery_T (AT) bls (DOT) gov> wa:
Quote:
I'm trying to load a database table. The table contains several string
columns, and in many places the value of that string must contain an
ampersand (&).

When I code an insert statement like this:

insert into edit_messages (edit_number, title, intro)
values(123, '--&nbsp; line of error message', '--&nbsp; line 2 of
message);

SQL*Plus assumes that &nbsp is a variable and prompts me for a value
for it. Is there a way to escape the & so that it becomes just part of
the string?
Preface it with and follow it up with:

set def off

insert into edit_messages (edit_number, title, intro)
values(123, '--&nbsp; line of error message', '--&nbsp; line 2 of
message);

set def on

(you can also change the def character, "set def `" or some other
character you don't use)



Or, you can use the chr() function for amp in it:

insert into edit_messages (edit_number, title, intro)
values(123, '--'||chr(38)||'nbsp; stuff...', '--'||chr(38)||'nbsp;
more stuff');


--
"Care must be exorcised when handring Opiticar System as it is apts to
be sticked by dusts and hand-fat." --Japanese Translators

"Keep your fingers off the lens." --Elton Byington, English Translator


Reply With Quote
  #8  
Old   
Aya the Vampire Slayer
 
Posts: n/a

Default Re: Inserting string data including & - 08-12-2008 , 01:23 PM



Tim Slattery <Slattery_T (AT) bls (DOT) gov> wa:
Quote:
I'm trying to load a database table. The table contains several string
columns, and in many places the value of that string must contain an
ampersand (&).

When I code an insert statement like this:

insert into edit_messages (edit_number, title, intro)
values(123, '--&nbsp; line of error message', '--&nbsp; line 2 of
message);

SQL*Plus assumes that &nbsp is a variable and prompts me for a value
for it. Is there a way to escape the & so that it becomes just part of
the string?
Preface it with and follow it up with:

set def off

insert into edit_messages (edit_number, title, intro)
values(123, '--&nbsp; line of error message', '--&nbsp; line 2 of
message);

set def on

(you can also change the def character, "set def `" or some other
character you don't use)



Or, you can use the chr() function for amp in it:

insert into edit_messages (edit_number, title, intro)
values(123, '--'||chr(38)||'nbsp; stuff...', '--'||chr(38)||'nbsp;
more stuff');


--
"Care must be exorcised when handring Opiticar System as it is apts to
be sticked by dusts and hand-fat." --Japanese Translators

"Keep your fingers off the lens." --Elton Byington, English Translator


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.