Many SQL statement get error on Execute

Many SQL statement get error on Execute

Postby 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
Eden0928
 
Posts: 44
Joined: Sun 22 Apr 2012 14:08

Postby 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
AlexP
Devart Team
 
Posts: 5528
Joined: Tue 10 Aug 2010 11:35

Postby Eden0928 » Tue 24 Apr 2012 09:31

Thank you :o
Eden0928
 
Posts: 44
Joined: Sun 22 Apr 2012 14:08


Return to dbExpress driver for PostgreSQL