Toad World® Forums

Truncate table


#1

Hi,
We see that the current beta does not correctly support the truncate table statement:

We have an sql/pl stored procedure which includes the following statement:

truncate table xOrdUtBrutto immediate;

In toad editor this is shown simply as:

truncate table;

Code after this is not displayed.
This subsequently causes a build error.

Regards,

John.


#2

Message from: jeff.podlasek

John
Thanks for the information.
Can you send in the body of the procedure?
This will assist us in investigating and determining exactly what the issue is.
thanks

Jeff


Historical Messages

Author: jeff.podlasek
Date: Tue Jul 20 07:06:02 PDT 2010
John
Thanks for the information.
Can you send in the body of the procedure?
This will assist us in investigating and determining exactly what the issue is.
thanks

Jeff
__

Author: john.enevoldson_671
Date: Mon Jul 19 22:55:16 PDT 2010
Hi, We see that the current beta does not correctly support the truncate table
statement: We have an sql/pl stored procedure which includes the following
statement: truncate table xOrdUtBrutto immediate; In toad editor this is shown
simply as: truncate table; Code after this is not displayed. This subsequently
causes a build error. Regards, John.
__



#3

John
Thanks for the information.
Can you send in the body of the procedure?
This will assist us in investigating and determining exactly what the issue is.
thanks

Jeff


#4

Hi,
As requested, here comes the body of the procedure:

CREATE PROCEDURE “PXX”.“PXXDLS3105DEL”
(INOUT “FTG” CHARACTER(2),
OUT “RETKOD” CHARACTER(22),
OUT “RETTEXT” CHARACTER(50),
OUT “RETSQLSTATE” CHARACTER(5)
)
SPECIFIC “PXX”.“PXXDLS3105DEL”
LANGUAGE SQL
NOT DETERMINISTIC
CALLED ON NULL INPUT
EXTERNAL ACTION
OLD SAVEPOINT LEVEL
MODIFIES SQL DATA
INHERIT SPECIAL REGISTERS

– SQL Stored Procedure
– Denna procdur …

P1: BEGIN
– Declare variables
DECLARE SQLSTATE CHAR(5) DEFAULT ‘00000’;
DECLARE ENDTABLE INT DEFAULT 0;

DECLARE hSqlState char(5);
DECLARE hRetKod char(22) default ‘99’;
declare hRetText char(50);

– Declare handler
declare exit handler for sqlexception, sqlwarning
begin
values(hRetKod, SQLSTATE) into RETKOD, RETSQLSTATE;
end;

DECLARE CONTINUE HANDLER FOR NOT FOUND
begin
	 SET hSqlState = SQLSTATE;
end;

truncate table xOrdUtBrutto immediate;
truncate table xOrdRadUtBrutto immediate;
truncate table xOrdAvgUtBrutto immediate;
truncate table xOrdForsandUtBrutto immediate;
truncate table xOrdEmbLopNrUtBrutto immediate;

truncate table xFaktTempo immediate;
truncate table xFaktRadTempo immediate;
truncate table xFaktForsandTempo immediate;
truncate table xFaktAvgTempo immediate;
truncate table xFaktOrdTempo immediate;

values (‘000’, ‘00000’, ’ ')
into RETKOD, RETSQLSTATE, RETTEXT;

END P1;

– End of generated script for 10.210.20.49-db2tst02-ZDB2LT03 (PXX)

Regards,

John.


#5

Message from: john.enevoldson_671

Hi, As requested, here comes the body of the procedure: CREATE PROCEDURE
“PXX”.“PXXDLS3105DEL” (INOUT “FTG” CHARACTER(2), OUT “RETKOD” CHARACTER(22), OUT
“RETTEXT” CHARACTER(50), OUT “RETSQLSTATE” CHARACTER(5) ) SPECIFIC
“PXX”.“PXXDLS3105DEL” LANGUAGE SQL NOT DETERMINISTIC CALLED ON NULL INPUT
EXTERNAL ACTION OLD SAVEPOINT LEVEL MODIFIES SQL DATA INHERIT SPECIAL REGISTERS


#6

John,

Thank you for the detail. I reproduced your issue and opened defect CR76165 on this issue.