Page 1 of 1

IBCScript parameters

Posted: Fri 13 Nov 2009 23:09
by Bourgui
Hi All,

Is it possible to use a parameter multiple times within the same script?

Say for example:

Code: Select all

IBCScript .SQL. Add('DELETE FROM TABLE_1 WHERE (ID=:id_param);');
IBCScript .SQL. Add('INSERT INTO TABLE_1 (ID, NAME) VALUES (:id_param, :name_param);');

IBCScript. Params. CreateParam(ftInteger, 'id_param', ptInput);
IBCScript. Params. ParamByName('id_param'). AsInteger := 2;
The answer seems to be no, so what would be the best way to proceed in his case?

Thanks[/code]

Posted: Mon 16 Nov 2009 09:19
by Plash
You can set parameters for each statement separately. But you cannot use one parameter for multiple statements. Use macros instead of parameters (use '&' before name to mark a macro).

Posted: Mon 16 Nov 2009 13:51
by Bourgui
OK, thanks!

I'll look into macros.