Fast export in unix


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Fast export in unix
# 1  
Old 06-29-2009
Fast export in unix

/opt/teradata/client/bin/fexp <<EOP

.LOGTABLE load_work.datastore_log1 ;
.LOGON BOX/userid,password;
.BEGIN EXPORT
SESSIONS 20;
.EXPORT OUTFILE $path MODE RECORD FORMAT TEXT;

select
trim(cast(PROC_YYMM_DT as char(5))) (title ''),
cast('~' as char(1)),
trim(cast(ACCNO as char(21))) (title ''),
cast('~' as char(1)),
(CASE
WHEN ACC_CO_NO IS NULL
THEN CAST('?' AS CHAR(1))
ELSE trim(CAST(ACC_CO_NO AS char(21)))
END) (title ''),
cast('~' as char(1)),
trim(cast(ACC_APPSYS_ID as char(3))) (title ''),
cast('~' as char(1)),
(CASE
WHEN ACC_CHFGL_MT_TR_AM IS NULL
THEN CAST('?' AS CHAR(1))
ELSE trim(CAST(ACC_CHFGL_MT_TR_AM as char(18)))
END) (title ''),
cast('~' as char(1)),
(CASE
WHEN ACC_CHFGL_LT_TR_AM IS NULL
THEN CAST('?' AS CHAR(1))
ELSE trim(CAST(ACC_CHFGL_LT_TR_AM as char(18)))
END) (title ''),
cast('~' as char(1)),
(CASE
WHEN ACC_RECGL_LT_TR_AM IS NULL
THEN CAST('?' AS CHAR(1))
ELSE trim(CAST(ACC_RECGL_LT_TR_AM as char(18)))
END) (title ''),
cast('~' as char(1)),
(CASE
WHEN BNKRPT_NOTIFTN_DT IS NULL
THEN CAST('?' AS CHAR(1))
ELSE CAST(CAST(BNKRPT_NOTIFTN_DT AS FORMAT 'YYYY-MM-DD')
AS CHAR(10))
END) (title '')
from vrtl.core_rcvry
where
proc_yymm_dt = 10811 and
acc_appsys_id in ('599');

.END EXPORT ;
.LOGOFF;
EOP

~ as delimiter

i am using the following query to fast export.. but i getting some junk characters prefixed to each column value ... what is the problem??.... it queries perfectly in teradata though..
# 2  
Old 07-02-2009
To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags [code] and [/code] by hand.)

Second, select an appropriate forum for your post. A long script in a scripting language most people have never heard of does not belong in "dummies questions and answers".

Thank You.

The UNIX and Linux Forums
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Data export UNIX shell script

Hi, I want to write a shell script which connect to my database with the following credentials : User name : user PWD : rap_user_1 Hostname : app.Unix.Gsm1900.Org Port : 7862 SID : PTNC1 Once connected to DB i want to fetch data with the help of a SQL statement and expoet... (4 Replies)
Discussion started by: neeraj617
4 Replies

2. UNIX for Advanced & Expert Users

How to export Result to Excel Tabular format from UNIX?

Hi I am working on a script in which I am firing a query on database through Unix and getting the result set. I want to export that in an excel file. I am able to do so nut the result are exported horizontally one below the other. Can anyone plss help me out in exporting the Result in Tabular... (4 Replies)
Discussion started by: Saritau3
4 Replies

3. UNIX for Dummies Questions & Answers

export in unix

hi i have some lines in a text file like, export ORACLE_HOME=/home/dell/instantclient_11_2 export LD_LIBRARY_PATH=$ORACLE_HOME:${LD_LIBRARY_PATH} export PATH=$ORACLE_HOME:$ORACLE_HOME/sdk:${PATH} how to run this file such that every line will be exported in unix session (3 Replies)
Discussion started by: mprakasheee
3 Replies

4. Shell Programming and Scripting

Fast export in UNIX using Teradata creating issue

Hi All, I am trying to export a file using Fast Export (Teradata) in UNIX. The desired output length is 550 bytes, but the output file is creating string till 75 characters. How to get the full length file? .LOGON .EXPORT file=export.txt; SELECT CAST(('' || (CAST('UD ' AS CHAR(3))) || ... (2 Replies)
Discussion started by: unankix
2 Replies

5. Shell Programming and Scripting

Export command in unix

Hi, executing below command for export in cygwin, though I have already mentioned the username and password with the command but on execution it again asks for username, what modification is needed in the below command ? may be there is some problem in using inverted comma ? exp... (1 Reply)
Discussion started by: milink
1 Replies

6. Shell Programming and Scripting

Can any one share a unix script for validating the export of a mapping which is in XM

Hi, Can any one share a unix script for validating the export of a mapping which is in XML format. like my requirment is that when ever we are migrating the mappings or wokflows from development to QA we will take the export of that mapping into an XML file.Insted of reviewing the mapping... (1 Reply)
Discussion started by: perlamohan
1 Replies

7. UNIX for Advanced & Expert Users

Can any one share a unix script for validating the export of a mapping which is in XM

Hi, Can any one share a unix script for validating the export of a mapping which is in XML format. like my requirment is that when ever we are migrating the mappings or wokflows from development to QA we will take the export of that mapping into an XML file.Insted of reviewing the mapping... (1 Reply)
Discussion started by: perlamohan
1 Replies

8. UNIX for Advanced & Expert Users

A Fast File System For Unix

We have an assignment to critique Mckusic'sk paper A Fast File System for Unix http://www.cs.berkeley.edu/~brewer/cs262/FFS.pdf. As a part of the paper we are supposed to regenerate the values found in Table 1 and Table 2a and 2b using linux. My problem is how should I regenerate these results... (2 Replies)
Discussion started by: sigismo
2 Replies

9. UNIX for Advanced & Expert Users

UNIX export command - memory space

Hello, I have 2 or more environment files, with identical variable names; see below: .env_file1 export PROJNAME="XYZ" export PROJID="2" .env_file2 export PROJNAME="WSX" export PROJID="9" .env_file(n) export PROJNAME="QAZ" export PROJID="12" The env files above will be sourced... (2 Replies)
Discussion started by: Nomaad
2 Replies

10. UNIX for Dummies Questions & Answers

How to export data file from Unix

Hi, I am searching a way to export data file on Unix to SQL server on a daily bases. Any one has any ideas? Thanks in advance! (20 Replies)
Discussion started by: whatisthis
20 Replies
Login or Register to Ask a Question