SQL Statement error

SQL Statement error

Post by Syed Rashi » Wed, 04 Jun 1997 04:00:00



Can anyone tell me what do I have to do to make the following update
statement to accept the "&" symbol in the first place. Is there anyway
to automate this, so any sql statment will accept "&" in any field?

SQL> update contact set cncompany = 'AB&D' where cncompid = 'cp9208'
  2  ;
Enter value for t: &D
old   1: update contact set cncompany = 'AB&D' where cncompid = 'cp9208
new   1: update contact set cncompany = 'AB&D' where cncompid = 'cp9208

1 row updated.

Thanks much
Syed Rashid

 
 
 

SQL Statement error

Post by Robert Christenso » Thu, 05 Jun 1997 04:00:00


You have two options in SQL*Plus:

1) Set the system parameter 'DEFINE' to any character other than the
ampersand.  Then your string will be interpreted as is.

2) Set the system parameter 'SCAN' off.  This disables all substitution,
and all strings are interpreted as is.


> Can anyone tell me what do I have to do to make the following update
> statement to accept the "&" symbol in the first place. Is there anyway
> to automate this, so any sql statment will accept "&" in any field?

> SQL> update contact set cncompany = 'AB&D' where cncompid = 'cp9208'
>   2  ;
> Enter value for t: &D
> old   1: update contact set cncompany = 'AB&D' where cncompid = 'cp9208
> new   1: update contact set cncompany = 'AB&D' where cncompid = 'cp9208

> 1 row updated.

> Thanks much
> Syed Rashid

--
---------------------
Robert Christenson

The Gazette Co.

 
 
 

SQL Statement error

Post by Jurij Mod » Thu, 05 Jun 1997 04:00:00




Quote:>Can anyone tell me what do I have to do to make the following update>statement to accept the "&" symbol in the first place. Is there anyway
>to automate this, so any sql statment will accept "&" in any field?

>SQL> update contact set cncompany = 'AB&D' where cncompid = 'cp9208'
>  2  ;
>Enter value for t: &D
>old   1: update contact set cncompany = 'AB&D' where cncompid = 'cp9208
>new   1: update contact set cncompany = 'AB&D' where cncompid = 'cp9208

>1 row updated.

>Thanks much
>Syed Rashid

Repeating one of my previous posting on similar question:

It is obvious you are having this problem in SQL*Plus. To avoid
SQL*Plus interpreting '&' as substitution character, you have several
options:

1. SET SCAN OFF
or
2. SET DEFINE OFF or SET DEFINE to any appropriate character other
than '&'
or
3. SET ESCAPE ON and then precede '&' with escape character (the
default escape character is '\'=

For more details look at SET command in SQL*Plus manual.

Regards,

============================================================
Jurij Modic                             Republic of Slovenia
tel: +386 61 178 55 14                  Ministry of Finance
fax: +386 61  21 45 84                  Zupanciceva 3

============================================================

 
 
 

SQL Statement error

Post by Kelly Youn » Thu, 05 Jun 1997 04:00:00



> Can anyone tell me what do I have to do to make the following update
> statement to accept the "&" symbol in the first place. Is there anyway
> to automate this, so any sql statment will accept "&" in any field?

> SQL> update contact set cncompany = 'AB&D' where cncompid = 'cp9208'
>   2  ;
> Enter value for t: &D
> old   1: update contact set cncompany = 'AB&D' where cncompid = 'cp9208
> new   1: update contact set cncompany = 'AB&D' where cncompid = 'cp9208

> 1 row updated.

> Thanks much
> Syed Rashid

SQL> set scan off
 
 
 

1. VB5. SQL Statement Error against MS SQL Server

  Let me first give you my environment....
    VB5. 0 on Windows NT 4.0 using ODBC ....
    The Access Routines in VB5.0 are RDO 2.0..
    MS SQL Server 6.5 is the version that comes with VB5.0 Enterprise
Edition...

My SQL statement is a simple Select statement like:

Select Table1.Field1, Table1.Field2, Table1.Field3 From Table1
Where Table1.Field1 = "USER_ID "

The error that I am getting from ODBC is that  "USER_ID" is an invalid
column name.  I thought that this was an owner problem... So I set up my
user id as an alias dbo... still no change.

Any help would be appreciated.,
TIA
Tom

2. DBA! how to:Lat long calculations

3. SQL statement error???

4. Reports

5. SQL Statement Error

6. SQL*PLUS

7. sql statement error

8. SP2 sp1.sql script fails

9. Invalid SQL Statement Error

10. SQL statement error in Crystal Reports

11. How can we capture each sql statement error on the DB

12. SQL statement error