Page 1 of 1

error with a query using the IF statement

Posted: Mon 24 Mar 2014 10:29
by kaiserilich
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

Re: error with a query using the IF statement

Posted: Mon 24 Mar 2014 15:21
by AlexP
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.

Re: error with a query using the IF statement

Posted: Mon 24 Mar 2014 15:52
by kaiserilich
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???

Re: error with a query using the IF statement

Posted: Tue 25 Mar 2014 10:04
by AlexP
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.

Re: error with a query using the IF statement

Posted: Tue 25 Mar 2014 10:23
by kaiserilich
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

Re: error with a query using the IF statement

Posted: Tue 25 Mar 2014 14:19
by AlexP
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.

Re: error with a query using the IF statement

Posted: Wed 26 Mar 2014 08:00
by kaiserilich
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.

Re: error with a query using the IF statement

Posted: Wed 26 Mar 2014 09:20
by AlexP
We plan to release a new version in the next month.