Page 1 of 1

Macros not parsed on refresh

Posted: Thu 10 Nov 2011 11:56
by juanmaria
Hi,

I've upgraded from SDAC version 3 to version 6.0.2 for Delphi 7 and I've noticed that sometimes the macros aren't being parsed.

It seems to happen on refresh, an example:

SELECT * FROM TABLE
WHERE FIELD1 > 0 and &macro
ORDER BY FIELD2

I set &macro as 'FIELD2 = 2' and when I open the query it executes (as seen on dbMonitor):

SELECT * FROM TABLE
WHERE FIELD1 > 0 and FIELD2 = 2
ORDER BY FIELD2

But when I insert a record it executes:

SELECT * FROM TABLE
WHERE (FIELD1 > 0 and &macro) AND FIELDN = :P_1_FIELDN [ and so on]
ORDER BY FIELD2

And, of course, I got a syntax error near ')'.

Any clue?.

Greetings from Spain.
Juan MarĂ­a.

Posted: Thu 10 Nov 2011 13:43
by AndreyZ
Hello,

It seems that you put your own SQL statement into the SQLInsert property. To solve the problem, you should remove your SQL statement from the SQLInsert property (make it blank).

Posted: Fri 11 Nov 2011 10:37
by juanmaria
AndreyZ wrote:Hello,

It seems that you put your own SQL statement into the SQLInsert property. To solve the problem, you should remove your SQL statement from the SQLInsert property (make it blank).
Hi,

I'm sorry but I've got nothing on SQLInsert, only on SQL. The extra fields on the where clause were added by the component on the refresh process.

This thing has happened me on other progrmans that were working fine with version 3. On those occasions I eliminated the macros but this time I need it because I need a variable "FIELD IN (Y,Y,Z)" on my where clause and I cannot do it with params.

I'm going to try writting a special SQLRefresh statement but I've lots of programs which use macros and I woludn't like to modify them all.

Posted: Fri 11 Nov 2011 11:24
by AndreyZ
I cannot reproduce the problem. Please try creating a small sample to demonstrate the problem and send it to andreyz*devart*com, including a script to create a table.

Posted: Fri 11 Nov 2011 17:01
by juanmaria
AndreyZ wrote:I cannot reproduce the problem. Please try creating a small sample to demonstrate the problem and send it to andreyz*devart*com, including a script to create a table.
Ok, I'm sending it in a few minutes.

I think that the problem appears when FullRefresh option is set to True

Posted: Mon 14 Nov 2011 10:07
by AndreyZ
Thank you for the information. We have reproduced the problem and the investigation of the problem is in progress. We will notify you when we have any results.

Posted: Wed 21 Dec 2011 10:00
by AndreyZ
We have fixed this problem. This fix will be included in the next SDAC build.

Posted: Wed 18 Jan 2012 17:10
by juanmaria
AndreyZ wrote:We have fixed this problem. This fix will be included in the next SDAC build.
Hi AndreyZ, is already downloadeable the build that fixes this problem with macros?.

Posted: Thu 19 Jan 2012 08:48
by AndreyZ
This problem is fixed in SDAC 6.1.4. You can download SDAC 6.1.4 from Registered Users' Area.