Sponsored Content
Top Forums Shell Programming and Scripting Fast export in UNIX using Teradata creating issue Post 302643219 by spacebar on Friday 18th of May 2012 04:43:47 PM
Old 05-18-2012
This is a clip from(forums.teradata.com):
To export into a fixed width flat file run this query:
Code:
SELECT ColumnID, ColumnLength, ColumnType, ColumnName,
CASE
WHEN ColumnType = 'CF' THEN ColumnLength -- char
WHEN ColumnType = 'CV' THEN ColumnLength / 2 --varchar
WHEN ColumnType = 'I' THEN 11 --integer
WHEN ColumnType = 'I1' THEN 4 --byte integer
WHEN ColumnType = 'I2' THEN 6 --small integer
WHEN ColumnType = 'D' THEN 19 --decimal
WHEN ColumnType = 'F' THEN 19 --float
WHEN ColumnType = 'DA' THEN 10 --date
WHEN ColumnType = 'TS' THEN 19 -- timestamp
ELSE NULL
END
AS RealColumnLength
FROM dbc.COLUMNS
WHERE dbc.COLUMNS.tableName = 'YOUR_TABLE'
ORDER BY ColumnID

and then for the fastexport script concatenate "cast (ColumnName as char(RealColumnLength))||" for each column. Cast the resulting string to a sum(RealColumnLength). I am using a simple Excel worksheet for this.


also check out: http://forums.teradata.com
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

export issue

hi, I have a password file called mypwd.bash in /home/oracle/practice directory as follows. mypwd.bash mypwd=oracle export mypwd i called the above file in the following script as follows. passwdtest.bash /home/oracle/practice/mypwd.bash echo $mypwd but nothing is getting ... (2 Replies)
Discussion started by: ravi raj kumar
2 Replies

2. 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

3. Programming

Unix - teradata

I am trying execute a sql file from the script and the sql file has the following code snippet, which throws out the error given below FOR C_FINELINE_LP AS CURSOR C_SLS FOR SELECT * FROM WM_UTIL.FLT_DEP WHERE LOAD_IND = 'N' DO ..... ..... .... END FOR; FOR C_FLTSLS_STR_LP AS... (0 Replies)
Discussion started by: yschd
0 Replies

4. UNIX for Dummies Questions & Answers

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)))... (1 Reply)
Discussion started by: depakjan
1 Replies

5. OS X (Apple)

Creating a file to export into Excel

Hello, This is my first post so not sure what response I will get I do have a very small knowledge of UNIX used last over 10 years ago I have recently move over to an Apple IMAC I need to copy all my jpg files into excel Could someone please let me know if this is possible and... (2 Replies)
Discussion started by: Nacnud
2 Replies

6. 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

7. Shell Programming and Scripting

Teradata connectivity through UNIX by use bteq

Hi, I want a script for connecting teradata to load the file to teradata table. Can you please help me out. Thanks in advance. (1 Reply)
Discussion started by: victory
1 Replies

8. Shell Programming and Scripting

Svn export issue

Hi all, When i do "svn export <URL of the specific file in svn>" it gives me file which is of older version instead of a file which is of latest or current working version. On the other hand, "svn co <URL of the directory in svn>" It gives me latest version committed files and... (0 Replies)
Discussion started by: nnsjw702
0 Replies

9. Shell Programming and Scripting

Minute(4) issue in teradata

I have values below for which diff field is giving error like "invalid time interval" in teradata Might be it is not doing calculation anymore after exceeding minute(4) value END_TS 2/2/2018 08:50:49.000000 START_TS 1/5/2018 17:30:02.000000 SLA_TIME 23:59:59.000000 select... (0 Replies)
Discussion started by: himanshupant
0 Replies
OD(1)								   User Commands							     OD(1)

NAME
od - dump files in octal and other formats SYNOPSIS
od [OPTION]... [FILE]... od [-abcdfilosx]... [FILE] [[+]OFFSET[.][b]] od --traditional [OPTION]... [FILE] [[+]OFFSET[.][b] [+][LABEL][.][b]] DESCRIPTION
Write an unambiguous representation, octal bytes by default, of FILE to standard output. With more than one FILE argument, concatenate them in the listed order to form the input. With no FILE, or when FILE is -, read standard input. All arguments to long options are mandatory for short options. -A, --address-radix=RADIX decide how file offsets are printed -j, --skip-bytes=BYTES skip BYTES input bytes first -N, --read-bytes=BYTES limit dump to BYTES input bytes -S, --strings[=BYTES] output strings of at least BYTES graphic chars -t, --format=TYPE select output format or formats -v, --output-duplicates do not use * to mark line suppression -w, --width[=BYTES] output BYTES bytes per output line --traditional accept arguments in traditional form --help display this help and exit --version output version information and exit Traditional format specifications may be intermixed; they accumulate: -a same as -t a, select named characters, ignoring high-order bit -b same as -t o1, select octal bytes -c same as -t c, select ASCII characters or backslash escapes -d same as -t u2, select unsigned decimal 2-byte units -f same as -t fF, select floats -i same as -t dI, select decimal ints -l same as -t dL, select decimal longs -o same as -t o2, select octal 2-byte units -s same as -t d2, select decimal 2-byte units -x same as -t x2, select hexadecimal 2-byte units If first and second call formats both apply, the second format is assumed if the last operand begins with + or (if there are 2 operands) a digit. An OFFSET operand means -j OFFSET. LABEL is the pseudo-address at first byte printed, incremented when dump is progressing. For OFFSET and LABEL, a 0x or 0X prefix indicates hexadecimal; suffixes may be . for octal and b for multiply by 512. TYPE is made up of one or more of these specifications: a named character, ignoring high-order bit c ASCII character or backslash escape d[SIZE] signed decimal, SIZE bytes per integer f[SIZE] floating point, SIZE bytes per integer o[SIZE] octal, SIZE bytes per integer u[SIZE] unsigned decimal, SIZE bytes per integer x[SIZE] hexadecimal, SIZE bytes per integer SIZE is a number. For TYPE in doux, SIZE may also be C for sizeof(char), S for sizeof(short), I for sizeof(int) or L for sizeof(long). If TYPE is f, SIZE may also be F for sizeof(float), D for sizeof(double) or L for sizeof(long double). RADIX is d for decimal, o for octal, x for hexadecimal or n for none. BYTES is hexadecimal with 0x or 0X prefix, and may have a multiplier suffix: b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024, GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y. Adding a z suffix to any type displays printable characters at the end of each output line. Option --string without a number implies 3; option --width without a number implies 32. By default, od uses -A o -t oS -w16. AUTHOR
Written by Jim Meyering. REPORTING BUGS
Report od bugs to bug-coreutils@gnu.org GNU coreutils home page: <http://www.gnu.org/software/coreutils/> General help using GNU software: <http://www.gnu.org/gethelp/> COPYRIGHT
Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
The full documentation for od is maintained as a Texinfo manual. If the info and od programs are properly installed at your site, the com- mand info coreutils 'od invocation' should give you access to the complete manual. GNU coreutils 7.1 July 2010 OD(1)
All times are GMT -4. The time now is 10:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy