From ron@cyberia.net.lb Wed Jul 29 07:11:32 1998 Received: from aserver.apotres.edu.lb ([194.126.24.131]) by hub.org (8.8.8/8.7.5) with ESMTP id DAA01698; Wed, 29 Jul 1998 03:11:32 -0400 (EDT) Received: from cyberia.net.lb ([194.126.24.132]) by aserver.apotres.edu.lb (Netscape Messaging Server 3.01) with ESMTP id 155; Wed, 29 Jul 1998 10:06:31 +0100 Message-ID: <35BECC00.1059EB7@cyberia.net.lb> Date: Wed, 29 Jul 1998 10:15:12 +0300 From: rony khoury Reply-To: ron@cyberia.net.lb X-Mailer: Mozilla 4.04 [en] (WinNT; I) MIME-Version: 1.0 To: "pgsql-novice@postgreSQL.org" , "pgsql-interfaces@postgreSQL.org" Subject: not permanent insert into stud values('myname') Content-Type: multipart/alternative; boundary="------------11A271284A3D47F753F1CB14" --------------11A271284A3D47F753F1CB14 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello , following is a part of my code , can any body tell me why it works fine , but 'myname' does not remain permanent in the table although I'm loging in as postgres and see 'myname' in the result when I run the program ? thanks , Rony . --------------------- C code ------------------- res = PQexec(conn,"insert into stud values('myname')"); PQclear(res); res = PQexec(conn,"select * from stud"); for (i=0;i  

Hello ,

following is a part of my code , can any body tell me why it works fine ,
but 'myname' does not remain permanent in the table although I'm loging in as postgres
and see 'myname' in the result when I run the program ?

thanks ,
Rony .

--------------------- C code -------------------
res = PQexec(conn,"insert into stud values('myname')");
PQclear(res);
res = PQexec(conn,"select * from stud");
 
