Teradata Utilities – FASTLOAD part 3

A sample Fastload script



Below is the sample Fastload script which is designed to work in WINDOWS OS. To run the Fastload in your system you need to install Fastload utility and then go to command prompt and type –

>fastload < c:\fload_1.txt

where c:\fload_1.txt is the name and path of the Fastload which you want to execute.

A sample Fastload script


/***** Section 1 *****/

/* In this section we give the LOGIN credentials which is required to connect to TD system. Sessions command is used to restrict the number of sessions Fastload will make to connect to TD. Default is one session per AMP. */

.SESSIONS 4;

.LOGON 127.0.0.1/tduser,tduser;

/***** Section 2 *****/

/* In this section we are defining the table which we want to load from Fastload. DROP commands are optional. There is no need to define the structure of ERROR tables they’ll be created itself by Fastload. */

drop table retail.emp_test;
drop table retail.emp_test_er1;
drop table retail.emp_test_er2;

create table retail.emp_test
(
emp_id integer not null,
emp_name varchar(50),
dept_id integer,
salary integer,
dob date format’yyyy-mm-dd’

)
unique primary index(emp_id);
/***** Section 3 *****/


/* In this section we give the BEGIN loading statement. As soon as Fastload receives this statement it starts PHASE 1. */

BEGIN LOADING
retail.emp_test
ERRORFILES
retail.emp_test_er1, retail.emp_test_er2;
/***** Section 4 *****/

/*RECORD command is used to skip the starting rows from the data file. RECORD THRU command is used to skip the last rows of data file. SET RECORD command is used to define the records layout and the “,” is the delimiter which we are using in our data file to separate columns. */ 

.RECORD 1;

.RECORD THRU 3;

SET RECORD VARTEXT “,”;
/***** Section 5 *****/

/* DEFINE statement is used to define the structure of the data file. This should be in accordance with the actual target table structure. Fastload DEFINE statement allows only VARCHAR format. */

DEFINE
emp_id        (VARCHAR(9))
emp_name (VARCHAR(50))
dept_id        (VARCHAR(9))
salary           (VARCHAR(9))
dob               (VARHAR(50))

/***** Section 6 *****/

/* FILE command defines the data file path and name. */

FILE = C:\fload_data.txt;

/***** Section 7 *****/

/* INSERT command is used to load the data file into actual target table. NOTE – For DATE columns we can use the data conversion by the syntax given below. */

INSERT INTO retail.emp_test

(
:emp_id ,
:emp_name,
:dept_id ,
:salary,
:dob (format ‘yyyy-mm-dd’)

);

/***** Section 8 *****/

/* END LOADING ends PHASE 1 and starts the execution of PHASE 2. LOGOFF is required to close all the sessions created by Fastload. */

END LOADING;

.LOGOFF;


This is the simplest Fastload script which can be used to understand the concepts of Fastload.  Besides the commands given here there are also some other commands as well, which you can see in next post.

Based on the requirements we can always tweak the Fastload.

To know more about Fastload check below mentioned links –

Fastload Part 1

Fastload Part 2

Fastload Part 4

 

105 comments

1 ping

