Received: from hub.org.org (localhost [127.0.0.1]) by hub.org (8.10.1/8.10.1) with SMTP id e9EIRsr18757 for ; Sat, 14 Oct 2000 14:27:54 -0400 (EDT) Received: from smtp4.libero.it (smtp4.libero.it [193.70.192.54]) by hub.org (8.10.1/8.10.1) with ESMTP id e9E8bSr69514 for ; Sat, 14 Oct 2000 04:37:28 -0400 (EDT) Received: from maurizio (151.29.214.172) by smtp4.libero.it; 14 Oct 2000 10:37:24 +0200 Message-ID: <000d01c035ba$88008ae0$acd61d97@clibero.it> From: "Maurizio" To: Subject: STRANGE ecpg OUTPUT Date: Sat, 14 Oct 2000 10:41:21 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0009_01C035CB.4AD0B940" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200010/113 X-Sequence-Number: 1470 Messaggio in formato MIME composto da pił parti. ------=_NextPart_000_0009_01C035CB.4AD0B940 Content-Type: multipart/alternative; boundary="----=_NextPart_001_000A_01C035CB.4AD0B940" ------=_NextPart_001_000A_01C035CB.4AD0B940 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I'm tring ecpg under QNX 4.25. Whene I execute the make under interfaces/ecpg/test I have a strange output= in test1.c and also in the other sources. It seems that there are not a CR at the and of the generated lines.=20 Could anyone help me? Thanks Maurizio Cauci DREAMTECH di Cauci Maurizio Via Ronchetti, 2 - 21013 Gallarate (VA) www.dreamtech-it.com ------=_NextPart_001_000A_01C035CB.4AD0B940 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
I'm tring ecpg under QNX 4.25.
Whene I execute the make under interfaces/= ecpg/test=20 I have a strange output in test1.c and also in the other sources.
It seems that there are not a CR at the an= d of the=20 generated lines.
Could anyone help me?
 
Thanks
 
