Quantcast
Channel: Teradata Forums - Tools
Viewing all 4252 articles
Browse latest View live

TPT Script to load multiple data types from a delimited file - forum topic by andydoorey

$
0
0

I have a file to load which doesn't seem to be in too unusual a format, but I'm not sure if it is possible to load it using TPT.  Can anyone let me know whether this is possible, or if I have to write some unix script to edit the file before I can load it.
 
The data looks like this:

SVC_NAME,OPUNIT_NO,DEPOT_CODE,OPU_TYPE,REGION_NUMBER

"Aberdeen",7240,"051","M",4

"Aberystwyth SC",7252,"067","M",6

"Middleton",7130,"002","M",3

"Aylesham",7120,"061","M",5

 

The first row is a header which has the column names from the source system.

The data rows have char/varchar fields which are quoted, and number fields which are not.  The fields are delimited by commas.

 

If I define the file as delimited it states that all fields need to be varchar/vardate.  This would mean that all the fields would need to be quoted, which they aren't.

Also, I want to skip the first row, but it seems that even if I set SkipRows=1 it still checks that it matches the same schema as the data rows, and therefore each of the fields needs to be quoted.

 

I don't think this is an unusual format.  In fact the CSVLD function would be able to split this out into the correct fields.  Unfortunately I tried using this function on a fairly large table of unformated records similar to the above and it caused Teradata to crash.  It seems more sensible to be able to load this using TPT into the correct fields in the first place, which is why I'm trying to find out whether it is possible or not.

 

Can anyone let me know whether this is possible or not?

Tags: 
Forums: 

Studio Express installer can't find java - response (5) by afijovial

$
0
0

i tried selecting C:\Program Files\Java\jre7 , even then its showing please select jre path.

Speed up imports in BTEQ or SQL Assistant - response (11) by gopinadhs

$
0
0

Hi Dnoeth,
Can i use PACK command for BTEQ DML activities to avoid slow running lookups. I know PACK is same as Serialize , since it is grouping of all same row hash in to a same amp.
--So, can i use PACK command in BTEQ DML activity ?.
--How to use PACK in bteq, and please check the correct syntex of using PACK statement in BTEQ ?.
--How many sessions can i use with PACK in this scenario ?.
----
.set sessions 5;
.PACK 250;
.LOGON xxxxxx/xxxxxxx,xxxxxx;
BT;
Del from db.test_tbal;
Update  (complex join);
Insert stage._hist
select * from stage.source files;
ET;
.LOGOFF;
.Quit;

Speed up imports in BTEQ or SQL Assistant - response (12) by dnoeth

$
0
0

PACK is not the same as SERIALIZE in TPump, it's the same as PACK in TPump, simply defining how many rows are send to the DBMS in one request.
Unless there's an IMPORT both multiple sessions and PACK are useless.
Only removing the BT/ET might improve performance.

FASTLOAD ERROR - forum topic by zeesh49

$
0
0

Dear All,
I am trying to fload a flat file, the file contains 44 columns (44 'Û' delimiters). 
Following is the sample header and data rows (header is removed from the actual file being loaded):

HEADER:

IDÛIC.STMCR.PERIOD.FIRST.DATEÛIC.STMCR.PERIOD.LAST.DATEÛIC.STMCR.CR.INT.DATEÛIC.STMCR.CR.NO.OF.DAYSÛIC.STMCR.CR.VAL.BALANCEÛIC.STMCR.CR.INT.RATEÛIC.STMCR.CR.INT.AMTÛIC.STMCR.CR.INT.CATEGÛIC.STMCR.CR.INT.TR.ACÛIC.STMCR.CR.INT.TR.PLÛIC.STMCR.CR.INT.TAX.CODEÛIC.STMCR.CR.INT.TAX.RATEÛIC.STMCR.CR.INT.TAX.AMTÛIC.STMCR.CR.INT.TAXCATEGÛIC.STMCR.CR.INT.TAXTRSDRÛIC.STMCR.CR.INT.TAXTRSCRÛIC.STMCR.LIQUIDITY.ACCOUNTÛIC.STMCR.COMPENS.ACCOUNTÛIC.STMCR.INT.NO.BOOKINGÛIC.STMCR.TOTAL.INTERESTÛIC.STMCR.TAX.FOR.CUSTOMERÛIC.STMCR.TAX.FOR.BANKÛIC.STMCR.GRAND.TOTALÛIC.STMCR.CORRECTION.NUMBERÛIC.STMCR.LIQUIDITY.CCYÛIC.STMCR.ICA.POST.INTERESTÛIC.STMCR.ICA.MAIN.ACCTÛIC.STMCR.ICA.DIST.TYPEÛIC.STMCR.ICA.DIST.RATIOÛIC.STMCR.ICA.INT.CATEGÛIC.STMCR.ICA.TR.ACÛIC.STMCR.ICA.TR.PLÛIC.STMCR.ICA.MAIN.INTÛIC.STMCR.ICA.SUB.INTÛIC.STMCR.GR.INT.TAX.LCYÛIC.STMCR.NET.INT.TAX.LCYÛIC.STMCR.GR.INT.TAX.FCYÛIC.STMCR.NET.INT.TAX.FCYÛIC.STMCR.CR.MIN.VALUEÛIC.STMCR.CR.MIN.WAIVEÛIC.STMCR.UNADJ.TOTAL.INTÛIC.STMCR.INT.POST.DATEÛIC.STMCR.TAX.EXCH.RATEÛ

