Hi i am trying to use DEFINE SCHEMA target_schemaz FROM TABLE in a tbuild script and it is failing with
"Teradata Parallel Transporter Version 14.10.00.01
On what platform are you running?
You will need to add your Teradata Database node id's and IP addresses into the /etc/hosts file (for Unix/Linux).
Please refer to the CLIv2 documentation for more information.
I am a newbee but making great progress - I have everything working but I am trying to generalize my scripts thus the desire to use the dynamic schema operator. I have spent several hours now going through the TPT user and reference manuals, if there is a wex based training courtse that covers this please point me at it. Thank you, --Don
The connection information in the script is through the use of the TdpId, Username and UserPassword attributes.
But the TdpId must be in your hosts file.
Or, you can just put the IP address in the TdpId attribute.
By "dynamic schema operator", do you mean the schema mapping operator?
What is it you are really trying to do?
I am moving tables from netezza to teradata , they have the equivalent table definations. Since I have many to do, I'm trying to develop a script that could just take the table name.
I am testing the use of ODBC to move the data directly from one db to the other.
My thought was to use the DEFINE SCHEMA XXX FROM TABLE syntax so I won't need to code that part.
I have the script working by manually coding the scema directive and wish to remove that to make it generic.
On the NZ side I can create a view to output the data and timestamps columns formated correctly, although I wish that wasn't necessary. Apparently the data comes out formatted incorectly by default for loading timestamps and dates.
So I still am not able to get this working, the real operators all have an attributes section but the schema directive doesn't.
I tried this (below) as my best guess but it doesn't work, I obscured the tdpid below
Ok - i see that won't work for me even if I get past the login issue:
This script below creates aschema file and then uses it.
One issue I need to get past is to use a variable as part of the sql statement.
Below you will see :
TPT will not parse/touch anything in single quotes.
Thus, if you want to use job variables inside a SQL statement, then you need to break it up into pieces, and use the concatenation operator.
But you already did that when you implemented the DROP TABLE statements.
You would do the same thing with the SELECT.
The "@" character denotes the name of a job variable. Thus, you would do:
SelectStmt = 'SELECT ..... from Dbc.COLUMNS c where TableName = ' || @my_tablename || ' AND DatabaseName = ' || @my_dbname || ';'