dbTalk Databases Forums  

Re: JDBC Driver Problem

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Re: JDBC Driver Problem in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: JDBC Driver Problem - 07-28-2003 , 05:31 PM






Doug Baroter (qwert12345 (AT) boxfrog (DOT) com) writes:
Quote:
The following query executes fine with Query Analyzer
and the query execution shows up fine by CF debugging,
however, I got the following annoying err msg, please
note, I must use column alias for referencing later,
and if I don't use column alias the JDBC driver seems
to be OK but how come? column alias is a simple
function with any DBMS, no reason JDBC driver fails to
support it. I don't know the driver's version. Any one shed some light?
This has nothing to do with JDBC. What is happening is that when
you run the command from JDBC, one or more of @col1, @col2 and @col3
are never assigned any value, yield in correct SQL.

A tip is that when you generate dynamic SQL, to always include a debug
path that printes the SQL string.

Since you say that it works in QA, my guess is that he JDBC thing
does not execute in the same database as you run it from QA.

And why you have a hardcoded object id is beyond me...

--
Erland Sommarskog, SQL Server MVP, sommar (AT) algonet (DOT) se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp


Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: JDBC Driver Problem - 07-29-2003 , 02:35 AM






Doug Baroter (qwert12345 (AT) boxfrog (DOT) com) writes:
Quote:
"And why you have a hardcoded object id is beyond me..."
No, I copied it over from a successful execution.
Does that object still live?

I should probably have emphasized that the last bracket in the message
makes it clear that it comes from SQL Server.

[Macromedia][SQLServer JDBC Driver][SQLServer]
Incorrect syntax near the keyword 'as'.

Thus, the likelihood that the JDBC driver is the culprit is small. That
would imply that the JDBC driver mangles the batch somehow. And it
certainly has nothing to do with JDBC driver not supporting column
aliases.

Exactly how does the Java code that emits this SQL look like? From
where do you get the object ID?

If you have admin priviledges on SQL Server, you can use the Profiler
to see what actually is sent to SQL Server.

--
Erland Sommarskog, SQL Server MVP, sommar (AT) algonet (DOT) se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp


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.