DATA ROW:

0002894473-20131231Û20130701Û20131231Û20130701ý20131001ý20131201Û92ý61ý31Û616.94ý13.94ý13.94Û6.00ý6.50ý7.00Û9.33ý0.15ý0.08Û50000Û381Û380Û3Û10.00Û0.96Û17215Û875Û876ÛÛÛÛ9.56Û0.96ÛÛ8.6ÛÛPKRÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ20140101ÛÛ

 

I am getting the following error:

Error on piom GET ROW: 61, Text: Warning, too few columns !ERROR! Delimited Data Parsing error: Too few columns in row 1

 

kindly help.

-Zeeshan

Tags: 
Forums: 

FASTLOAD ERROR - response (1) by dnoeth

$
0
0

Hi Zeeshan,
it's hard to tell without more info.
Did you use VARTEXT and the correct DELIMITER?
Did you DEFINE all fields as VARCHAR?

FASTLOAD ERROR - response (2) by zeesh49

$
0
0

hi Dieter,
yes I used VARTEXT and the correct DELIMITER, also, I defined each field as VARCHAR.
Ive been stuck with this problem for 2 hrs, and I cant find any documentation of the error anywhere. Any help will be highly appreciated. 

Question on Failed TPT Load - forum topic by islanderman

$
0
0

If a TPT load fails and the restart is not working can someone tell me what has to be done to get the load to start over again.  I know that I have to drop the load table and the tables with the extentions _ET and _UV.  I believe there is a lock file placed somewhere, but can someone clarify that?
Also, in my case the log file is defaulting to the ID that is running the script followed by a number that is incrementing.  The number is starting to get large.  Is there a way to reset that?
 
 

Forums: 

FASTLOAD ERROR - response (3) by dnoeth

$
0
0

Hi Zeeshan,
this error indicates there are less fields in your input record than DEFINEd.
Btw, 44 delimiters define 45 columns, but this should not the source of your problem.
 
 

FASTLOAD ERROR - response (4) by krishaneesh

$
0
0
20131201Û 92ý61ý31Û6

from the value after the 4th delimiter is it entered as a new row in the data?

FASTLOAD ERROR - response (5) by zeesh49

$
0
0

@Dieter,
Yes there are actually 45 columns, not 44, so I added one more column to the fastload script, but still the same error. I even removed an extra column to make the total number of columns to be 43, still the same error...
@krishaneesh
No it is not a new row, the row is actually wrapped in this forum's post.

Speed up imports in BTEQ or SQL Assistant - response (13) by gopinadhs

Question on Failed TPT Load - response (1) by feinholz

$
0
0

It depends on the reason for the failure.
Some "failures" can be fixed by the user so that the job can be restarted.
You also do not say which operators you had used in the job.
That information might impact the steps needed to start the job all over again from the beginning.
For the log id, why does it matter if the number is getting large?
Every log file has to have a unique name.
If you start the numbers over again at 0, then unless you have cleaned up the logs, old ones will be overwritten.
 
 

Download TTU v 13.10 - response (1) by eremef

$
0
0

https://tays.teradata.com/ - but you must be a "Teradata customers with an active Services Agreement"

SQL Assistant error? "Submit only the selected query text, when highlighted" not working - forum topic by BkAZ

$
0
0

(version 14.10 of SQL Assistant)
Is there a bug with this option?
Tools, Options, Query: "Submit only the selected query text, when highlighted" 
If I have a line with -- at beginning (standard SQL comment syntax since always) and I highlight ONLY the text following the -- characters, it will not execute ONLY the highlighted text (error is "Query is invalid").
I've seen various forum posts back to 2007 regarding this and certainly thought it would be solved by now... 
Anyone have any experience with this?
BkAZ

Forums: 

