How to use parameters in TpgScript?

How to use parameters in TpgScript?

Postby 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?
fgomes
 
Posts: 7
Joined: Mon 24 Nov 2008 12:09

Re: How to use parameters in TpgScript?

Postby 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
azyk
Devart Team
 
Posts: 989
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: How to use parameters in TpgScript?

Postby fgomes » Thu 16 Nov 2017 11:21

Thanks, that solved the problem.
fgomes
 
Posts: 7
Joined: Mon 24 Nov 2008 12:09


Return to PostgreSQL Data Access Components