Exporting SHOW PROCEDURE to a file with BTEQ

Tools & Utilities
Highlighted
Fan

Exporting SHOW PROCEDURE to a file with BTEQ

Hi,

I am trying to export DDL of procedures to file with BTEQ. My script looks like:

 

 

.SET WIDTH 65531

.LOGON **bleep**/**bleep**, **bleep**

.SET TITLEDASHES OFF


.EXPORT FILE = 'c:\...\[db_name]\[proc_name].sql'

SHOW PROCEDURE [db_name].[proc_name];

.EXPORT RESET

.QUIT

This script worked for me with no problems several years till now, when working on different TD database (new workplace).

 

The problem is, that for some procedures, exported SHOW PROCEDURE in the exported file is pure nonsense - it contains a mix of DDLs of completely different objects (part of some view and part of the procedure?!?!). For some other procedures, the exported result is OK. When running the SHOW PROCEDURE statement in the TD Assistant, the result DDL is OK. It happens only when running SHOW PROCEDURE with BTEQ.

I am using TD:

RELEASE	14.10.07.09
VERSION 14.10.07.10

and BTEQ:

 Teradata BTEQ 16.20.00.07 (32-bit) for WIN32. PID: 10880
 Copyright 1984-2018 Teradata. All rights reserved.
 Enter your logon or BTEQ command:

Do any of you have any idea what is wrong with that, or I am doing something wrong?

 

Thank you!

 

Peter


Accepted Solutions
Fan

Re: Exporting SHOW PROCEDURE to a file with BTEQ

I found the cause. Problem was in untranslatable character in comment inside procedure code.

Adding commad to BTEQ code:

.SET SESSION CHARSET 'UTF8';

solved the problem.

 

 

1 ACCEPTED SOLUTION
1 REPLY 1
Fan

Re: Exporting SHOW PROCEDURE to a file with BTEQ

I found the cause. Problem was in untranslatable character in comment inside procedure code.

Adding commad to BTEQ code:

.SET SESSION CHARSET 'UTF8';

solved the problem.