*** Warning: RDBMS CRASHED OR SESSIONS RESET. RECOVERY IN PROGRESS. - forum topic by newb1

$
0
0


Your use is subject to the terms and conditions of
            the click through agreement that brought you to this
            screen ("TERADATA EXPRESS") EVALUATION AND DEVELOPMENT
            LICENSE AGREEMENT), including the restriction that this
            evaluation copy is not for production use.
TDExpress14.0.3_Sles10:~ # bteq

 Teradata BTEQ 14.00.00.05 for LINUX.
 Copyright 1984-2012, Teradata Corporation. ALL RIGHTS RESERVED.
 Enter your logon or BTEQ command:
.logon 127.0.0.1/dbc

.logon 127.0.0.1/dbc
Password:

 *** Warning: RDBMS CRASHED OR SESSIONS RESET.  RECOVERY IN PROGRESS.
 *** Warning: Exiting because of three BREAKs!

 *** Exiting BTEQ...
 *** RC (return code) = 2

Hi I get the above message using bteq when loging in. How do I fix?
 
 
 
 

Forums: 

Cannot logon to Teradata Express 14 for Mac - forum topic by slanycia

$
0
0

I'm new to Teradata so I hope someone can help me.
I've just loaded the VM version of Teradata Express 14 on my Mac which was done successfully. I am able to logon on to the Linux session using the user_id of "root" and password of "root". From the desktop I start terminal and attempt to start BTEQ
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your use is subject to the terms and conditions of
        the click through agreement that brought you to this
        screen ("TERADATA EXPRESS") EVALUATION AND DEVELOPMENT
        LICENSE AGREEMENT), including the restriction that this
        evaluation copy is not for production use.

TDExpress14.0.3_Sles10:~ # bteq

 Teradata BTEQ 14.00.00.05 for LINUX.
 Copyright 1984-2012, Teradata Corporation. ALL RIGHTS RESERVED.
 Enter your logon or BTEQ command:
.logon 127.0.0.1/dbc

.logon 127.0.0.1/dbc
Password:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
After entering the user id of "dbc" I am given an option to enter the password, which i do as "dbc". A quick note, as I'm entering the password of "dbc" nothing appears and the cursor continues to flash.
When however I press the <enter> button after entering the password nothing seems to happen and the cursor simply moves down. Pressing the enter button again will, again, move the cursor down another time.
I don't really have experience with LINUX and am unsure if I am doing something stupid here. If you can please help I would be very grateful.
Thanks
 

 

Forums: 

TPT Load Operator Table Lock - response (2) by Santanu84

$
0
0

Hi Steve
Thanks for your reply. I can understand what you are saying.
But I was thinking, if I go for drop and recreate of table every time, this will take Exclusive lock across all amps. If I am in production environment, this does not seem a good option. However, as you have explained it depends on what I am willing to achieve.
Please let me know your response.
Thanks
Santanu

SQL Assistant - History window no available - response (1) by itboater

$
0
0