for (i=0;i<PQntuples(res);i++) {
  printf("\n answer is %s",PQgetvalue(res,i,0));

---------------------- output -----------------------
#a.out
answer is rony
answer is myname
#
----------------------------------------------------------
  --------------11A271284A3D47F753F1CB14-- From hannu@trust.ee Wed Jul 29 09:02:44 1998 Received: from sid.trust.ee (sid.trust.ee [194.204.23.180]) by hub.org (8.8.8/8.7.5) with ESMTP id FAA12091; Wed, 29 Jul 1998 05:02:44 -0400 (EDT) Received: from trust.ee (wink.trust.ee [194.204.23.184]) by sid.trust.ee (8.8.7/8.8.7) with ESMTP id MAA24891; Wed, 29 Jul 1998 12:05:21 +0300 Message-ID: <35BEE67E.6F93FC49@trust.ee> Date: Wed, 29 Jul 1998 12:08:14 +0300 From: Hannu Krosing X-Mailer: Mozilla 4.05 [en] (Win95; I) MIME-Version: 1.0 To: ron@cyberia.net.lb CC: "pgsql-novice@postgreSQL.org" , "pgsql-interfaces@postgreSQL.org" Subject: Re: [INTERFACES] not permanent insert into stud values('myname') References: <35BECC00.1059EB7@cyberia.net.lb> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit rony khoury wrote: > > > > Hello , > > following is a part of my code , can any body tell me why it works > fine , It should work fine ;) > but 'myname' does not remain permanent in the table although I'm > loging in as postgres > and see 'myname' in the result when I run the program ? You probably start a transaction, but never commit it (in some other part of your code) Hannu From rkhoury@apotres.edu.lb Wed Jul 29 09:29:34 1998 Received: from aserver.apotres.edu.lb ([194.126.24.131]) by hub.org (8.8.8/8.7.5) with ESMTP id FAA15092; Wed, 29 Jul 1998 05:29:34 -0400 (EDT) Received: from apotres.edu.lb ([194.126.24.132]) by aserver.apotres.edu.lb (Netscape Messaging Server 3.01) with ESMTP id 204; Wed, 29 Jul 1998 12:24:47 +0100 Message-ID: <35BEEC68.634C81EB@apotres.edu.lb> Date: Wed, 29 Jul 1998 12:33:28 +0300 From: "rony khoury" Reply-To: rkhoury@apotres.edu.lb X-Mailer: Mozilla 4.04 [en] (WinNT; I) MIME-Version: 1.0 To: Hannu Krosing CC: ron@cyberia.net.lb, "pgsql-novice@postgreSQL.org" , "pgsql-interfaces@postgreSQL.org" Subject: Re: [INTERFACES] not permanent insert into stud values('myname') References: <35BECC00.1059EB7@cyberia.net.lb> <35BEE67E.6F93FC49@trust.ee> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hannu Krosing wrote: > rony khoury wrote: > > > > > > > > Hello , > > > > following is a part of my code , can any body tell me why it works > > fine , > > It should work fine ;) > > > but 'myname' does not remain permanent in the table although I'm > > loging in as postgres > > and see 'myname' in the result when I run the program ? > > You probably start a transaction, but never commit it (in some other > part of your code) > > Hannu no it does not work fine or else I wouldn't have asked . What do you mean I should commit it in some other part of my code ? how to do that ? rony . From rkhoury@apotres.edu.lb Wed Jul 29 09:40:19 1998 Received: from aserver.apotres.edu.lb ([194.126.24.131]) by hub.org (8.8.8/8.7.5) with ESMTP id FAA15943; Wed, 29 Jul 1998 05:40:19 -0400 (EDT) Received: from apotres.edu.lb ([194.126.24.132]) by aserver.apotres.edu.lb (Netscape Messaging Server 3.01) with ESMTP id 167; Wed, 29 Jul 1998 12:35:28 +0100 Message-ID: <35BEEEE9.620D75FE@apotres.edu.lb> Date: Wed, 29 Jul 1998 12:44:09 +0300 From: "rony khoury" Reply-To: rkhoury@apotres.edu.lb X-Mailer: Mozilla 4.04 [en] (WinNT; I) MIME-Version: 1.0 To: Hannu Krosing , ron@cyberia.net.lb, "pgsql-novice@postgreSQL.org" , "pgsql-interfaces@postgreSQL.org" Subject: Re: [NOVICE] Re: [INTERFACES] not permanent insert into stud values('myname') References: <35BECC00.1059EB7@cyberia.net.lb> <35BEE67E.6F93FC49@trust.ee> <35BEEC68.634C81EB@apotres.edu.lb> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit rony khoury wrote: > Hannu Krosing wrote: > > > rony khoury wrote: > > > > > > > > > > > > Hello , > > > > > > following is a part of my code , can any body tell me why it works > > > fine , > > > > It should work fine ;) > > > > > but 'myname' does not remain permanent in the table although I'm > > > loging in as postgres > > > and see 'myname' in the result when I run the program ? > > > > You probably start a transaction, but never commit it (in some other > > part of your code) > > > > Hannu > > no it does not work fine or else I wouldn't have asked . > What do you mean I should commit it in some other part of my code ? how > to do that ? > > rony . ok it works fine for me now , I just needed to add an PQexec(conn,"END"); now that it works , it was a silly question , sorry for the trouble . thanks again , Rony . From joden@lee.k12.nc.us Wed Jul 29 11:54:14 1998 Received: from lee.k12.nc.us (mail.lee.k12.nc.us [207.4.71.118]) by hub.org (8.8.8/8.7.5) with ESMTP id HAA04809; Wed, 29 Jul 1998 07:54:14 -0400 (EDT) Received: by gateway.lee.k12.nc.us id <35713>; Tue, 28 Jul 1981 06:46:38 -0400 Date: Wed, 29 Jul 1998 07:56:23 -0400 From: James Olin Oden X-Mailer: Mozilla 4.04 [en] (Win95; I) MIME-Version: 1.0 To: ron@cyberia.net.lb CC: "pgsql-novice@postgreSQL.org" , "pgsql-interfaces@postgreSQL.org" Subject: Re: [NOVICE] not permanent insert into stud values('myname') References: <35BECC00.1059EB7@cyberia.net.lb> Content-Type: multipart/alternative; boundary="------------40D28CF35511E1708EA079C9" Message-Id: <81Jul28.064638edt.35713@gateway.lee.k12.nc.us> --------------40D28CF35511E1708EA079C9 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit > res = PQexec(conn,"insert into stud values('myname')"); > Don't you still need to include the SQL EOL character, that is a semicolon at the end of your querystring? --------------40D28CF35511E1708EA079C9 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit  

res = PQexec(conn,"insert into stud values('myname')");
 
Don't you still need to include the SQL EOL character, that is a semicolon at the end of your querystring?  --------------40D28CF35511E1708EA079C9--