Page 1 of 2

Version 6: Question about SQLType value.

Posted: Mon 26 Mar 2007 13:14
by MarkF
Hi Folks!

With version 6, SQLType is being set to Unknown in TOCICommand.Finish. Is this intended? With version 5, I would run a command and then be able to check what type of command was run to give some feedback to the user and perhaps do other processing depending on the command type.

Thanks for any help!

-Mark Ford

Posted: Tue 27 Mar 2007 07:58
by Plash
In the new ODAC version the SQLType property is set to SQL_UNKNOWN when a query component becomes unprepared. To check the SQLType property after executing a command, you should set the AutoPrepare option of the TOraQuery component to True, or explicitly call the Prepare method.

Posted: Thu 29 Mar 2007 14:16
by MarkF
I've been looking into this today and I'm not sure I understand why the change was made. SQLType is being reset when the Oracle cursor is closed (which may happen at different times depending on various options.) Is there any reason why that is necessary?

It seems like SQLType should report the statement type that was run regardless of whether the Oracle cursor has been closed. This means that if we want to know the SQLType, we need to prepare the statement (which adds a server round trip) and keeps the cursor open even if autoclose is true. I'm not sure I see the downside to leaving the SQLType set to the correct value.

If I do something like:
OQuery.OptionsDS.AutoPrepare := False;
OQuery.OptionsDS.AutoClose := True;
OQuery.SQL.Text := 'some non-select statement or select where recordcount < Fetchrows';
OQuery.Execute();
// SQLType has been set and then reset in a single call, so we can't find out what it was.

Thanks for any help or insight!

-Mark

Posted: Fri 30 Mar 2007 11:21
by Plash
In the next ODAC build we'll restore old behaviour of the SQLType property.

Posted: Fri 30 Mar 2007 12:07
by MarkF
Fantastic, Thanks!

Posted: Wed 18 Feb 2009 19:13
by mstaszew
In which version will this be addressed? We are on version 6.7 and are seeing this as well. I don't see this listed as addressed when looking at the release history here... http://www.devart.com/odac/history.html

Thanks,
Michael

Posted: Thu 19 Feb 2009 12:51
by Plash
This problem was fixed but then it appears again. We'll fix it in the next ODAC build.

Posted: Tue 30 Jun 2009 14:13
by mstaszew
We are now on the latest, 6.80, and SQLType is 0 following a CREATE TABLE statement. When I insert into a table I am seeing SQLType set to 3 which is better than what we were seeing in the past, but it's still incomplete it seems.

Thanks,
Michael

Posted: Wed 01 Jul 2009 07:13
by Plash
SQLType is mapped to OCI 7 codes. There is no code for CREATE statement.

Posted: Wed 01 Jul 2009 17:04
by mstaszew
Is there any plan to expand support in this area? In past versions of ODAC several dozen values for SQLType were supported including one for CREATE TABLE. I believe that the last version that we used with success in this area was 6.25 on Delphi 7.

Thanks,
Michael

Posted: Wed 01 Jul 2009 18:58
by MarkF
I also think this may have been a change in a recent version. The SQLType for create table is 1. I'm pretty sure this used to work as I have a function that turns the number into a readable message and now I'm just getting a default message.

Posted: Wed 01 Jul 2009 19:02
by mstaszew
We have the same mapping for CREATE TABLE to 1 and, although I no longer have Delphi 7 and ODAC 6.25 installed, I have the old executable which takes the same SQLType parameter as input to the same function and it returns appropriate messages for many dozens of statements. This is largely non-functional in the latest ODAC.

Posted: Fri 03 Jul 2009 06:58
by Plash
I have checked ODAC 6.25. It also returns 0 for CREATE TABLE statement.

Still seeing this

Posted: Mon 06 Jul 2009 19:05
by gregoryliss
Updated to v6.8 and still seeing this problem.

Posted: Tue 07 Jul 2009 07:13
by Plash
Please specify the problem you encounter.