Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2022-10

Why TSqlScript has no parameters?

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Luca Olivetti

Hello,

I need to execute more than one statement.
TSqlQuery it seems to accept multiple statements but then it gives a strange error (posgtresql error "no parameter $2", the parameter it refers to is defined and used in the second statement). So I tried a TSQlScript but then I could find no way to pass parameters. I'm used to the zeos components and its TZSQLProcessor (rough equivalent of TSqlScript) has parameters just like a query.

Bye

Luca
Michael Van Canneyt
to Luca Olivetti

Hello,

Show quoted text 5 lines
I need to execute more than one statement. TSqlQuery it seems to accept multiple statements but then it gives a strange error (posgtresql error "no parameter $2", the parameter it refers to is defined and used in the second statement).

Multiple statements are not supported in TSQLQuery. if it works for some statements, it purely is by accident.

So I tried a TSQlScript but then I could find no way to pass parameters. I'm used to the zeos components and its TZSQLProcessor (rough equivalent of TSqlScript) has parameters just like a query.

This feature is missing in TSQLScript, because I never needed it, but it should be easy enough to add.

Michael.

Luca Olivetti
to Michael Van Canneyt

El 10/10/22 a les 19:30, Michael Van Canneyt via fpc-pascal ha escrit:

This feature is missing in TSQLScript, because I never needed it, but it should be easy enough to add.

No, don't bother, it's just two statements and I can simply use TPQConnection.ExecuteDirect (in fact that's what I'm using). I just wanted to know if I missed something.

Bye

Luca