error with a query using the IF statement

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
kaiserilich
Posts: 23
Joined: Tue 23 Mar 2010 08:36
Location: spain
Contact:

error with a query using the IF statement

Post by kaiserilich » Mon 24 Mar 2014 10:29

hi,

i have this query into a UniQuery component:

Code: Select all

if :TipoBusqueda = 'OP1'
begin
	Select data1..c1, data1..c2, data4..c9
	from data1, data2
	where 
			data4..c1 = data1..c1
		and data1..c1 like :ID
		and data1..c6 *= :CLI
	.
	.
	....
end
else
begin
        if exists (select * from data1..c1 where data1..c1 like :ID and data1..c6 like :RSC )
        begin
			Select data1..c1, data1..c2, data2..c3 
			from data1, data2
			where 
					data2..c1 = data2..c1
				and data1..c1 like :ID
			.
			.
			....
		
        end
        else
        begin
			Select data1..c1, data1..c2, data3..c5
			from data1, data3
			where 
					data3..c1 = data1..c1
				and data1..c1 like :ID
			.
			.
			....			
		end
end
when try to execute with or without parameters display this error message:

Image

but when the query is executed using BDE don't have any problem..

i think the proble are on the IF statement... but i don't knok how solve into the component... and need that the statement stay into the component....

When execute the query without the IF statement don't have any error....

on this moment we are migrating our App from Delphi 6 with BDE to Delphi 6 with UniDAC.

i use:

Delphi 6 up 2
Unidac 5.2.7
ASE 12.5.4


somebody can help me

thanks so much

sorry for my bad english

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: error with a query using the IF statement

Post by AlexP » Mon 24 Mar 2014 15:21

Hello,

Probably the issue is caused by the use of a too old version of the driver. The version 15 does not cause such errors. Please try updating your ODBC driver to the version 15.

kaiserilich
Posts: 23
Joined: Tue 23 Mar 2010 08:36
Location: spain
Contact:

Re: error with a query using the IF statement

Post by kaiserilich » Mon 24 Mar 2014 15:52

AlexP wrote:Hello,

Probably the issue is caused by the use of a too old version of the driver. The version 15 does not cause such errors. Please try updating your ODBC driver to the version 15.
thanks. i go to try updating the driver.

but using UniDAC need a ODBC driver???

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: error with a query using the IF statement

Post by AlexP » Tue 25 Mar 2014 10:04

The direct working mode (whithout using clients and drivers) is supported for Oracle, MySQL, PostgreSQL, and SQLite. UniDAC works with other databases by using client libraries or ODBC drivers.

kaiserilich
Posts: 23
Joined: Tue 23 Mar 2010 08:36
Location: spain
Contact:

Re: error with a query using the IF statement

Post by kaiserilich » Tue 25 Mar 2014 10:23

AlexP wrote:The direct working mode (whithout using clients and drivers) is supported for Oracle, MySQL, PostgreSQL, and SQLite. UniDAC works with other databases by using client libraries or ODBC drivers.
OK, thanks so much.

I talk with our database department and is not possible install another version of Sybase driver. then need to know it's possible fix that error.?

the company want to migrate the platform to XE5 using UniDAC, at this moment I stay evaluating the components for the migration and the buy order was stopped for that error.. then my question is: It's possible or not?

thanks a lot

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: error with a query using the IF statement

Post by AlexP » Tue 25 Mar 2014 14:19

This problem only occurs in drivers v.12.5.1 and below, and is associated with the PrepareMethod ODBC parameter settings. We have fixed the problem by adding an option that is responsible for this parameter. This fix will be available in the next version of UniDAC.

kaiserilich
Posts: 23
Joined: Tue 23 Mar 2010 08:36
Location: spain
Contact:

Re: error with a query using the IF statement

Post by kaiserilich » Wed 26 Mar 2014 08:00

AlexP wrote:This problem only occurs in drivers v.12.5.1 and below, and is associated with the PrepareMethod ODBC parameter settings. We have fixed the problem by adding an option that is responsible for this parameter. This fix will be available in the next version of UniDAC.

thanks a lot, I wait for the new version.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: error with a query using the IF statement

Post by AlexP » Wed 26 Mar 2014 09:20

We plan to release a new version in the next month.

Post Reply