TUniQuery 2.5 Problems with curly Braces inside PL/TCL

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
adroege
Posts: 16
Joined: Tue 07 Apr 2009 16:13
Location: Orlando, FL

TUniQuery 2.5 Problems with curly Braces inside PL/TCL

Post by adroege » Thu 09 Apr 2009 18:21

I need to run a script similar to the following to define
a trigger function for PostgreSQL written in PL/TCL language.

Code: Select all

CREATE OR REPLACE FUNCTION testtcl()
  RETURNS trigger AS
$BODY$
spi_exec "SELECT relname AS tgname FROM pg_class WHERE relfilenode = $TG_relid"
if {[string equal -nocase $tgname audit]} { return OK }

return [array get NEW]
$BODY$
LANGUAGE 'pltcl' VOLATILE SECURITY DEFINER
;

Now with the 2.5 version of TUniQuery, I get the following
error: "Empty macro or function name"


Is there a property to set or some other workaround so that TUniQuery won't interpret the '{' as a macro in this instance?

Thanks.

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

Post by Plash » Fri 10 Apr 2009 07:12

Set the EnableUniSQL global variable from the Uni unit to False.

adroege
Posts: 16
Joined: Tue 07 Apr 2009 16:13
Location: Orlando, FL

Changing Uni.EnableUniSQL to False doesn't work

Post by adroege » Thu 16 Apr 2009 17:27

I'm doing the following:

Uni.EnableUniSQL := False;

But I get the message that this variable
can't be changed.


Is there something I'm missing?

Thanks.

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

Post by Plash » Fri 17 Apr 2009 06:53

We have fixed this problem. The fix will be included in the next build of UniDAC.

If you need the fix urgently, please contact us by e-mail unidac*devart*com, specify your licence number and Delphi version.

MarcoFerlini
Posts: 2
Joined: Fri 29 Sep 2006 16:42

Post by MarcoFerlini » Thu 14 May 2009 14:27

Hi,
I have the same problem with SQL Server and TUniStoreProc.
Setting Uni.EnableUniSQL := False; not work.....

Thank you,
Marco

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

Post by Plash » Fri 15 May 2009 08:07

If you cannot assign False to the EnableUniSQL variable, and have UniDAC with Sources, you can fix the problem in the following way:
- open the Uni.pas file;
- find the code:

Code: Select all

const
  EnableUniSQL: boolean = True;
- replace 'const' with 'var'.

This fix will be included in the next build of UniDAC.

Post Reply