Page 1 of 1

TUniQuery 2.5 Problems with curly Braces inside PL/TCL

Posted: Thu 09 Apr 2009 18:21
by adroege
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.

Posted: Fri 10 Apr 2009 07:12
by Plash
Set the EnableUniSQL global variable from the Uni unit to False.

Changing Uni.EnableUniSQL to False doesn't work

Posted: Thu 16 Apr 2009 17:27
by adroege
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.

Posted: Fri 17 Apr 2009 06:53
by Plash
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.

Posted: Thu 14 May 2009 14:27
by MarcoFerlini
Hi,
I have the same problem with SQL Server and TUniStoreProc.
Setting Uni.EnableUniSQL := False; not work.....

Thank you,
Marco

Posted: Fri 15 May 2009 08:07
by Plash
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.