Hi,
could it be that you are selecting from a view "SASGBRM00"? Depending on
the view definition this might not work. If it is not a view could you
please send the table definition for further analysis?

Regards,
Marco 
SAP Labs Berlin
> -----Original Message-----
> From: Nicolay Heymen [mailto:[EMAIL PROTECTED] 
> Sent: Mittwoch, 9. Februar 2005 09:17
> To: [email protected]
> Cc: Kampen, van Tom; Lammers Joost
> Subject: Problem with prepare in embedded SQL C -7008 updates 
> of this table not allowed
> 
> 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]
> 
> 

--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to