MAIN
DEFINE
prepstr CHAR(1000)
LET prepstr = "CREATE TEMP TABLE test (col1 CHAR(8))"
PREPARE s_0 FROM prepstr
LET prepstr = "DROP TABLE test"
PREPARE s_5 FROM prepstr
END MAIN
We are testing 4GL version 7.30.UC1 on Linux.
When we compile the program using c4gl -c test.4gl
we get the following error message:
esqlc: "test.ec", line 50: Warning -33071: The statement id
'I000741E8mbcmb7x0i'
has already been used.
1 warning(s)
I thought all cursors/statements generated are unique.
Has anyone else encountered this problem?
Thanks in advance. I've included test.ec below.
Candy
--
Candy McCall
ONLINE Computing, Inc.
(can...@olcinc.com)
Here is test.ec:
#include <sqlfm.h>
#include <decimal.h>
#include <locator.h>
#include <datetime.h>
#include <stdio.h>
#include <fglrep.h>
#define I4GL_SQLCA /* I4GLC1 */
$extern struct
{
long sqlcode;
char sqlerrm[72];
char sqlerrp[8];
long sqlerrd[6];
char sqlawarn[8];
} sqlca;
$extern int status;
extern int efcode;
extern int _expcode;
extern short _anyerr;
$extern int int_flag;
$extern int quit_flag;
static char fgl_modname[] = "test.4gl";
main(fgl_argc, fgl_argv)
int fgl_argc; char *fgl_argv[];
{
$char prepstr[1001];
fgl_init(fgl_argc, fgl_argv);
fgl_siginit();
ixpshhwm();
_anyerr = 0;
pushquote( "CREATE TEMP TABLE test (col1 CHAR(8))" , 37);
popquote(prepstr,1001);
ixrsthwm();
pushlong(475624L);
fgl_mangle(prepstr);
$ prepare I000741E8mbcmb7x0i from $prepstr;
status = sqlca.sqlcode;
if (status < 0)
{
fgl_fatal(fgl_modname, 9, status);
}
pushquote( "DROP TABLE test" , 15);
popquote(prepstr,1001);
ixrsthwm();
pushlong(475624L);
fgl_mangle(prepstr);
$ prepare I000741E8mbcmb7x0i from $prepstr;
status = sqlca.sqlcode;
if (status < 0)
{
fgl_fatal(fgl_modname, 12, status);
}
/*
* $ exit form mode;
*/
{
_efemode();
}
_autofree(0);
ixrelhwm();
return(0);
}
Prepare statement can not allow "CREATE and DROP TABLE" sequence.
See Informix GUIDE to SQL 2-408 and 2-415.
Regards.
--
Tsutomu Ogiwara
Informix Business Promotion Dept
ITOCHU TECHNO-SCIENCE Corporation
KURITA-KUDAN BLDG., 1-11-15, FUJIMI,
CHIYODA-KU TOKYO,102-0074 JAPAN
Phone:+81-3-5226-1951 Fax:+81-3-5226-1959
E-mail:Tsutomu...@ctc-g.co.jp
> I have the following test program:
>
> MAIN
>
> DEFINE
> prepstr CHAR(1000)
>
> LET prepstr = "CREATE TEMP TABLE test (col1 CHAR(8))"
> PREPARE s_0 FROM prepstr
>
> LET prepstr = "DROP TABLE test"
> PREPARE s_5 FROM prepstr
>
> END MAIN
>
> We are testing 4GL version 7.30.UC1 on Linux.
>
> When we compile the program using c4gl -c test.4gl
> we get the following error message:
>
> esqlc: "test.ec", line 50: Warning -33071: The statement id
> 'I000741E8mbcmb7x0i'
> has already been used.
> 1 warning(s)
>
> I thought all cursors/statements generated are unique.
> Has anyone else encountered this problem?
I've not seen that one, but it is fairly comprehensively a bug. I'm not
sure what the most recent version of I4GL is on Linux; it should be
several revisions later than UC1.
Separately, if you prepare a DROP TABLE statement, the table must exist
when you prepare it. Since the statement to create the table is
prepared (but not executed) a few lines previously, I think you could
expect a run-time error on the second statement.
> Thanks in advance. I've included test.ec below.
And I've chopped most of it...
> [...]
> pushquote( "CREATE TEMP TABLE test (col1 CHAR(8))" , 37);
> popquote(prepstr,1001);
> ixrsthwm();
> pushlong(475624L);
> fgl_mangle(prepstr);
> $ prepare I000741E8mbcmb7x0i from $prepstr;
> status = sqlca.sqlcode;
> if (status < 0)
> {
> fgl_fatal(fgl_modname, 9, status);
> }
> pushquote( "DROP TABLE test" , 15);
> popquote(prepstr,1001);
> ixrsthwm();
> pushlong(475624L);
> fgl_mangle(prepstr);
> $ prepare I000741E8mbcmb7x0i from $prepstr;
> [...]
--
Jonathan Leffler (jlef...@earthlink.net, jlef...@informix.com)
Guardian of DBD::Informix 1.00.PC1 -- see http://www.cpan.org/
#include <disclaimer.h>
I'll check my 4GL version on my Linux box at home and give it a whirl. I believe it's 7.30.uc5.
--------------------------------
John Carlson
Informix DBA
EDS/WHSmith USA
#include std_disclaimer.h /* These are my opinions, not my company's opinion */
----- Original Message -----
From: Tsutomu Ogiwara <Tsutomu...@ctc-g.co.jp>
To: Candy McCall <can...@olcinc.com>
Cc: Informix List <inform...@iiug.org>
Sent: Monday, October 01, 2001 9:52 PM
Subject: Re: Prepared statements on 4GL - Linux platform
Hi Candy.
Prepare statement can not allow "CREATE and DROP TABLE" sequence.
See Informix GUIDE to SQL 2-408 and 2-415.
Regards.
At 16:20 01/10/01 -0500, Candy McCall wrote:
--
>Candy McCall wrote:
>> I have the following test program:
>>
>> MAIN
>>
>> DEFINE
>> prepstr CHAR(1000)
>>
>> LET prepstr = "CREATE TEMP TABLE test (col1 CHAR(8))"
>> PREPARE s_0 FROM prepstr
>>
>> LET prepstr = "DROP TABLE test"
>> PREPARE s_5 FROM prepstr
>>
>> END MAIN
>>
>> We are testing 4GL version 7.30.UC1 on Linux.
>>
>> When we compile the program using c4gl -c test.4gl
>> we get the following error message:
>>
>> esqlc: "test.ec", line 50: Warning -33071: The statement id
>> 'I000741E8mbcmb7x0i'
>> has already been used.
>> 1 warning(s)
>>
>> I thought all cursors/statements generated are unique.
>> Has anyone else encountered this problem?
Jonathan Leffler wrote:
>I've not seen that one, but it is fairly comprehensively a bug. I'm not
>sure what the most recent version of I4GL is on Linux; it should be
>several revisions later than UC1.
>Separately, if you prepare a DROP TABLE statement, the table must exist
>when you prepare it. Since the statement to create the table is
>prepared (but not executed) a few lines previously, I think you could
>expect a run-time error on the second statement.
The sole purpose of the program is to point out the error. I eliminated
all other lines of code. :-)
Finally a question I have the answer to ;-)
During my AIX/Linux technical adventure, I had exactly the same problem -
only mine was with all SQL statements.
If you are having this problem with ALL prepared statements (try and prepare
3 or 4 statements inside the same 4gl and see if you experience the same
problem), then try one of the following procedures :
1) export C4GLFLAGS=-globcurs, this will include this flag in each c4gl
compilation and re-make the program as you normally would.
2) Include the '-globcurs' on each command line compilation as a flag to
'c4gl' and recompile the program.
3) Include the -keep command line option (in C4GLFLAGS or) in the 'c4gl'
command line statement. Then edit the generated 'program-name.ec' file and
modify the generated identifier 'I000741E8mbcmb7x0i' to a unique value for
each iteration of the statement in the code. Then re-link this module into
the 4ge using 'c4gl -o'.
Incidentally, the C4GLFLAGS environment variable can be used to declare any
number of 'c4gl' compilation flags. Since I do not have access to Unix box
at this moment, this is completely from memory and I'm not sure if the flags
are delimited by commas, spaces or semi-colons and they may even need to be
quoted as a string. I am certain that 2 minutes of experimentation will
reveal the correct procedure.
Furthermore, I'm not really sure why this works (or what other impact it has
on the compilation other than making your cursor identifiers unique to the
entire program and not just the module) as I got this fix from Informix
Technical Support ( Donald(c) ), but it should solve your immediate problem.
Give it a whirl and let us know how it went.
regards
David
-----Original Message-----
From: owner-inf...@iiug.org
[mailto:owner-inf...@iiug.org]On Behalf Of Candy McCall
Sent: Tuesday, October 02, 2001 16:07
To: Tsutomu Ogiwara
Cc: Informix List
Subject: Re: Prepared statements on 4GL - Linux platform
This is 4GL and not SQL. We've been using that type
of code for years and it currently works on other Unix
platforms. We are trying to port our application to the
Linux platform. Thanks anyway for your input.
----- Original Message -----
From: Tsutomu Ogiwara <Tsutomu...@ctc-g.co.jp>
To: Candy McCall <can...@olcinc.com>
Cc: Informix List <inform...@iiug.org>
Sent: Monday, October 01, 2001 9:52 PM
Subject: Re: Prepared statements on 4GL - Linux platform
Hi Candy.
Prepare statement can not allow "CREATE and DROP TABLE" sequence.
See Informix GUIDE to SQL 2-408 and 2-415.
Regards.
At 16:20 01/10/01 -0500, Candy McCall wrote:
>I have the following test program:
>
>MAIN
>
> DEFINE
> prepstr CHAR(1000)
>
> LET prepstr = "CREATE TEMP TABLE test (col1 CHAR(8))"
> PREPARE s_0 FROM prepstr
>
> LET prepstr = "DROP TABLE test"
> PREPARE s_5 FROM prepstr
>
>END MAIN
>
>
>We are testing 4GL version 7.30.UC1 on Linux.
>
>When we compile the program using c4gl -c test.4gl
>we get the following error message:
>
>esqlc: "test.ec", line 50: Warning -33071: The statement id
>'I000741E8mbcmb7x0i'
>has already been used.
>1 warning(s)
>
>I thought all cursors/statements generated are unique.
>Has anyone else encountered this problem?
>
>Thanks in advance. I've included test.ec below.
>
>Candy
> --
>Candy McCall
>ONLINE Computing, Inc.
>(can...@olcinc.com)
>
Oh... Sorry.
UNIX platform works it, I don't know.
So I tested following plogram in my PC.
But error does not occur.
Upgrade your 4GL to 7.30.UC6 or HIGHER.
Here is my environment.
[tsuto-o@ifmx30 ~]% i4gl -V
INFORMIX-4GL Version 7.30.UC6
[tsuto-o@ifmx30 ~]% rpm -q kernel glibc
kernel-2.2.14-5.0
glibc-2.1.3-15
Red Hat Linux release 6.2 (Zoot)
Kernel 2.2.14-5.0 on an i686
Regards.
see below . . .
>On Mon, 1 Oct 2001 16:20:26 -0500, "Candy McCall" <can...@olcinc.com> wrote:
>
>I'll check my 4GL version on my Linux box at home and give it a whirl. I believe it's 7.30.uc5.
>
>>
no problems on 7.20.ud7 . . . . all cursor names were uniquely mangled. My home system is a bit older than what I anticipated.
I think 7.30UC1 had lots of bugs on all platforms. We had some strange problems
on Unixware 7.1.1
with prepared statements too. Tech Support told us to define the string that
contained the
statement as char(4096). With this workaround the problem was gone. But there
are some other
nasty bugs in this version. I would try to get an update. The latest version for
Linux seems
to be 7.30UC5.
Regards
Roland
Not sure what the P1 does!
7.30.UC7 is not due out till the end of the month.
"Tsutomu Ogiwara" <Tsutomu...@ctc-g.co.jp> wrote in message
news:9pe6rf$gt4$1...@news.xmission.com...