dbTalk Databases Forums  

Re: Problem entering data for TEXT type

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Re: Problem entering data for TEXT type in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
JJ Reynolds
 
Posts: n/a

Default Re: Problem entering data for TEXT type - 07-18-2003 , 01:01 PM






Before issuing your statement, in SQL*Plus, enter the command
set define off

SQL*Plus treats the & character as the start of a varialbe name. Set
define off disables this behavior.



"David Hall" <noone (AT) nowhere (DOT) com> wrote

Quote:
Hi all

This might be an FAQ question, so apologies if it's something very
fundamental. I've looked through the Oracle documentation, and spent some
considerable time scanning Google Groups, but I haven't found anything
that
deals specifically with the problem that I'm having.

One of my tables has a 'URI' column of TEXT type - and I'm having
difficulties with some of the values that I'm trying to enter from
SQL*Plus
under Oracle 8.0 Personal Edition. For example, one of the URL's looks
like:

http://www.websitename.com/forums/register.php?s=&action=signup'

The SQL I'm using looks like this:

INSERT INTO contact VALUES (4,
'http://www.websitename.com/forums/register.php?s=&action=signup')

...and when I submit it I get a prompt which says

"Enter value for action:"

If I just press [return]:

old 2: (4,
'http://www.websitename.com/forums/register.php?s=&action=signup')
new 2: (4,
'http://www.websitename.com/forums/register.php?s==signup')

...with the '&action' part removed. Can someone explain what's going on
here? Do I need to escape any '&' string segments somehow?

Many thanks in advance

David







Reply With Quote
  #2  
Old   
David Hall
 
Posts: n/a

Default Re: Problem entering data for TEXT type - 07-18-2003 , 01:15 PM






Ah-huh! Thank you kindly

David


"JJ Reynolds" <jjrjunk (AT) adelphia (DOT) net> wrote

Quote:
Before issuing your statement, in SQL*Plus, enter the command
set define off

SQL*Plus treats the & character as the start of a varialbe name. Set
define off disables this behavior.



"David Hall" <noone (AT) nowhere (DOT) com> wrote in message
news:bf9bhf$m89$1 (AT) newsg1 (DOT) svr.pol.co.uk...
Hi all

This might be an FAQ question, so apologies if it's something very
fundamental. I've looked through the Oracle documentation, and spent
some
considerable time scanning Google Groups, but I haven't found anything
that
deals specifically with the problem that I'm having.

One of my tables has a 'URI' column of TEXT type - and I'm having
difficulties with some of the values that I'm trying to enter from
SQL*Plus
under Oracle 8.0 Personal Edition. For example, one of the URL's looks
like:

http://www.websitename.com/forums/register.php?s=&action=signup'

The SQL I'm using looks like this:

INSERT INTO contact VALUES (4,
'http://www.websitename.com/forums/register.php?s=&action=signup')

...and when I submit it I get a prompt which says

"Enter value for action:"

If I just press [return]:

old 2: (4,
'http://www.websitename.com/forums/register.php?s=&action=signup')
new 2: (4,
'http://www.websitename.com/forums/register.php?s==signup')

...with the '&action' part removed. Can someone explain what's going on
here? Do I need to escape any '&' string segments somehow?

Many thanks in advance

David









Reply With Quote
  #3  
Old   
Alan
 
Posts: n/a

Default Re: Problem entering data for TEXT type - 07-18-2003 , 01:18 PM



But he would have had to have known that the ampersand was the problem to
know to search on "ampersand".


"Anurag Varma" <avarmadba.skipthis (AT) yahoo (DOT) com> wrote

Quote:
"David Hall" <noone (AT) nowhere (DOT) com> wrote in message
news:bf9bhf$m89$1 (AT) newsg1 (DOT) svr.pol.co.uk...
Hi all

--snip--
The SQL I'm using looks like this:

INSERT INTO contact VALUES (4,
'http://www.websitename.com/forums/register.php?s=&action=signup')

...and when I submit it I get a prompt which says

"Enter value for action:"
--snip--

Many thanks in advance

David

Its a FAQ all right.
I'll copy paste from my earlier reply (You could have found this yourself
by
searching for "oracle ampersand")

Choose your way:
SQL> create table x (a varchar2(10));
Table created.

SQL> insert into x values ('a'||chr(38)||'b');
1 row created.

SQL> set escape on
SQL> insert into x values ('x\&y');
1 row created.

SQL> set escape off
SQL> set define ^
SQL> insert into x values('m&n');
1 row created.

SQL> select * from x;
A
----------
a&b
x&y
m&n

.... or you can simply: "set define off"

Anurag







Reply With Quote
  #4  
Old   
Anurag Varma
 
Posts: n/a

Default Re: Problem entering data for TEXT type - 07-18-2003 , 01:41 PM




"Alan" <alan (AT) erols (DOT) com> wrote

Quote:
But he would have had to have known that the ampersand was the problem to
know to search on "ampersand".


.. true. But then he could have searched for "oracle prompt" or "oracle
enter value for" in this newsgroup
.... I bet he would have got his found it easily that it was the ampersand.

Anurag




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.