Maurizio Cauci
DREAMTECH di Cauci=20 Maurizio
Via Ronchetti, 2 - 21013 Gallarate (VA)
www.dreamtech-it.com
<= /BODY> ------=_NextPart_001_000A_01C035CB.4AD0B940-- ------=_NextPart_000_0009_01C035CB.4AD0B940 Content-Type: application/octet-stream; name="Test1.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="Test1.c" /* Processed by ecpg (2.7.1) */ /* These three include files are added by the preprocessor */ #include #include #include #line 1 "test1.pgc" #line 1 "../include/sqlca.h" #ifndef POSTGRES_SQLCA_H#define POSTGRES_SQLCA_H#define SQLERRMC_LEN 70#ifd= ef __cplusplusextern"C"{#endifstructsqlca{charsqlcaid[8];longsqlabc;longsql= code;struct{intsqlerrml;charsqlerrmc[SQLERRMC_LEN];}sqlerrm;charsqlerrp[8];= longsqlerrd[6];/*/*/*/*/*/*/*/*charsqlwarn[8];/*/*/*/*/*/*/*/*/*/*charsqlex= t[8];};externstructsqlcasqlca;#ifdef __cplusplus}#endif#endif #line 0 "test1.pgc" /* exec sql whenever sqlerror do PrintAndStop ( msg ) ; */ #line 2 "test1.pgc" /* exec sql whenever sql_warning do warn ( ) ; */ #line 3 "test1.pgc" voidPrintAndStop(msg){fprintf(stderr,"Error in statement '%s':\n",msg);sqlp= rint();exit(-1);}voidwarn(void){fprintf(stderr,"Warning: At least one colum= n was truncated\n");}/* #line 20 "test1.pgc" /* exec sql type intarray is int [ 6 ] */ #line 20 "test1.pgc" /* exec sql type string is char [ 8 ] */ #line 21 "test1.pgc" typedefintintarray[6 #line 23 "test1.pgc" ];intmain(){/* exec sql begin declare section */ #line 31 "test1.pgc" #line 32 "test1.pgc" #line 29 "test1.pgc" intarray amount ; =20 #line 30 "test1.pgc" int increment =3D 100 ; =20 #line 31 "test1.pgc" char name [ 6 ] [ 8 ] ; =20 #line 32 "test1.pgc" char letter [ 6 ] [ 1 ] ; =20 #line 33 "test1.pgc" char command [ 128 ] ; /* exec sql end declare section */ #line 34 "test1.pgc" #line 35 "test1.pgc" /* exec sql var name is string [ 6 ] */ #line 35 "test1.pgc" charmsg[128];FILE*dbgs;inti,j;if((dbgs=3Dfopen("log","w"))!=3DNULL)ECPGdebu= g(1,dbgs);strcpy(msg,"connect");{ ECPGconnect(__LINE__, "mm" , NULL,NULL , = "main", 0); #line 44 "test1.pgc" if (sqlca.sqlwarn[0] =3D=3D 'W') warn ( ); #line 44 "test1.pgc" if (sqlca.sqlcode < 0) PrintAndStop ( msg );} #line 44 "test1.pgc" strcpy(msg,"connect");{ ECPGconnect(__LINE__, "pm" , NULL,NULL , NULL, 0); #line 47 "test1.pgc" if (sqlca.sqlwarn[0] =3D=3D 'W') warn ( ); #line 47 "test1.pgc" if (sqlca.sqlcode < 0) PrintAndStop ( msg );} #line 47 "test1.pgc" strcpy(msg,"create");{ ECPGdo(__LINE__, "main", "create table \"Test\" ( n= ame char ( 8 ) , amount int , letter char ( 1 ) ) ", ECPGt_EOIT,= ECPGt_EORT); =0D=0C #line 50 "test1.pgc" if (sqlca.sqlwarn[0] =3D=3D 'W') warn ( ); #line 50 "test1.pgc" if (sqlca.sqlcode < 0) PrintAndStop ( msg );} #line 50 "test1.pgc" { ECPGdo(__LINE__, NULL, "create table \"Test\" ( name char ( 8 ) , am= ount int , letter char ( 1 ) ) ", ECPGt_EOIT, ECPGt_EORT); =0D=0C #line 51 "test1.pgc" if (sqlca.sqlwarn[0] =3D=3D 'W') warn ( ); #line 51 "test1.pgc" if (sqlca.sqlcode < 0) PrintAndStop ( msg );} #line 51 "test1.pgc" strcpy(msg,"commit");{ ECPGtrans(__LINE__, "main", "commit"); #line 54 "test1.pgc" if (sqlca.sqlwarn[0] =3D=3D 'W') warn ( ); #line 54 "test1.pgc" if (sqlca.sqlcode < 0) PrintAndStop ( msg );} #line 54 "test1.pgc" { ECPGtrans(__LINE__, NULL, "commit"); #line 55 "test1.pgc" if (sqlca.sqlwarn[0] =3D=3D 'W') warn ( ); #line 55 "test1.pgc" if (sqlca.sqlcode < 0) PrintAndStop ( msg );} #line 55 "test1.pgc" strcpy(msg,"set connection");{ ECPGsetconn(__LINE__, "main"); #line 58 "test1.pgc" if (sqlca.sqlwarn[0] =3D=3D 'W') warn ( ); #line 58 "test1.pgc" if (sqlca.sqlcode < 0) PrintAndStop ( msg );} #line 58 "test1.pgc" strcpy(msg,"execute insert 1");sprintf(command,"insert into \"Test\" (name,= amount, letter) values ('db: ''mm''', 1, 'f')");{ ECPGdo(__LINE__, NULL, "= ?",=20 ECPGt_char_variable,(command),1L,1L,1*sizeof(char),=20 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); =0D=0C #line 62 "test1.pgc" if (sqlca.sqlwarn[0] =3D=3D 'W') warn ( ); #line 62 "test1.pgc" if (sqlca.sqlcode < 0) PrintAndStop ( msg );} #line 62 "test1.pgc" printf("New tuple got OID =3D %d\n",sqlca.sqlerrd[1]);sprintf(command,"inse= rt into \"Test\" (name, amount, letter) values ('db: \\\'mm\\\'', 2, 't')")= ;{ ECPGdo(__LINE__, NULL, "?",=20 ECPGt_char_variable,(command),1L,1L,1*sizeof(char),=20 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); =0D=0C #line 66 "test1.pgc" if (sqlca.sqlwarn[0] =3D=3D 'W') warn ( ); #line 66 "test1.pgc" if (sqlca.sqlcode < 0) PrintAndStop ( msg );} #line 66 "test1.pgc" strcpy(msg,"execute insert 2");sprintf(command,"insert into \"Test\" (name,= amount, letter) values ('db: ''pm''', 1, 'f')");{ ECPGdo(__LINE__, "pm", "= ?",=20 ECPGt_char_variable,(command),1L,1L,1*sizeof(char),=20 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); =0D=0C #line 70 "test1.pgc" if (sqlca.sqlwarn[0] =3D=3D 'W') warn ( ); #line 70 "test1.pgc" if (sqlca.sqlcode < 0) PrintAndStop ( msg );} #line 70 "test1.pgc" strcpy(msg,"execute insert 3");sprintf(command,"insert into \"Test\" (name,= amount, letter) select name, amount+10, letter from \"Test\"");{ ECPGdo(__= LINE__, NULL, "?",=20 ECPGt_char_variable,(command),1L,1L,1*sizeof(char),=20 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); =0D=0C #line 74 "test1.pgc" if (sqlca.sqlwarn[0] =3D=3D 'W') warn ( ); #line 74 "test1.pgc" if (sqlca.sqlcode < 0) PrintAndStop ( msg );} #line 74 "test1.pgc" printf("Inserted %d tuples via execute immediate\n",sqlca.sqlerrd[2]);strcp= y(msg,"execute insert 4");sprintf(command,"insert into \"Test\" (name, amou= nt, letter) select name, amount+?, letter from \"Test\"");{ ECPGprepare(__L= INE__, "I", command); #line 80 "test1.pgc" if (sqlca.sqlwarn[0] =3D=3D 'W') warn ( ); #line 80 "test1.pgc" if (sqlca.sqlcode < 0) PrintAndStop ( msg );} #line 80 "test1.pgc" { ECPGdo(__LINE__, "pm", "?",=20 ECPGt_char_variable,(ECPGprepared_statement("I")),1L,1L,1*sizeof(char),=20 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,=20 ECPGt_int,&(increment),1L,1L,sizeof(int),=20 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); =0D=0C #line 81 "test1.pgc" if (sqlca.sqlwarn[0] =3D=3D 'W') warn ( ); #line 81 "test1.pgc" if (sqlca.sqlcode < 0) PrintAndStop ( msg );} #line 81 "test1.pgc" printf("Inserted %d tuples via prepared execute\n",sqlca.sqlerrd[2]);strcpy= (msg,"commit");{ ECPGtrans(__LINE__, NULL, "commit"); #line 86 "test1.pgc" if (sqlca.sqlwarn[0] =3D=3D 'W') warn ( ); #line 86 "test1.pgc" if (sqlca.sqlcode < 0) PrintAndStop ( msg );} #line 86 "test1.pgc" /*{ ECPGsetcommit(__LINE__, "on", "pm"); #line 89 "test1.pgc" if (sqlca.sqlwarn[0] =3D=3D 'W') warn ( ); #line 89 "test1.pgc" if (sqlca.sqlcode < 0) PrintAndStop ( msg );} #line 89 "test1.pgc" { ECPGtrans(__LINE__, "pm", "begin transaction"); #line 90 "test1.pgc" if (sqlca.sqlwarn[0] =3D=3D 'W') warn ( ); #line 90 "test1.pgc" if (sqlca.sqlcode < 0) PrintAndStop ( msg );} #line 90 "test1.pgc" strcpy(msg,"select");{ ECPGdo(__LINE__, NULL, "select name , amount , le= tter from \"Test\" ", ECPGt_EOIT,=20 ECPGt_char,(name),8L,6L,8*sizeof(char),=20 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,=20 ECPGt_int,(amount),1L,6L,sizeof(int),=20 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,=20 ECPGt_char,(letter),1L,6L,1*sizeof(char),=20 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); =0D=0C #line 93 "test1.pgc" if (sqlca.sqlwarn[0] =3D=3D 'W') warn ( ); #line 93 "test1.pgc" if (sqlca.sqlcode < 0) PrintAndStop ( msg );} #line 93 "test1.pgc" printf("Database: mm\n");for(i=3D0,j=3Dsqlca.sqlerrd[2];i