5 messages in org.postgresql.pgsql-interfaces[INTERFACES] Use ecpg
FromSent OnAttachments
Margarita BarvinokJan 28, 1999 7:15 am 
James ThompsonJan 28, 1999 8:36 am 
Michael MeskesJan 28, 1999 10:58 am 
Michael MeskesJan 28, 1999 10:20 pm 
Margarita BarvinokJan 29, 1999 6:37 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[INTERFACES] Use ecpgActions...
From:Margarita Barvinok (bri@math.lsa.umich.edu)
Date:Jan 28, 1999 7:15:38 am
List:org.postgresql.pgsql-interfaces

Hello All,

I just began to use postgresql-6.4.2 and ecpg (version: 2.4.4). I try t precompile simple code ( I took it from a book) and get this error message: prog:17: parse error Perhaps this is stupid error, but I have no idea what to do, because I don't have good manual on Embedded SQL. Can I find somewhere documentation on C-Embedded SQL? Thanks, in advance, for any help.

-Margarita Barvinok

File prog:

/* *********************************************************** */ #include <stdio.h> #include <stdlib.h> #include <string.h>

#define FAILURE 1 #define SUCCESS 0

void printError(void);

/* define the communication region */ EXEC SQL INCLUDE sqlca;

int main() { /* set error handler to bail out if we can't connect */ EXEC SQL WHENEVER SQLERROR { /* LINE 17 */ printError(); return FAILURE; };

/* Connect to the database */ EXEC SQL CONNECT USER "dba" IDENTIFIED BY "sql"; printf("test"); EXEC SQL DISCONNECT; return SUCCESS; } /* * printError() * function to print a description of any SQL errors */ void printError() { static char buffer[200]; printf("SQL error -- %s\n", buffer, sqlerror_message( &sqlca, buffer, sizeof(buffer))); }

/* ******************************************************************* */