After SQL Assistant (SQLA) v14.0 is updated, the History from the previous version is not automatically inserted to the SQLA History table created in Version 14.0.  Because of this condition, the following manual work-around can be used, if recovery of the SQLA history is desiredNote:  Your prior SQLA version’s history list has not been lost.  J

  1. Use Windows Explorer to navigate to the directory in which the SQLA History files are located:
    1. This path is/should be [ C:\Users\<UserID>\My Documents\NCR\Queryman ]
      1. Note:  If the two files below are not found in the above path, an alternate path may be:
      2. [ C:\Users\<UserID>\AppData\Roaming\Teradata\SQL Assistant ]
    2. Two SQLA files should be present, which are:
      1. [ queryman.MDB ]   (Old History) and
      2. [ SQLHistory.MDB ] (New/Current History- has been running since the v14.0 upgrade )
    3. Note:  If the extents of files are not observable and you wish to have the extents displayed, go to the appendix of this document, regarding the process to display/hide the extents of files.
  2. Next, begin the setup for importing your Old History into the New/Current History
  3. Verify you are resident in path:  [ C:\Users\<UserID>\My Documents\NCR\Queryman ]
  4. The screen is shown below, as it desirably should appear (contact Quincy Leslie, if it does not)
  5.  
  6. Right click on the Directory window, somewhere below the two .MDB files
  7. Hover over “New” , then slide right and up and click on “Microsoft Access Database”
  8. A new MS Access database should appear with extent “accdb”, as shown below
  9. You may right click on the database/file name and change it, such as to “sqla-transfer.accdb”, etc.
  10.  
  11.  
  12. This new database will be used as a temporary work space.
  13. Open this database (“yourfilename.accdb”) by double-clicking it. 
    1. MS Access is opened and the applications screen below will appear:
  14.  
  15. Links:  The next process will create links to the two History MDB files, which are MS Access tables
  16. Click header tab “External Data”, to obtain screen as per below
  17.  

  18. Click the pink icon labeled “Access”, which brings up the “Get External Data – Access Database” screen
  19. Click the button “Link to the data source by creating a linked table.”
  20. The screen will appear as below:
  21.  
  22. Next link to the two (2) tables, per the files named- See “Create the Links as follows” below:
    1. queryman.MDB   (old history)
    2. SQLHistory.MDB (new/curr history)
    3. Note:  You will not import the databases – just create links.
  23. Create the Links as follows:
    1. Note: linked tables will be noted by a “+” marked before the table name, after linked
  24. Insert the path for the first file name into the “File name:”  field.
    1. Copy this next path inside the brackets and insert this path to “File name:” field
    2.  [ C:\Users\<UserID>\Documents\NCR\Queryman ]
    3.  
  25. Change the <UserID> to your EmplID and click “Browse” and reach the folder Queryman.
  26. Click on file name “queryman.MDB”
  27.  
  28. [ queryman.MDB ] Old History Linking
  29. Single Click on the queryman .MDB file/table (old history) highlighting it, to prepare for linking,
  30. Click on the “Open” button
  31. The “External Data -  Access Data” will pop up again, with the file name appended to the path
  32. See screen shot below.
  33. Ensure that the “Link to…” choice is clicked- see below
  34. Click the “OK” button, which links to the queryman .MDB
  35. The Linked Table panel will appear with “QTHIST” listed (if queryman.MDB was selected)
  36. The link is almost, but not yet, complete
  37. Please scroll further in this document
  38.  
  39. Again, the Link Tables panel will appear with “QTHIST” listed, if queryman.MDB was linked.
  40.  
  41. Left click on the QTHIST item, highlighting it
  42. Click the OK button
  43. The queryman.MDB table/file has now been linked and appears as under Tables (see below)
  44. It is still named QTHIST;
  45. Please rename “QTHIST” to “oldhist”
  46. Rename it by Right-Clicking and selecting “Rename” from the Drop down choices
    1. Type in “oldhist”
  47.  
  48. The renamed table will appear as “oldhist”.

 

  1.  [ SQLHistory.MDB ] / New History Link
  2. To link to the SQLHistory.MDB table/file (New History), repeat the above process
  3. Select SQLHistory.MDB, instead of queryman.MDB
  4. Please ensure that you click on “Link to…” in the “Get External Data – Access Database” panel
  5. Once you have linked to queryman.MDB, please rename to “newhist”
  6. After both tables are linked, the Access App screen should appear as:
  7.  
  8. Review the content of each table
  9. Please review the content of both tables by double clicking on each table.  Specifically, observe the number of rows in the newhist table, as found in the bottom of the screen:
  10. Make a note of the total records in newhist, before later appending the oldhist records.
  11. The appearance will be:
  12. Display “newhist” table
    1. Note1:  usually the newhist row count will usually only be 20-200 rows
    2. note2:  the newhist high count below is because it is after one of my test runs
  13.  
  14.  
  15.  
  16. End newhist display
  17. Display “oldhist” table rows
  18.  
  19.  
  20. End oldhist display
  21. Preparing for Recovery of Old History
  22. Clear both the table row listings: 
    1. Right Click on either table’s tab, oldhist or newhist
    2. Click on “Close All” from the drop down list (or close one at a time, if desired, via “Close”)
    3. Or---
    4. Click “X” in the upper RH corner, once for each Database name, until both are closed.
    5. If you tweaked the listing of either table, such as widening a column, the message below will appear
    6. The safest choice is to click “No”
    7.  
    8. Both table’s row listings will be dropped
  23. Dropping Links and Re-Linking (optional)
  24. If, for whatever reason before recovery, you wish to drop the links and re-link either or both tables:
    1. Do as follows:
    2. Right Click on the table to be de-linked
    3.  
  25. Right click on desired table name, as listed above
  26. Choose “delete” from the drop down choices (about the middle)
  27.  
  28. Click Yes button to de-link. 
  29. Undo De-Link:  If you de-link inadvertently, you can undo that action by either:
    1. Ctrl-Z or press the Undo logo (blue back-circle logo)
    2. The table will return to a linked state
  30. You can always re-link, when desired (see instructions above in document).
  31. Recovery of Old History
  32. Recovery of the old history is run via SQL implemented with MS Access. 
  33. The SQL is below:
  34. Create a new Query and change to SQL view,as follows:
  35. Click on the “Create” tab on the Access header
  36.  
  37. Click on the “Query Design” icon above
  38. The “Show Table” panel will appear (see next page).
  39. Click on the “Close” button on that panel.
  40.  
  41. After “Close” button is pressed, a Header of tabs with a blank query screen will remain, per below:
    1. The MS Access screen will appear, as in the screen shot below:
      1. The tab “Query Tools” will be in a chosen state
      2. The tab “Query1” (in Peach) will have appeared over the blank panel.
      3. The icon SQL View” will be displayed
  42.  
  43.  
  44. Press the “SQL View” logo (upper LH Corner, under “File” tab) icon and cause the SQL term “SELECT;” to appear and be highlighted.  This means that SELECT; is in a state to be edited. 
  45.  
  46. Please become resident or remain resident in the Word Document and “Copy” the following SQL statement, under the “SQL Statement” heading on the next page (Ctrl-C, Copy, etc.) and within/between  the row of equal signs “====….”
    1. (SQL is two pages down)
  47. After you copy the SQL, return to the MS Access screen and insert the SQL via “Right Click” and choose “Paste” from the choices.
  48. If you already inserted some SQL, the following screen will appear.  Note that “SQL View” will have been replaced by the “View” icon.  In that state, you can use Ctrl-V or Right-click, choose Paste to insert the SQL.
  49.  
  50. After the insertion of SQL, the screen should appear as follows:
  51.  

 
 

  1. SQL Statement (to copy and paste)

