SqlServer does not return bind vars

General discussion forum about all databases other than SqlBase.
FRBhote
India
Posts: 2216
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

SqlServer does not return bind vars

Post by FRBhote » 26 Mar 2010, 14:37

I have a statement in TD 2.1 which contains an outer join with an empty table. The statement runs fine in both SqlTalk and SqlServer management studio and displays the row.

In TD, SQlFetchRow is FETCH_Ok, but the bind variables are all empy. If I remove this outer join, the variables are fine.

Tried with both the old style syntax and the ANSI outer join syntax - same prob.

Any help?

Jeff Luther

Re: SqlServer does not return bind vars

Post by Jeff Luther » 26 Mar 2010, 17:29

Maybe... but first how about us seeing the SQL statement and you putting together a small test case for this. That could help us and could help you.

What's the version of MS SS? Seems odd, since my understanding is that TD just sends the entire SQL query (after stripping off the INTO clause) right to the backend.

One thing: Try turning off Result Set mode and running the test again. SQLTalk has it OFF by default; TD has it ON by default.

FRBhote
India
Posts: 2216
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: SqlServer does not return bind vars

Post by FRBhote » 27 Mar 2010, 08:51

Here is a small test case.

Connect to any SqlServer Database, Click on connect and then create. It will create two tables PARTY & SUB_GROUP and insert data.

Then click on Display and Enter A or B or C. For A it displays fine with the outer join because the outer joins' predicates' values are in both tables. For B & C it does not. B & C have a value in one table and not in the other.

Now close the application and do the same with SqlBase. (I used Island). For all of A, B and C it displays the data.

Tested this with TD 5.2 also - result is the same.
You do not have the required permissions to view the files attached to this post.

Jeff Luther

Re: SqlServer does not return bind vars

Post by Jeff Luther » 31 Mar 2010, 00:54

I don't know, I can't repro. this. It seems to work for me:

I get the same NAME "X" for A, B, C in the top field. I'm connected remotely to our DB SQL Server 2005.
RESULTS-2.png
Doesn't look like it's the bind vars.
You do not have the required permissions to view the files attached to this post.

FRBhote
India
Posts: 2216
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: SqlServer does not return bind vars

Post by FRBhote » 31 Mar 2010, 06:53

I wonder why I don't get it! Can anyone throw some light on this?
OJ.JPG
You do not have the required permissions to view the files attached to this post.

Jeff Luther

Re: SqlServer does not return bind vars

Post by Jeff Luther » 31 Mar 2010, 19:18

Try your query in SQLTalk.

FRBhote
India
Posts: 2216
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: SqlServer does not return bind vars

Post by FRBhote » 01 Apr 2010, 12:53

In the above image, the top part is of SqlTalk and it does show the value.

FRBhote
India
Posts: 2216
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: SqlServer does not return bind vars

Post by FRBhote » 05 Apr 2010, 13:49

If the SQlServer ODBC driver is selected the INTO variable does not get a value. It does if the Native client driver is selected.

UVS

Re: SqlServer does not return bind vars

Post by UVS » 05 Apr 2010, 15:53

SLQ Server 2008, TD 5.2 SP1, Windows XP
your test program works fine for me using ODBC and not the Native Client.
Perhaps it is some setting on your SQL Server that is doing this?

MartinD

Jeff Luther

Re: SqlServer does not return bind vars

Post by Jeff Luther » 05 Apr 2010, 18:59

Just to clarify: I used ODBC to a MS SS 2005 DB and connections with both "SQL Server" and "SQL Native Client" drivers and both run test test in 5.2 OK.

UVS

Re: SqlServer does not return bind vars

Post by UVS » 05 Apr 2010, 22:12

I should clarify also...
Both Native Client and ODBC worked for me.

MartinD

FRBhote
India
Posts: 2216
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: SqlServer does not return bind vars

Post by FRBhote » 14 Apr 2010, 12:57

May I know the version of the ODBC driver and SqlServer that you are using?

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests