Using .HANG command with DROP statement in the same line is not working

Database
Enthusiast

Using .HANG command with DROP statement in the same line is not working

Hi Ulrich/Dnoeth,

Somehow I am not able to commenton my post related to this issue.So, I created a new topic.

Dnoeth suggested me to use "Data file with Record mode off and foldline option" but

I am still getting the header as:

"112/11/30 SELECT DISTINCT 'DROP TABLE DB.' || 'TABLENAME' ||  ';' , CASE WHEN ROW_NUMBER() OVER (ORDER BY TABLE ... Page1

and then for Page 2 and so on...How to get rid of it. I am using Data file with Record mode off and foldline option.

I am using this in BATCH.

Please advice.

Thanks.

I am using the below query:

.export data file = xxx

.recordmode off

.foldline all

And split the string in two columns:

SELECT

   'DROP TABLE DB.' || TABLENAME || ' ;',   

   CASE WHEN ROW_NUMBER() OVER (ORDER BY TABLENAME) MOD 25 = 0

   THEN '.HANG 10;' ELSE ' ' END                     

FROM DBC.TABLES

2 REPLIES
Enthusiast

Re: Using .HANG command with DROP statement in the same line is not working

Hi,

Any comment, anybody???

Senior Apprentice

Re: Using .HANG command with DROP statement in the same line is not working

Looks like there's a HEADING defined (although i don't know how you can get the SELECT in it).

Do a SHOW CONTROL to see the settings and try a FORMAT OFF to switvh off the header.

Dieter