Re: [pgsql-ayuda] Presentacion y duda Gtk + ecpg

From: Jesus Aneiros <aneiros(at)jagua(dot)cfg(dot)sld(dot)cu>
To: pgsql-ayuda(at)tlali(dot)iztacala(dot)unam(dot)mx
Subject: Re: [pgsql-ayuda] Presentacion y duda Gtk + ecpg
Date: 2000-11-28 11:50:00
Message-ID: Pine.LNX.4.10.10011280649001.18801-100000@jagua.cfg.sld.cu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Usa

EXEC SQL CONNECT TO 'wcw-db';

En lugar de

EXEC SQL CONNECT TO wcw-db;

Saludos, Jesus.

On Tue, 28 Nov 2000, MC_Vai wrote:

>
> Saludos a toda la lista, soy nuevo y tengo una duda sobre si se puede
> usar una combinacion:
> Gtk + ecpg
> Para poder hacer una interfaz grafica de una aplicacion en C que usa
> PostgreSQL.
> Mi duda nace por que tengo un problema con el siguiente codigo:
>
> ----------------------- < main.pgc > ----------------------
> ...
> EXEC SQL INCLUDE sqlca; /* The include for ecpg */
>
> EXEC SQL WHENEVER SQLERROR sqlprint;
>
>
> static void
> checkwho( GtkWidget *emisor,
> gpointer table )
> {
> GtkWidget *label;
> int id = atoi( gtk_entry_get_text(GTK_ENTRY(id_entry)) );
>
> EXEC SQL BEGIN DECLARE SECTION;
> int found = 1;
> char *passwd = NULL,
> query_string[64];
> EXEC SQL END DECLARE SECTION;
>
> EXEC SQL CONNECT TO wcw-db;
>
> /* -------------------------- *
> * Preparando la query...
> * APARENTEMENTE AQUI ES DONDE EL PREPROCESADOR (ecpg) ME
> * ARROJA UN MENSAJE DE ERROR:
> * main.pgc:197: ERROR: parse error
> * -------------------------- */
> sprintf( query_string,
> "SELECT passwd \
> FROM wcw_users \
> WHERE user_id = %d", id );
>
> EXEC SQL PREPARE the_query FROM :query_string;
> EXEC SQL DECLARE a_cursor CURSOR FOR the_query;
>
> EXEC SQL OPEN a_cursor;
> EXEC SQL WHENEVER NOT FOUND DO found = 0;
>
> EXEC SQL FETCH IN a_cursor INTO : passwd;
>
> EXEC SQL CLOSE a_cursor;
> EXEC SQL COMMIT;
> EXEC SQL DISCONNECT;
>
> ...
> ----------------------- < /main.pgc > ----------------------
>
> Perdon si el mensaje es extenso, pero crei prudente mostrar el codigo,
> a lo mejor el error es otra cosa diferente a lo que yo creo.
>
>
> De antemano gracias por cualquier ayuda que me puedan proporcionar.
> Un saludo.
>
> --------- Pie de mensaje -------------------------------------------
> Archivo historico: http://tlali.iztacala.unam.mx/maillist/pgsql-ayuda
> Cancelar inscripcion:
> mail to: majordomo(at)tlali(dot)iztacala(dot)unam(dot)mx
> text : unsubscribe pgsql-ayuda
>

--
Jesus Aneiros Sosa
mailto:aneiros(at)jagua(dot)cfg(dot)sld(dot)cu
http://jagua.cfg.sld.cu/~aneiros

--------- Pie de mensaje -------------------------------------------
Archivo historico: http://tlali.iztacala.unam.mx/maillist/pgsql-ayuda
Cancelar inscripcion:
mail to: majordomo(at)tlali(dot)iztacala(dot)unam(dot)mx
text : unsubscribe pgsql-ayuda

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Marcos 2000-11-28 13:15:39 [pgsql-ayuda] longitud de campos de texto?
Previous Message MC_Vai 2000-11-28 09:14:52 [pgsql-ayuda] Presentacion y duda Gtk + ecpg