How to use parameters in TpgScript?

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
fgomes
Posts: 7
Joined: Mon 24 Nov 2008 12:09

How to use parameters in TpgScript?

Post by fgomes » Fri 10 Nov 2017 15:49

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?

azyk
Devart Team
Posts: 1023
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: How to use parameters in TpgScript?

Post by azyk » Tue 14 Nov 2017 08:49

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

fgomes
Posts: 7
Joined: Mon 24 Nov 2008 12:09

Re: How to use parameters in TpgScript?

Post by fgomes » Thu 16 Nov 2017 11:21

Thanks, that solved the problem.

Post Reply