RefLib

Reference library for AI

Back

postgresql_16:5.3.14.5.4 Examples

PostgreSQL 16 > Client Interfaces > ECPG — Embedded SQL in C > Embedded SQL Commands > DECLARE STATEMENT > Examples

EXEC SQL CONNECT TO postgres AS con1;
EXEC SQL AT con1 DECLARE sql_stmt STATEMENT;
EXEC SQL DECLARE cursor_name CURSOR FOR sql_stmt;
EXEC SQL PREPARE sql_stmt FROM :dyn_string;
EXEC SQL OPEN cursor_name;
EXEC SQL FETCH cursor_name INTO :column1;
EXEC SQL CLOSE cursor_name;

Back