Macros not parsed on refresh

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
juanmaria
Posts: 14
Joined: Thu 11 Nov 2004 08:37

Macros not parsed on refresh

Post by juanmaria » Thu 10 Nov 2011 11:56

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.

AndreyZ

Post by AndreyZ » Thu 10 Nov 2011 13:43

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).

juanmaria
Posts: 14
Joined: Thu 11 Nov 2004 08:37

Post by juanmaria » Fri 11 Nov 2011 10:37

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.

AndreyZ

Post by AndreyZ » Fri 11 Nov 2011 11:24

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.

juanmaria
Posts: 14
Joined: Thu 11 Nov 2004 08:37

Post by juanmaria » Fri 11 Nov 2011 17:01

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

AndreyZ

Post by AndreyZ » Mon 14 Nov 2011 10:07

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.

AndreyZ

Post by AndreyZ » Wed 21 Dec 2011 10:00

We have fixed this problem. This fix will be included in the next SDAC build.

juanmaria
Posts: 14
Joined: Thu 11 Nov 2004 08:37

Post by juanmaria » Wed 18 Jan 2012 17:10

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?.

AndreyZ

Post by AndreyZ » Thu 19 Jan 2012 08:48

This problem is fixed in SDAC 6.1.4. You can download SDAC 6.1.4 from Registered Users' Area.

Post Reply