PostgreSQL - cannot insert multiple commands into a prepared statement
Posted: 02.11.2017, 16:51
Hello,
In my application, I added ability to create PostgreSQL database if it does not exists. I created tables and insert my initial records together with creating database.
Everything works until I insert my initial records which is the final step in creating my database. For ease of use, I have all my insert statements in a single file. When executed, TZSQLProcessor is complaining about subject error message. I would have understood it with TZQuery as it can be prepared, but, TZSQLProcessor should be able to handle multiple SQL statements at once as I believe its main purpose is. I might be completely wrong, so I appreciate some details on subject.
However, this is me thinking PostgreSQL at mind. I do not know if there are situations that even TZSQLProcessor needs to have a prepared statement. In this case, I would suggest a property to be added in TZSQLProcessor (as it is in Devart products UniDAC for example) and users are able to select desired way of working.
Before posting, I searched forum messages and only mention was in below link, again PostgreSQL and no particular suggestion other than executing each insert statement one by one which will be another time consuming operation on a tiny Raspberry Pi device that my application is working on.
http://zeoslib.sourceforge.net/viewtopi ... =38&t=3817
I appreciate any comments on if it is possible to use TZSQLProcessor without using prepared statements.
Thanks.
In my application, I added ability to create PostgreSQL database if it does not exists. I created tables and insert my initial records together with creating database.
Everything works until I insert my initial records which is the final step in creating my database. For ease of use, I have all my insert statements in a single file. When executed, TZSQLProcessor is complaining about subject error message. I would have understood it with TZQuery as it can be prepared, but, TZSQLProcessor should be able to handle multiple SQL statements at once as I believe its main purpose is. I might be completely wrong, so I appreciate some details on subject.
However, this is me thinking PostgreSQL at mind. I do not know if there are situations that even TZSQLProcessor needs to have a prepared statement. In this case, I would suggest a property to be added in TZSQLProcessor (as it is in Devart products UniDAC for example) and users are able to select desired way of working.
Before posting, I searched forum messages and only mention was in below link, again PostgreSQL and no particular suggestion other than executing each insert statement one by one which will be another time consuming operation on a tiny Raspberry Pi device that my application is working on.
http://zeoslib.sourceforge.net/viewtopi ... =38&t=3817
I appreciate any comments on if it is possible to use TZSQLProcessor without using prepared statements.
Thanks.