Sponsored Content
Full Discussion: Teradata fastexport in ksh
Top Forums Shell Programming and Scripting Teradata fastexport in ksh Post 302933885 by usrrenny on Monday 2nd of February 2015 05:55:28 PM
Old 02-02-2015
Teradata fastexport in ksh

Hi, I am trying to use Teradata fastexport in ksh, but getting error as below

Code:
 
 temp1.ksh: line 7: syntax error at line 10: `newline' unexpected

below is my code:

Code:
 
 #!/bin/ksh
  
 LOGON_STR="TDDB/user,paswd;"
DATAFILE=/path/a.lst;
DEBUG=0
  
 >$DATAFILE
  
 fexp > /dev/null 2>&1 <
.logon ${LOGON_STR}
.LOGTABLE   DATABASE.FExp_Log;
.BEGIN EXPORT  
 .EXPORT OUTFILE ${DATAFILE};
 SELECT
             '"'|| TRIM(col A)
||'"'||','||'"'||TRIM(col B)
||'"'||','||'"'||TRIM(col C)
||'"'||','||'"'||TRIM(col D)
||'"'||','||'"'||TRIM(col E)
||'"'||','||'"'||TRIM(col F)
FROM table;
.EXPORT RESET;
.LOGOFF;
.QUIT;

Pls suggest

Last edited by usrrenny; 02-02-2015 at 07:02 PM..
 

10 More Discussions You Might Find Interesting

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

2. Programming

compile a program in C with teradata sentences using cc

hi, I want to compile a program in C. It have a multiple calls to teradata. I have no idea how to compile in Aix. The compiler that I should be use is cc. I tried cc -G -KPIC tdsfbd0358.c this generates a tdsfbd0358.i and after I have no Idea what I have to make, a link? how?... (3 Replies)
Discussion started by: kajum
3 Replies

3. Programming

Connect To Teradata

How do i connect from C program to teradata Database? The C program is being executed from a Unix script, AIX. I am calling a C program from a Unix shell script and the C Program executes some SQLs on Teradata Database. (3 Replies)
Discussion started by: yschd
3 Replies

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

5. Shell Programming and Scripting

Execute teradata queries from a file

In a .txt file i have a set of teradata queries which i need to execute and capture result for all queries.Is there any way to run teradata queries from a file? (1 Reply)
Discussion started by: katakamvivek
1 Replies

6. Programming

TeraData Sql to add months in timestamp

Hi , In teradata - how to add timestamp column with Varchar column values Output : In Exp_Date column it should add both 5/21/2012 14:00:00 and 24 ---> 5/21/2014 14:00:00 Please guide me on this . Thanks Please use code tags next time for your code and data. Thanks (1 Reply)
Discussion started by: Perlbaby
1 Replies

7. UNIX and Linux Applications

Using BTEQ with perl to Teradata

Has anyone used either bteq or mload for inserting into a Teradata Database via perl. We're running Red Hat Enterprise 5.7. I've gotten the DBD::ODBC drivers installed and running. I installed the Teradata ICU, TeraGSS and ODBC pkgs. We are using perl to insert data across the network into... (1 Reply)
Discussion started by: islanderman
1 Replies

8. UNIX for Advanced & Expert Users

Teradata and Informatica Load constraints

HI Team , I have interesting issue observed when using teradata sql assistant(14.1) and Informatica tool (9.5) versions. I created SQL code in teradata where source count is 5000 records . I am using source and target database as teradata and trying to load using informatica tool . Its straight... (0 Replies)
Discussion started by: Perlbaby
0 Replies

9. Shell Programming and Scripting

Connection with Teradata through shell Script

Hi All, As we are using SQLPLUS command to connect Oracle Database in unix: Like below syntax: sqlplus username/password@dbname << EOI SET HEADING OFF SPOOL MAX_DATE_VAL.txt select max(LAST_UPDT_DATE) from source_defect; SPOOL OFF here the result is stored in... (0 Replies)
Discussion started by: Shilpi Gupta
0 Replies

10. 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
OCI_FIELD_IS_NULL(3)													      OCI_FIELD_IS_NULL(3)

oci_field_is_null - Checks if a field in the currently fetched row is NULL

SYNOPSIS
bool oci_field_is_null (resource $statement, mixed $field) DESCRIPTION
Checks if the given $field from the current row of $statement is NULL. PARAMETERS
o $statement - A valid OCI statement identifier. o $field - Can be the field's index (1-based) or name. RETURN VALUES
Returns TRUE if $field is NULL, FALSE otherwise. EXAMPLES
Example #1 oci_field_name(3) example <?php // Create the table with: // CREATE TABLE mytab (c1 NUMBER); // INSERT INTO mytab VALUES (1); // INSERT INTO mytab VALUES (NULL); $conn = oci_connect("hr", "hrpwd", "localhost/XE"); if (!$conn) { $m = oci_error(); trigger_error(htmlentities($m['message']), E_USER_ERROR); } $stid = oci_parse($conn, "SELECT * FROM mytab"); oci_execute($stid); while (($row = oci_fetch_array($stid, OCI_RETURN_NULLS)) != false) { $ncols = oci_num_fields($stid); for ($col = 1; $col <= $ncols; $col++) { var_dump(oci_field_is_null($stid, $col)); } } // Outputs: // bool(false) // bool(true) oci_free_statement($stid); oci_close($conn); ?> NOTES
Note In PHP versions before 5.0.0 you must use ocicolumnisnull(3) instead. This name still can be used, it was left as alias of oci_field_is_null(3) for downwards compatability. This, however, is deprecated and not recommended. PHP Documentation Group OCI_FIELD_IS_NULL(3)
All times are GMT -4. The time now is 11:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy