Pro*C, Update

From: Groju <groju_at_nospamsurlaplanetefree.fr>
Date: Mon, 31 Oct 2005 12:24:16 +0100
Message-ID: <dk4ut0$bh2$1_at_s1.news.oleane.net>



Hello.

I have a problem and i hope i post in good group.

I work with AIX 4.1.5 and Oracle Database 7.2.3

At the bottom, this is just an example; the real program is too complex but i have same errors.
Normally, i have a table to store my data and i use this table to create SQL request in my "for".

After execution i obtained that :

Connexion avec code retour=0

Execution update n°0
Code retour:-904
Libelle err:ORA-00904: Nom de colonne invalide

                                   Execution update n°1
Code retour:-1003
Libelle err:ORA-01003: statut de [<nom_listener>] : obtention du statut du listeneExecution update n°2
Code retour:-1003
Libelle err:ORA-01003: statut de [<nom_listener>] : obtention du statut du listeneExecution update n°3
Code retour:-1003
Libelle err:ORA-01003: statut de [<nom_listener>] : obtention du statut du listeneExecution update n°4
Code retour:-1003
Libelle err:ORA-01003: statut de [<nom_listener>] : obtention du statut du listen

[Quoted] I don't understand why my program returns uniquely one ORA-00904 and one for each request.

Do you have an explanation for that ?? bad programmation ??

Thanks in advance for your help.
I apologyse for my english :)

---
Groju


My source code :

#include <stdio.h>

main(short argc, char **argv)
{
    EXEC SQL BEGIN DECLARE SECTION;
       varchar username[20];
       varchar password[20];
       char select[500];
    EXEC SQL END DECLARE SECTION;
    EXEC SQL INCLUDE SQLCA;

    short retour;
    int i=0;

    EXEC SQL WHENEVER SQLERROR GOTO problemes;

    problemes:
     EXEC SQL WHENEVER SQLERROR CONTINUE;


/***********************/
/* connexion a la base */
/***********************/
strcpy(username.arr,"xxxx"); username.len=strlen(username.arr); strcpy(password.arr,"xxxx"); password.len=strlen(password.arr); EXEC SQL CONNECT :username IDENTIFIED BY :password; printf("Connexion avec code retour=%i\n\n",sqlca.sqlcode); for(i=0;i<5;i++) { EXEC SQL UPDATE CLIENT SET lcliargos ="test update", norue="2", cplnorue='', typrue='', rue="La Place", cpost="59570", comne="GUSSIGNIES", csegmarch ="P", csiret ="39136479100015" WHERE ccliargos=60000004 ; printf("Execution update n°%i\n",i); printf("Code retour:%i\n",sqlca.sqlcode); printf("Libelle err:%s",sqlca.sqlerrm.sqlerrmc); } EXEC SQL ROLLBACK WORK RELEASE; exit(0); }
Received on Mon Oct 31 2005 - 12:24:16 CET

Original text of this message