Many SQL statement get error on Execute

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for PostgreSQL in Delphi and C++Builder
Post Reply
Eden0928
Posts: 62
Joined: Sun 22 Apr 2012 14:08

Many SQL statement get error on Execute

Post by Eden0928 » Sun 22 Apr 2012 15:05

Below my code:

Code: Select all

{ Memo1 Text }
CREATE TABLE animals( 
NAME VARCHAR(10) DEFAULT '' , 
SIZE INTEGER DEFAULT 0 , 
WEIGHT INTEGER DEFAULT 0 , 
AREA VARCHAR(20) DEFAULT '' , 
BMP BYTEA 
); 

CREATE TABLE biolife( 
"Species No" REAL DEFAULT 0.0 , 
Category VARCHAR(15) DEFAULT '' , 
Common_Name VARCHAR(30) DEFAULT '' , 
"Species Name" VARCHAR(40) DEFAULT '' , 
"Length (cm)" REAL DEFAULT 0.0 , 
Length_In REAL DEFAULT 0.0 , 
Notes TEXT , 
Graphic BYTEA , 
PRIMARY KEY("Species No") 
);
.
.
. // Many SQL statement

{ Run Code }
SQLConnection1.Execute(Memo1.Lines.Text, nil);
I get a error message, below this image:
Image

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 23 Apr 2012 12:36

Hello,

To have opportunity to execute several commands at once, you should enable the UnpreparedExecute option

SQLConnection1.Params.Values['UnpreparedExecute'] := 'true';

In this case, commands will be executed with no errors, however, enabling of this option will force using the 2nd protocol

Eden0928
Posts: 62
Joined: Sun 22 Apr 2012 14:08

Post by Eden0928 » Tue 24 Apr 2012 09:31

Thank you :o

Post Reply