Hi there,
We have a problem EXEC SQL PREPARE when the statement contains a FOR UPDATE
clause. We get a run-time error
-7008 Updates of this table not allowed.
Without prepare the temporary used area continuely grows:
static void sql_open(void){
EXEC SQL DECLARE SACGBRMIO_REQIO CURSOR FOR
SELECT
A.GBRGBRIDN,
A.GBRGBRNAM,
A.GBRGBRAFD,
A.GBRGBROMS,
A.GBRVRVPER,
A.GBRVRVDAT,
A.GBRAUTSRT,
A.GBRGBRPRT,
A.GBRMENIDN,
A.GBRGRPIDN
FROM SASGBRM00 A
WHERE
A.GBRGBRIDN = :SQLDTA.GBRGBRIDN
FOR UPDATE NOWAIT WITH LOCK (NOWAIT) EXCLUSIVE
;
EXEC SQL OPEN SACGBRMIO_REQIO ;
sqlcode = sqlca.sqlcode;
if (sqlcode == 0) {
sql_fetch();
}
}
To circumvent the filling of the temporary used area and gaining in performance
we are now using the EXEC SQL PREPARE. This strategy has proven to be
succesfull with other statements but not with the one below.
With prepare '-7008 Updates of this table not allowed' occurs:
static void sql_open(void){
static int sw = 0 ;
if( sw == 0 ) {
sw = 1 ;
EXEC SQL PREPARE SACGBRMIO_REQIO_PREP FROM
"\
SELECT \
A.GBRGBRIDN, \
A.GBRGBRNAM, \
A.GBRGBRAFD, \
A.GBRGBROMS, \
A.GBRVRVPER, \
A.GBRVRVDAT, \
A.GBRAUTSRT, \
A.GBRGBRPRT, \
A.GBRMENIDN, \
A.GBRGRPIDN \
FROM SASGBRM00 A \
WHERE \
A.GBRGBRIDN = ? \
FOR UPDATE NOWAIT WITH LOCK (NOWAIT) EXCLUSIVE"
;
}
EXEC SQL DECLARE SACGBRMIO_REQIO
CURSOR FOR SACGBRMIO_REQIO_PREP ;
EXEC SQL OPEN SACGBRMIO_REQIO USING
:SQLDTA.GBRGBRIDN
;
sqlcode = sqlca.sqlcode;
if (sqlcode == 0) {
sql_fetch();
}
}
We are using MaxDB version 7.5.00.23 on SuSE Linux Enterprise Server for x86.
Those anyone have a solution for this.
Heymen Nicolaij
Technisch Specialist
PinkRoccade
Luchthavenweg 54, 5657 EB Eindhoven
Postbus 57010, 5605 AA Eindhoven
T: 040-2562685
M: +31 646091122
E: [EMAIL PROTECTED]
I: www.pinkroccade.nl
---------------------------------------------------------------------------------------------------------------------------------------
Op deze e-mail is een disclaimer van toepassing/ This e-mail is subject to a
disclaimer: <http://www.pinkroccade.nl/emaildisclaimer>
---------------------------------------------------------------------------------------------------------------------------------------
--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]