Version 6: Question about SQLType value.

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Version 6: Question about SQLType value.

Post by MarkF » Mon 26 Mar 2007 13:14

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 27 Mar 2007 07:58

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.

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Post by MarkF » Thu 29 Mar 2007 14:16

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 30 Mar 2007 11:21

In the next ODAC build we'll restore old behaviour of the SQLType property.

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Post by MarkF » Fri 30 Mar 2007 12:07

Fantastic, Thanks!

mstaszew
Posts: 16
Joined: Tue 10 Feb 2009 15:04

Post by mstaszew » Wed 18 Feb 2009 19:13

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 19 Feb 2009 12:51

This problem was fixed but then it appears again. We'll fix it in the next ODAC build.

mstaszew
Posts: 16
Joined: Tue 10 Feb 2009 15:04

Post by mstaszew » Tue 30 Jun 2009 14:13

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 01 Jul 2009 07:13

SQLType is mapped to OCI 7 codes. There is no code for CREATE statement.

mstaszew
Posts: 16
Joined: Tue 10 Feb 2009 15:04

Post by mstaszew » Wed 01 Jul 2009 17:04

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

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Post by MarkF » Wed 01 Jul 2009 18:58

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.

mstaszew
Posts: 16
Joined: Tue 10 Feb 2009 15:04

Post by mstaszew » Wed 01 Jul 2009 19:02

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.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 03 Jul 2009 06:58

I have checked ODAC 6.25. It also returns 0 for CREATE TABLE statement.

gregoryliss
Posts: 13
Joined: Mon 19 Dec 2005 16:31

Still seeing this

Post by gregoryliss » Mon 06 Jul 2009 19:05

Updated to v6.8 and still seeing this problem.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 07 Jul 2009 07:13

Please specify the problem you encounter.

Post Reply