Page 1 of 1

How to use parameters in TpgScript?

Posted: Fri 10 Nov 2017 15:49
by fgomes
I'm evaluating pgDAC to replace FireDAC, which I just use to execute a script that creates a new pg schema from a metadata.sql file.

In FireDAC I used &1 in the .sql file and then used:

Code: Select all

Script.Arguments.Add('schema_name');
This would replace &1 to 'schema_name' in the script.

I tried using Params in TpgScript but the param values where just ignored, what's the correct way to replace a param in a script?

Re: How to use parameters in TpgScript?

Posted: Tue 14 Nov 2017 08:49
by azyk
To replace code blocks in SQL query, you can use PgDAC macros instead of parameters. You can read more details about this in our online documentation: https://www.devart.com/pgdac/docs/?work_macros.htm

Re: How to use parameters in TpgScript?

Posted: Thu 16 Nov 2017 11:21
by fgomes
Thanks, that solved the problem.