Hi !
I am experiencing some problems with MSSQL (ver 8.0).
While I can execute sub-select statement directly on a MSSQL server,
I cannot do the same thing in JDBC.
Like the following statement( JDBC throws exception about mismatched
type)
select idcolumn,a,b,c FROM mytable WHERE idcolumn = (SELECT max
(idcolumn) FROM mytable
I could get the result other way too (like top 1 and descend sort
etc..), but this would be the fastest way and I want to use it.
I am connecting to database server without any settings, just IP,
username and password.
On mysql, I had a several options I could specify in a connect string,
so the server acts different.
Is there any setting I can specify which can help me ? Where can I
read all parameters I can specify when connecting via JDBC to Microsoft
SQL ?
Thx.
Rhino - 29 Oct 2005 22:29 GMT
> Hi !
>
[quoted text clipped - 23 lines]
>
> Thx.
Your question may be better suited to comp.lang.java.databases than
comp.lang.java.programmer. One of the many SQL Server newsgroups over at
Microsoft might also be a good place to ask this if you don't get any good
answers under comp.lang.java.*.
Then again, maybe someone here will have the answer at his/her fingertips
:-)
Rhino
miki.miska@yahoo.com - 30 Oct 2005 22:20 GMT
> Your question may be better suited to comp.lang.java.databases than
> comp.lang.java.programmer. One of the many SQL Server newsgroups over at
[quoted text clipped - 5 lines]
>
> Rhino
Hm, I am getting old :) I had stucked with the current subscribed
newsgroups for a long time, so I didn't reallize I can find more
appropriate one :)
Thx.
Roedy Green - 31 Oct 2005 02:28 GMT
>Hm, I am getting old :) I had stucked with the current subscribed
>newsgroups for a long time, so I didn't reallize I can find more
>appropriate one :)
check out http://mindprod.com/jgloss/newsgroups.html
for a some others that may be of use too.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
jon martin solaas - 30 Oct 2005 19:55 GMT
> While I can execute sub-select statement directly on a MSSQL server,
> I cannot do the same thing in JDBC.
[quoted text clipped - 4 lines]
> select idcolumn,a,b,c FROM mytable WHERE idcolumn = (SELECT max
> (idcolumn) FROM mytable
I suppose it is not because of the missing right parenthesis enclosing the
inner select statement? It's just a typo in your posting, right?
> Is there any setting I can specify which can help me ? Where can I
> read all parameters I can specify when connecting via JDBC to Microsoft
> SQL ?
I suppose that depends on which driver you use... Try to read the manual
(sic). Maybe someone know if you post the actual driver you use, iNet,
Microsofts own etc.
A driver that doesn't support subselect sounds basically flawed. I can't
really imagine why someone would make a driver parameter to turn off
subselects either, and especially have it behave that way per default
sounds really weird.

Signature
jon martin solaas
Roedy Green - 31 Oct 2005 02:27 GMT
>I cannot do the same thing in JDBC.
what precisely is the error when you try?

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Bryce - 31 Oct 2005 16:28 GMT
>>I cannot do the same thing in JDBC.
>
>what precisely is the error when you try?
and what driver are you using?
--
now with more cowbell