Sponsored Content
Special Forums UNIX and Linux Applications Using BTEQ with perl to Teradata Post 302902659 by DGPickett on Wednesday 21st of May 2014 01:45:34 PM
Old 05-21-2014
For speed, start at the DB and work back: Teradata FastLoad - Wikipedia, the free encyclopedia

FastLoad works with flat files and empty tables, perl can write flat files, and you can make an empty staging table. The big challenge is getting data inside the db; table to table is usually much faster and low overhead. For stremaing data, think mini-batches and be amazed how near real time it can be. You could even do simple inserts for lowest latency on a simple connection, buffering input with another thread, until a buffer high water line is passed, and then switch to mini-batch until a low water line is passed. Writing the next file while the current one is being FastLoad'd and unstaged means you can get a high peak capability with minimal latency (another thread). The higher the load, the bigger the batches and latency get, but economy of scale softens the curve. If the buffering format is FastLoad compatible, moving buffered to file is faster and easy.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Connectivity to Bteq through Perl

I want to connect to bteq using Perl script and i am unaware of how to do this? In Shell script it is very simple, Bteq<<-END .logon ..... ... .quit ... END but what is the syntex for perl? Please help me out . Thanks Kunal (1 Reply)
Discussion started by: kunal_dixit
1 Replies

2. Shell Programming and Scripting

Shell/perl script to connect to different servers in single login in teradata

Hi, I want to write a shell script to compare two tables in teradata.these tables are present on different servers. I want to connect to both servers in single login in order to fetch and compare the data in one go. Thanks (1 Reply)
Discussion started by: monika
1 Replies

3. UNIX for Dummies Questions & Answers

Log file not getting populated when using BTEQ

Hi, I am trying to run some SQL scripts under the UNIX server using BTEQ. When I try to create a log file, the file gets populated only to the point where I log into BTEQ. The log file for the running of the actual script does not seem to be stored. Would any one know ehy this could be... (3 Replies)
Discussion started by: zsrinathz
3 Replies

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

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

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

7. Shell Programming and Scripting

How to pass parameter to bteq?

I am using below code to connect terdata and getting the query result in a file.Now i want to use same code for different tables,plz tell me how to pass table name as parameter.i tried using as below code but not working. bteq < /download/viv/dev/ops/Scripts/ter.sh FLTORGTKR_ORG_etc.. ... (1 Reply)
Discussion started by: katakamvivek
1 Replies

8. Shell Programming and Scripting

Teradata fastexport in ksh

Hi, I am trying to use Teradata fastexport in ksh, but getting error as below temp1.ksh: line 7: syntax error at line 10: `newline' unexpected below is my code: #!/bin/ksh LOGON_STR="TDDB/user,paswd;" DATAFILE=/path/a.lst; DEBUG=0 >$DATAFILE fexp > /dev/null... (3 Replies)
Discussion started by: usrrenny
3 Replies

9. Shell Programming and Scripting

How to write BTEQ batch scripts in UNIX?

Hi All, I need to write Unix shell script. To star with : I need to do some file checking on unix file system, then based on file existance, I need to run diff SQL in Teradata Bteq. After that, depending on Results of SQL, I need to code other shell scripting like moving file, within same... (4 Replies)
Discussion started by: Shilpi Gupta
4 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
DBI::DBD::Metadata(3)					User Contributed Perl Documentation				     DBI::DBD::Metadata(3)

NAME
DBI::DBD::Metadata - Generate the code and data for some DBI metadata methods SYNOPSIS
The idea is to extract metadata information from a good quality ODBC driver and use it to generate code and data to use in your own DBI driver for the same database. To generate code to support the get_info method: perl -MDBI::DBD::Metadata -e "write_getinfo_pm('dbi:ODBC:dsn-name','user','pass','Driver')" perl -MDBI::DBD::Metadata -e write_getinfo_pm dbi:ODBC:foo_db username password Driver To generate code to support the type_info method: perl -MDBI::DBD::Metadata -e "write_typeinfo_pm('dbi:ODBC:dsn-name','user','pass','Driver')" perl -MDBI::DBD::Metadata -e write_typeinfo_pm dbi:ODBC:dsn-name user pass Driver Where "dbi:ODBC:dsn-name" is the connection to use to extract the data, and "Driver" is the name of the driver you want the code generated for (the driver name gets embedded into the output in numerous places). Generating a GetInfo package for a driver The "write_getinfo_pm" in the DBI::DBD::Metadata module generates a DBD::Driver::GetInfo package on standard output. This method generates a DBD::Driver::GetInfo package from the data source you specified in the parameter list or in the environment variable DBI_DSN. DBD::Driver::GetInfo should help a DBD author implement the DBI get_info() method. Because you are just creating this package, it is very unlikely that DBD::Driver already provides a good implementation for get_info(). Thus you will probably connect via DBD::ODBC. Once you are sure that it is producing reasonably sane data, you should typically redirect the standard output to lib/DBD/Driver/GetInfo.pm, and then hand edit the result. Do not forget to update your Makefile.PL and MANIFEST to include this as an extra PM file that should be installed. If you connect via DBD::ODBC, you should use version 0.38 or greater; Please take a critical look at the data returned! ODBC drivers vary dramatically in their quality. The generator assumes that most values are static and places these values directly in the %info hash. A few examples show the use of CODE references and the implementation via subroutines. It is very likely that you will have to write additional subroutines for values depending on the session state or server version, e.g. SQL_DBMS_VER. A possible implementation of DBD::Driver::db::get_info() may look like: sub get_info { my($dbh, $info_type) = @_; require DBD::Driver::GetInfo; my $v = $DBD::Driver::GetInfo::info{int($info_type)}; $v = $v->($dbh) if ref $v eq 'CODE'; return $v; } Please replace Driver (or "<foo>") with the name of your driver. Note that this stub function is generated for you by write_getinfo_pm function, but you must manually transfer the code to Driver.pm. Generating a TypeInfo package for a driver The "write_typeinfo_pm" function in the DBI::DBD::Metadata module generates on standard output the data needed for a driver's type_info_all method. It also provides default implementations of the type_info_all method for inclusion in the driver's main implementation file. The driver parameter is the name of the driver for which the methods will be generated; for the sake of examples, this will be "Driver". Typically, the dsn parameter will be of the form "dbi:ODBC:odbc_dsn", where the odbc_dsn is a DSN for one of the driver's databases. The user and pass parameters are the other optional connection parameters that will be provided to the DBI connect method. Once you are sure that it is producing reasonably sane data, you should typically redirect the standard output to lib/DBD/Driver/TypeInfo.pm, and then hand edit the result if necessary. Do not forget to update your Makefile.PL and MANIFEST to include this as an extra PM file that should be installed. Please take a critical look at the data returned! ODBC drivers vary dramatically in their quality. The generator assumes that all the values are static and places these values directly in the %info hash. A possible implementation of DBD::Driver::type_info_all() may look like: sub type_info_all { my ($dbh) = @_; require DBD::Driver::TypeInfo; return [ @$DBD::Driver::TypeInfo::type_info_all ]; } Please replace Driver (or "<foo>") with the name of your driver. Note that this stub function is generated for you by the write_typeinfo_pm function, but you must manually transfer the code to Driver.pm. AUTHORS
Jonathan Leffler <jleffler@us.ibm.com> (previously <jleffler@informix.com>), Jochen Wiedmann <joe@ispsoft.de>, Steffen Goeldner <sgoeldner@cpan.org>, and Tim Bunce <dbi-users@perl.org>. perl v5.16.3 2013-04-04 DBI::DBD::Metadata(3)
All times are GMT -4. The time now is 05:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy