Skip to Content.
Sympa Menu

freetds - Re: JDBC driver bug when connecting to DB that starts with number

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Bob Kline <bkline AT rksystems.com>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: JDBC driver bug when connecting to DB that starts with number
  • Date: Thu, 7 Jun 2001 15:15:09 -0400 (EDT)


On Thu, 7 Jun 2001, Irfan Baig wrote:

> Problem Description:
>
> When I try to connect to a database whose name begins with a number (e.g.
> '4film'), I get the following exception:
>
> SQLException: Logon failed. Msg 170, Lvl 15, State 1, Line 1:
> Incorrect syntax near '4'., Server BENITEZ, Procedure , Line 1 0
> connection are in use by this program SQLState: null VendorError: 0

According to Date's guide to the SQL Standard:

"An identifier is either a regular identifier or a delimited
identifier.
* A regular identifier is a string of not more than 128 characters,
of which the first must be a letter (upper or lower case); the rest
can be any combination of upper or lower case letters, digits, and
the underscore character ("_"). ....
* A delimited identifier is any string of not more than 128
characters (not necessarily SQL language characters) enclosed in
quotation marks. ...."

So, the obvious question is, what happens when you enclose the database
name in quotes?

--
Bob Kline
mailto:bkline AT rksystems.com
http://www.rksystems.com





Archive powered by MHonArc 2.6.24.

Top of Page