--=============================
INSERT INTO newhist (
EndDate, Source, Elapsed, RowCnt, ErrCd, Msg, Notes,
[SQL],
StmtCnt, StmtType, SQLType,
[User],
 DBSTime, FetchTime, Seq
 )
SELECT
[RUNDATE]+[RUNTIME] AS Expr4,
oldhist.ODBCDRV,
Format([ELTIME],"hh:nn:ss"".000""") AS Expr5,
oldhist.MAXROWS,
0 AS Expr1,
oldhist.SQLMESSAGE,
oldhist.SQLNOTES,
oldhist.SQLSTRING,
0 AS Expr2,
'' AS Expr3,
oldhist.SQLTYPE,
oldhist.ODBCUSER,
Format([DBMSTIME],"  hh:nn:ss"".000""") AS Expr6,
Format([FETCHTIME],"  hh:nn:ss"".000""") AS Expr7,
[QTCOUNTER]-(SELECT MIN(QTCOUNTER) FROM oldhist )
+1+(SELECT MAX(Seq) FROM oldhist ) AS Expr8 
FROM oldhist;
--=================

  1. Note:  not totally “pretty” formatted, but can just copy as is.
  1. This SQL is utilized “as is”, if you already have entries in the new History file. If your new History file is still empty, remove the text +(SELECT MAX(Seq) FROM oldhist )  from the SQL.
  2. See Perform SQL Run below to execute the Query and the entries from the Old History file will be appended to the New History. You can then delete the Temporary database, after success is verified.

 
Perform SQL Run (about to append old history to new history)
Click on the “! Run” icon as in the screen below .  The “Enter Parameter Value”, “Seq” panel will come up.  Enter the number of records + “1” found in the “newhist” table into the Seq field.  This will cause the Surrogate Sequential number for the records appended to newhist, to start at the current number of records in newhist + “1”.  E.g., if newhist contains 100 records, then the first Sequential number of the records appended will be “101”.
Enter the newhist number of records + 1.  Click OK.  The SQL will run.
 
Validate SQL Run:   The SQL may either run or fail with an error message.  However, if there is no error message, it will not report back when complete.  Wait 5-10 seconds and observe the content of newhist
Verify Content of “newhist” table link:    After running the SQL, open the newhist table and all of both the old and new entries should be present.  The number of records should equal the total of the oldhist records + the newhist records, that existed before running the SQL.
This ends the process to recover the Old History of SQL Assistant, by merging to the current history.
Verify the SQL History under SQL Assistant
If SQL Assistant is open, then close it.  In any event, open/re-open SQL Assistant.  It may require 10-15 seconds, as the updated history is accessed.  Prior to your logging into one of the Teradata servers, the updated history will appear, e.g. as shown below:
 
 
This is the End of Recovering SQL Assistant History Instructions

*** Warning: RDBMS CRASHED OR SESSIONS RESET. RECOVERY IN PROGRESS. - response (1) by Glass

$
0
0

I think you may want to post questions on TD express under Cloud computing.
I re-downloaded the package and changed to VMWARE player. It worked, not sure which change but you could experiment.
 

Viewing all 4252 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>