Thread: [ psqlodbc-Bugs-1000507 ] MSSQL syntax

[ psqlodbc-Bugs-1000507 ] MSSQL syntax

From
Date:
Bugs item #1000507, was opened at 2005-12-27 02:23
You can respond by visiting:
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000507&group_id=1000125

Category: None
Group: None
Status: Open
Resolution: Rejected
Priority: 3
Submitted By: Nobody (None)
Assigned to: Ludek Finstrle (luf)
Summary: MSSQL syntax

Initial Comment:
MSSQL have a command that Postgresql don't support:

@@spid

This command returns MSSQL connection pid.

I've a application that uses this query. I can't change code, but i need that psqlodbc ignore this command.

----------------------------------------------------------------------

Comment By: Ludek Finstrle (luf)
Date: 2005-12-29 22:37

Message:
Yes, it needs MS Windows. And you need someone who could compile it for you in the future.

I go the easiest way I can. It could be buggy. I don't full test it. It find @@ (not in '' or "", \ is supported) and
nextstring of [a-zA-Z0-9_] it rewrite from @@<string> to string(). 

I attach patch againist psqlodbc-8.01.0106 (and CVS maybe too) and Windows psqlodbc[aw].dll which must be copied over
alreadyinstalled 8.01.XXXX release. 

This attachment is unofficial (with no next support) and whole this bug-report is rejected.

----------------------------------------------------------------------

Comment By: Hugo Sacramento (hugo_sacramento)
Date: 2005-12-29 21:41

Message:
ok,
I don't know Microsoft Windows(its need to compile on windows). I'm linux user. This is idea of migration, server
migrationto linux ;) but clients... 

Can there be only alfanumeric chars (a-zA-Z0-9 and _ ) after @@.

I'm sorry for your previous question about @@spid be whole command. I answered wrong. The command is always:
  select @@xyz

Could your patch to transform @@xyz to xyz() on statements???

I can wait sometimes.

Thanks a lot.

----------------------------------------------------------------------

Comment By: Ludek Finstrle (luf)
Date: 2005-12-29 19:09

Message:
Ok, it would be easier this way.

Can there be only alfanumeric chars (a-zA-Z0-9) after @@
or what set of char could be after @@?
I'm sorry I don't want learn MSSQL specification. I want create patch which fit all @@ commands.

We don't support this feature in psqlODBC. I help you create the unofficial patch (please be patient I have a lot of
workduring X-mas). 

I don't want compile psqlodbc with this support each time some change appear in the source code.
It's better for you to have a chance compile psqlodbc yourself. So you can use the patch we made together now againist
futurereleases. 

Please try answer all questions I asked you in my previous note.

----------------------------------------------------------------------

Comment By: Nobody (None)
Date: 2005-12-29 15:32

Message:
@@spid is whole command, returns MSSQL connection pid. MSSQL have various @@xyz commands.

psqlodbc could filter this syntax(@@spid) when it was an whole command.

at least could not return an error.

----------------------------------------------------------------------

Comment By: Nobody (None)
Date: 2005-12-29 15:27

Message:
@@spid is whole command, returns MSSQL connection pid. MSSQL have various @@xyz commands.

psqlodbc could filter this syntax(@@spid) when it were an whole command

----------------------------------------------------------------------

Comment By: Ludek Finstrle (luf)
Date: 2005-12-29 07:49

Message:
Could you asnwer this question: @@spid is whole command or is it located inside statements (SELECT, UPDATE ...)?

What do you mean with "it can't compile this"? Do you get error message from compiler? What compiler are you using?
WhatOS are you using? What's the exact error message? 
What's your compiling steps? How have you changed the source code?

We don't support this feature officialy. I want help you to find your way but I don't have enough information.

----------------------------------------------------------------------

Comment By: Nobody (None)
Date: 2005-12-28 17:50

Message:
Hi Ludek,

Thanks for your response.

I'm trying to migrate for PostgreSQL, but my application is private. I haven't source code.

I try to do hack psqlodbc source code, but it can't compile this.

----------------------------------------------------------------------

Comment By: Ludek Finstrle (luf)
Date: 2005-12-27 10:01

Message:
I don't know if we want this behaviour. When you move to other DB do you think they will add support for this?

I need to talk about it with other developers. I'm againist this kind of support.

@@spid is whole command or is it located inside statements?

If you're a little bit familiar with C you can hack it into psqlodbc code yourself (I think in PGAPI_Prepare and
PGAPI_ExecDirect).

----------------------------------------------------------------------

Comment By: Nobody (None)
Date: 2005-12-27 02:25

Message:
can psqlodbc to transform all "@@xyz" syntax in:

xyz()

?????

----------------------------------------------------------------------

You can respond by visiting:
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000507&group_id=1000125