Home > Archive > SQL Server JDBC > February 2006 > Using field with character '?' has part of column name









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Using field with character '?' has part of column name
Pedro Semedo

2006-02-15, 11:23 am

We are using jdbc connection to a sql server database and performing as part
of the query :

SELECT "Alter morada PTR1?" FROM dbo.[Alterações Ccts Dedicados].

But we are receiving the error

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC]& #91;SQLServer]Invali
d column name 'Alter morada PTR1[@P1]'.

The problem is the special character '?'

We already try to put the carachter ? between [] , but it dosent work using
the jdbc connection. Using query analyzer the query executes ok.

Help in this issue will be apreciated,

Pedro Semedo
Joe Weinstein

2006-02-15, 11:23 am



Pedro Semedo wrote:
> We are using jdbc connection to a sql server database and performing as part
> of the query :
>
> SELECT "Alter morada PTR1?" FROM dbo.[Alterações Ccts Dedicados].
>
> But we are receiving the error
>
> java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
> JDBC]& #91;SQLServer]Invali
d column name 'Alter morada PTR1[@P1]'.
>
> The problem is the special character '?'
>
> We already try to put the carachter ? between [] , but it dosent work using
> the jdbc connection. Using query analyzer the query executes ok.
>
> Help in this issue will be apreciated,
>
> Pedro Semedo


The trouble is that '?' is a JDBC SQL character for
parameter markers. I tried making this call before before
executing the statement:

stmt. setEscapeProcessing(
false);

but that didn't work. It's a bug in the old MS driver. You
will have to upgrade to the new SQL2005 driver in order to
get this to work.

HTH,
Joe Weinstein at BEA Systems

Sue Purkis

2006-02-25, 9:28 am

We have confirmed that this is an issue with the MS SQL Server 2000 driver.
We will be reporting this to development. I will post again when we have a
fix for this problem.

Sue Purkis
DataDirect Technologies


"Pedro Semedo" <pdsemedo@hotmail.com> wrote in message
news:C0250BEB-C419-4003-BCE2- 73DCE7303BDC@microso
ft.com...
> We are using jdbc connection to a sql server database and performing as
> part
> of the query :
>
> SELECT "Alter morada PTR1?" FROM dbo.[Alterações Ccts Dedicados].
>
> But we are receiving the error
>
> java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
> JDBC]& #91;SQLServer]Invali
d column name 'Alter morada PTR1[@P1]'.
>
> The problem is the special character '?'
>
> We already try to put the carachter ? between [] , but it dosent work
> using
> the jdbc connection. Using query analyzer the query executes ok.
>
> Help in this issue will be apreciated,
>
> Pedro Semedo



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com