Skip to comment form

  1. Regards. Terrific information.

  2. Truly tons of valuable tips!

  3. Amazing plenty of helpful material!

  4. Fantastic facts. Cheers!

  5. Seriously loads of beneficial material.

  6. Nicely put. Thanks a lot!

  7. Nicely put, Appreciate it.

  8. Amazing write ups Thanks.

  9. You explained it really well.

  10. Useful information, Appreciate it!

  11. Cheers! I value this!

  12. You’ve made the point.

  13. Nicely put, Regards!

  14. Good forum posts. Cheers!

  15. Thank you, Quite a lot of tips!

  16. Superb facts, Appreciate it!

  17. You revealed that fantastically!

  18. Regards, A good amount of material!

  19. Regards. I value this!

  20. Awesome forum posts, With thanks!

  21. Many thanks, A good amount of write ups!

  22. Really loads of awesome info!

  23. Kudos, I enjoy this!

  24. Thank you, I value this.

  25. With thanks. Quite a lot of forum posts.

  26. Thanks! Fantastic stuff.

  27. Useful facts Regards!

  28. You have made your stand quite well!!

  29. Beneficial advice Regards.

  30. Fantastic postings, Thanks.

  31. You explained this really well!

  32. Many thanks! Good information.

  33. Kudos. An abundance of write ups!

  34. Regards. An abundance of data!

  35. Point certainly used!.

  36. You suggested this terrifically!

  37. Thanks, Quite a lot of information.

  38. Fantastic information Thank you.

  39. Cheers! Numerous data!

  40. Nicely put, Thank you.

  41. Information well used!.

  42. Lovely content, With thanks.

  43. Nicely put. Appreciate it.

  44. Thanks, I like this!

  45. Nicely put, Thank you.

  46. Nicely put. Thank you.

  47. Perfectly spoken genuinely. !

  48. Nicely put, Many thanks.

  49. Really all kinds of awesome data.

  50. Good data, Thanks a lot.

  51. You actually suggested it perfectly!

  52. Nicely put, Appreciate it!

  53. Cheers! A good amount of facts!

  54. Helpful material Cheers.

  55. Great content Thanks a lot.

  56. You actually said this well!

  57. Good tips Kudos!

  58. This is nicely expressed. .

  59. You’ve made your point.

  60. You stated that really well!

  61. Thank you! Plenty of write ups.

  62. Thanks a lot. An abundance of posts.

  63. Regards. Wonderful information!

  64. Thank you! Ample postings.

  65. Beneficial write ups Cheers.

  66. Superb posts. Many thanks.

  67. You’ve made the point.

  68. Thanks! Quite a lot of forum posts!

  69. Awesome material, Cheers.

  70. With thanks. I appreciate this!

  71. With thanks, A good amount of facts.

  72. You definitely made the point!

  73. Whoa loads of excellent knowledge.

  74. Truly a good deal of amazing knowledge.

  75. This is nicely said. !

  76. With thanks, I enjoy this.

  77. Nicely put, Cheers.

  78. Point well applied..

  79. Thanks a lot, A good amount of facts!

  80. You made your position pretty well..

  81. Thank you! Good stuff.

  82. This is nicely expressed. !

  83. Many thanks, I appreciate this.

  84. Amazing material, Many thanks.

  85. Wonderful data Regards!

  86. Hello! This is kind of off topic but I need some guidance from an established
    blog. Is it hard to set up your own blog? I’m not
    very techincal but I can figure things out pretty quick.
    I’m thinking about setting up my own but I’m not sure where to start.
    Do you have any ideas or suggestions? Appreciate it

  87. Have you ever thought about adding a little
    bit more than just your articles? I mean, what you say is fundamental and all.
    But think about if you added some great images or video clips
    to give your posts more, “pop”! Your content is excellent but with
    pics and video clips, this blog could certainly be one of the most beneficial in its niche.
    Fantastic blog!

  88. hey there and thank you for your info – I’ve certainly picked up something new from right here.
    I did however expertise a few technical points using this web site,
    as I experienced to reload the web site lots of times previous to
    I could get it to load correctly. I had been wondering if your hosting is OK?
    Not that I’m complaining, but sluggish loading instances times
    will often affect your placement in google and can damage your high-quality score if ads
    and marketing with Adwords. Anyway I’m adding this RSS to my e-mail and can look out for much
    more of your respective interesting content. Make sure you update
    this again soon.

  89. With havin so much content do you ever run into any issues of plagorism or copyright violation? My site has a lot of completely unique content I’ve either authored myself
    or outsourced but it looks like a lot of it is popping it up all over the
    web without my authorization. Do you know any ways to help protect against content from being ripped off?
    I’d certainly appreciate it.

  90. Amazing things here. I am very glad to see your article.

    Thanks a lot and I’m having a look ahead to touch you.
    Will you please drop me a mail?

  91. Hi there, I enjoy reading through your post.
    I like to write a little comment to support you.

  92. Hi there colleagues, how is the whole thing, and what you want to say about this article, in my view its genuinely awesome designed for me.

  93. There’s definately a lot to learn about this issue. I really
    like all of the points you’ve made.

  94. Yo, tai188bet looks promising. They’ve got a solid selection of games and the site’s not clunky like others I’ve tried. Worth a look if you’re into online betting. Check out tai188bet and let me know what you think!

  95. Heads up, poker fans. Heard about 97pkrgame and checked out their site 97pkrgame.info. Seems like it might be fun. Give 97pkrgame a go!

  96. Been playing on winph444 for a little while now. It’s alright, got a decent variety. Could be better, could be worse. Check it out and make your own judgement: winph444.

    • Manikanta on April 7, 2015 at 3:03 pm
    • Reply

    Hi Admin,

    Thank you very much Fastload four parts are awesome
    I have follow only those four parts my total doubts on fastload has been clarified.
    Once again thank you for your lovely posts.keep it up admin.

    • satish on January 8, 2015 at 12:37 pm
    • Reply

    Hi ,

    Can any one send sample script to load multiple file to load single empty table using fast load.
    please test the script first and send reply.

    • priyabrat on June 17, 2013 at 9:25 am
    • Reply

    Hi Admin,
    Why do we need to use RECORD and RECORD THRU , why do we need to skip the first and last rows of the data files by using these two commands.

    Regards,
    Priyabrat

      • Prasanna on March 21, 2014 at 2:03 pm
      • Reply

      Hi

      since the first record will come along with column name, we will skip the first record

    • Shari Vigil on June 11, 2013 at 11:46 pm
    • Reply

    We use FASTLOAD in JCL with NOSPIE option, what does this do? Why is it needed?

    Thanks!

      • vg on July 27, 2013 at 4:21 am
      • Reply

      Hi Shari,

      NOSPIE parm in JCL used with FASTLOAD in order to write SYSDUMP messages in case of job failures. This parm was mandate till TD 13.0 version. TD 13.10 version on wards we do not need NOSPIE parm in our JCL.

  1. […] Post From Teradata – Google Blog Search: A sample Fastload script. Below is the sample Fastload script which is designed to work in […]

Leave a Reply to AKC Pembroke Welsh Corgi puppies for sale in Indiana Cancel reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.