Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Using single and double quotes in sql statements.

3 posts in JDBC Connect (product renamed to JConnect) Last posting was on 1997-10-17 14:07:17.0Z
Venkata Viswanathan Posted on 1997-10-17 00:03:22.0Z
Message-ID: <3446AB4A.3F29@sybase.com>
Date: Thu, 16 Oct 1997 17:03:22 -0700
From: Venkata Viswanathan <venkat@sybase.com>
Organization: Sybase, Inc.
X-Mailer: Mozilla 3.01Gold (X11; I; SunOS 5.5.1 sun4m)
MIME-Version: 1.0
CC: davec, stevew
Subject: Using single and double quotes in sql statements.
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 24
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:158
Article PK: 251910

Hi:
When I use the standard isql utility and issue a select
statement like:
select * from authors where au_id='427-17-2319'
it works.
When I use double quotes like this:
select * from authors where au_id="427-17-2319"
it also works.

But the same thing works only with single quotes in
Isql applet and gives a SQLException: Invalid column name '427-17-2319'
when I use double quotes.

This happens only if I have run the sql_server.sql script on my
SQL Server. If I haven't run the sql_server.sql script on my
SQL Server and execute either with single or with double quotes,
the query runs fine.

Any pointer, where I should look for more info about
this delimitors or quoted_identifiers?

Thanks
-Venkat
--
----------------------------------------------------------------
Venkat S. Viswanathan
Ph:(510) 922 0790. Fax:(510) 922 5331
Sybase, Inc. 1650 65th Street, Emeryville, CA 94608.


David Lance Wolf Posted on 1997-10-17 03:03:33.0Z
Message-ID: <3446D585.9C829DC2@sybase.com>
Date: Thu, 16 Oct 1997 20:03:33 -0700
From: David Lance Wolf <dwolf@sybase.com>
Organization: Sybase Professional Services
X-Mailer: Mozilla 4.02 [en] (Win95; I)
MIME-Version: 1.0
Subject: Re: Using single and double quotes in sql statements.
References: <3446AB4A.3F29@sybase.com>
Content-Type: multipart/mixed; boundary="------------9838600AF627844E8748AD48"
Newsgroups: sybase.public.jdbcconnect
Lines: 52
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:157
Article PK: 251909

Sounds to be like SET QUOTED IDENTIFIERS is being set to ON. Try
explicitly setting this off. I dont know if the driver does this, or
you need to just issues the language call.

Dave Wolf
Sybase Professional Services

Venkata Viswanathan wrote:
>
> Hi:
> When I use the standard isql utility and issue a select
> statement like:
> select * from authors where au_id='427-17-2319'
> it works.
> When I use double quotes like this:
> select * from authors where au_id="427-17-2319"
> it also works.
>
> But the same thing works only with single quotes in
> Isql applet and gives a SQLException: Invalid column name '427-17-2319'
> when I use double quotes.
>
> This happens only if I have run the sql_server.sql script on my
> SQL Server. If I haven't run the sql_server.sql script on my
> SQL Server and execute either with single or with double quotes,
> the query runs fine.
>
> Any pointer, where I should look for more info about
> this delimitors or quoted_identifiers?
>
> Thanks
> -Venkat
> --
> ----------------------------------------------------------------
> Venkat S. Viswanathan
> Ph:(510) 922 0790. Fax:(510) 922 5331
> Sybase, Inc. 1650 65th Street, Emeryville, CA 94608.


Download VCard vcard.vcf


Lance Andersen Posted on 1997-10-17 14:07:17.0Z
Message-ID: <34477115.5449@sybase.com>
Date: Fri, 17 Oct 1997 10:07:17 -0400
From: Lance Andersen <lancea@sybase.com>
X-Mailer: Mozilla 3.01Gold (X11; I; SunOS 5.5.1 sun4m)
MIME-Version: 1.0
To: David Lance Wolf <dwolf@sybase.com>
CC: venkat
Subject: Re: Using single and double quotes in sql statements.
References: <3446AB4A.3F29@sybase.com> <3446D585.9C829DC2@sybase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 63
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:155
Article PK: 251907

Yes, the driver does a
set Quoted Identifers on. This is what many jdbc applications will
expect as this follows the SQL ANSI standard.

See the T-SQL Reference manual for more details.


Also, in the future, please post to

news://forums.sybase.com/sybase.public.jconnect.


This newsgroup (sybase.public.jdbcconect) is going read only
shortly.

thankyou

lance

your friendly moderator

David Lance Wolf wrote:
>
> Sounds to be like SET QUOTED IDENTIFIERS is being set to ON. Try
> explicitly setting this off. I dont know if the driver does this, or
> you need to just issues the language call.
>
> Dave Wolf
> Sybase Professional Services
>
> Venkata Viswanathan wrote:
> >
> > Hi:
> > When I use the standard isql utility and issue a select
> > statement like:
> > select * from authors where au_id='427-17-2319'
> > it works.
> > When I use double quotes like this:
> > select * from authors where au_id="427-17-2319"
> > it also works.
> >
> > But the same thing works only with single quotes in
> > Isql applet and gives a SQLException: Invalid column name '427-17-2319'
> > when I use double quotes.
> >
> > This happens only if I have run the sql_server.sql script on my
> > SQL Server. If I haven't run the sql_server.sql script on my
> > SQL Server and execute either with single or with double quotes,
> > the query runs fine.
> >
> > Any pointer, where I should look for more info about
> > this delimitors or quoted_identifiers?
> >
> > Thanks
> > -Venkat
> > --
> > ----------------------------------------------------------------
> > Venkat S. Viswanathan
> > Ph:(510) 922 0790. Fax:(510) 922 5331
> > Sybase, Inc. 1650 65th Street, Emeryville, CA 94608.
>
> ---------------------------------------------------------------
>
> Name: vcard.vcf
> Part 1.2 Type: text/x-vcard
> Encoding: 7bit
> Description: Card for David Wolf

--
===============================================================================
Lance J. Andersen Email: lancea@sybase.com
Sybase Technical Support Phone:(617) 564-6336
77 South Bedford Street Fax: (617) 564-6148
Burlington, MA 01803

The Dark Knight Returns!!! Let's Go Penguins!!!
===============================================================================