Norbert Felde wrote :
>
>I verified my proc using sqlstudio and executed the following 
>2 queries:
>call data_uj( '0410', 1, 1, '1' )
>select * from data0410
>
>The data0410 exists, I created it before. The attached trace was made 
>when I executed this two queries.
>
>Thanks,
>Norbert
>
>"Anhaus, Thomas" <[EMAIL PROTECTED]> �rta:
>
>> Norbert Felde wrote :
>> 
>> >Hello,
>> >
>> >I wrote the dbproc as follows. I can create it and call it 
>without any 
>> >error message, but it dous not insert any data into the table. 
>> >Could you 
>> >tell me what is wrong in the proc.
>> >
>> >thank you advance,
>> >Norbert
>> >
>> >the proc:
>> >
>> >CREATE DBPROC DATA_UJ (
>> >    IN TABLEIDX             varchar(4),
>> >    IN HEADERID             integer,
>> >    IN PARAMID              integer,
>> >    IN ERTEK                varchar(100)
>> >    )
>> >    RETURNS CURSOR AS
>> >    VAR DID integer; IQ varchar(500);
>> >    $CURSOR = 'DATA_CUR';
>> >    TRY
>> >            SELECT SEQ_DATAID.NEXTVAL FROM DBA.DUAL;
>> >            FETCH INTO :DID;
>> >            SET IQ = 'INSERT INTO DNUSER.DATA' || TABLEIDX ||
>> >            '( DATAID, HEADERID, PARAMID, ERTEK )' ||
>> >            'VALUES( ' || DID || ', ' || HEADERID ||', '|| PARAMID 
>> >||', '''|| ERTEK || ''')';
>> >            EXECUTE IQ;
>> >            DECLARE :$CURSOR CURSOR FOR
>> >                    SELECT :DID AS RES FROM DBA.DUAL;
>> >    CATCH
>> >            IF( $RC <> 0 )
>> >            THEN STOP ( $RC, $ERRMSG );
>> >
>> >
>> >
>> >-- 
>> >MaxDB Discussion Mailing List
>> >For list archives: http://lists.mysql.com/maxdb
>> >To unsubscribe:    
>> >http://lists.mysql.com/[EMAIL PROTECTED]
>> >
>> >
>> 
>> I tried to reproduce the problem, unfortunately without 
>success. After 
>a call of the procedure a row is
>> inserted into the table DATAXXX.
>> How did you verify that no insert has been executed ? Is it possible 
>that you didn't commit the
>> transaction containing the dbproc call ?
>> If you are sure that a row must have been inserted but is not 
>present in the table please
>> send me a vtrace of the dbproc call. For vtrace please see 
>http://sapdb.2scale.net/moin.cgi/VTrace
>> 
>> Best Regards,
>> Thomas
>> 
>> 
>
>
Thanks for sending the trace. 
It shows, that the insert statement fails with error -4004, unknown tablename.

dbs SEGMENT 1   (1 part, len: 560)
         internal, user_cmd
command PART   (1 argument, size: 16296)
buf(501):
' INSERT INTO DNUSER.DATA0410( DATAID, HEADERID, PARAMID, ERTEK )VALUES( 155503, 1, 1, 
'1')    

RECEIVE: ascii, full_swap, 70500-XCI     (1 segment, len: 88)
(1.4921  page 1)
*** -4004 / RETURN SEGMENT 1   (1 part, len: 88)
      insert_fc, errpos: 14, sqlstate: '42000'
errortext PART   (1 argument, size: 16296)
      buf(27): 'Unknown table name:DATA0410'

I think it's sure that the table DNUSER.DATA0410 does not exist or the current user 
does not
have any privilege for that table.

Another problem is that the exception handling does not catch this error. I know that 
we
had a bug in this context in the past. So please let me know your MaxDB version to be 
able
to decide whether this problem has already been fixed.

Best Regards,
Thomas

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

Reply via email to