PREPARE statement - Mailing list pgsql-novice

From Atif Jung
Subject PREPARE statement
Date
Msg-id o2kd1c6b9c51005070811xc200cc28nf014d368a87295d1@mail.gmail.com
Whole thread Raw
List pgsql-novice
When using EXEC SQL PREPARE, is it necessary to save the SQL in a buffer first or can you write:
 
EXEC SQL PREPARE statement FROM "SELECT name FROM address WHERE code = ?";
 
or must it be
 
EXEC SQL BEGIN DECLARE STATEMENT;
 
char h_sqlBuffer[256];
 
EXEC SQL END DECLARE STATEMENT;
 
strcpy(h_sqlBuffer,"SELECT name FROM address WHERE code = ?";
 
EXEC SQL PREPARE statement FROM :h_sqlBuffer;
 
Thanks

Atif

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Superuser lacking privs
Next
From: Mark Kelly
Date:
Subject: Re: field names for new in trigger function