COALESCE in FastLoad Script
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


COALESCE in FastLoad Script Expand / Collapse
Author
Message
Posted 7/29/2008 11:32:50 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 12/1/2008 9:48:36 AM
Posts: 10, Visits: 24
I am trying to load data into a terdata database from a flat file (comma delimeted). The one problem I have encountered is character data. If a value is not supplied in the file, fast loads interprets this to null. However, the columns I am trying to load into do not allow nulls by design. I would rather fast load insert an empty string ("").

I have defined a default value, but that to does not overtake the null since I have to supply the column since some values to exist in the input file. I have also tried using the COASESCE function in the script, but I get an error, "expression not allowed in Fast Load Insert, column RESTRICTACCESS".

Can anyone assist me in a work around for this w/o having to change the column definition to accept null values?

Here is the part of the script using COALESCE.


------------------


VALUES ( :ACCOUNTNUMBER,
:TYPE_ID,
:LASTFMDATE,
:OPENDATE,
:CLOSEDATE,
:BRANCH,
COALESCE(:RESTRICTACCESS, ''),
:REFERENCE,
:WARNINGCODE1,
:WARNINGCODE2,
:WARNINGCODE3,
:WARNINGCODE4,


--------------

Thanks.
ss
Post #12343
Posted 7/29/2008 11:46:30 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: PAC and SFT Members
Last Login: Yesterday @ 6:11:07 PM
Posts: 331, Visits: 533
How about using MultiLoad instead? That would support COALESCE.
Post #12348
Posted 7/30/2008 4:27:22 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 12/1/2008 9:48:36 AM
Posts: 10, Visits: 24
Thanks for the suggestion. I was trying to use FastLoad and didn't know if that was possible.

ss
Post #12381
Posted 8/12/2008 2:22:36 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 12/1/2008 9:48:36 AM
Posts: 10, Visits: 24
Just to close the topic, I had a Teradata class this week and this is not possible in FastLoad. Nor is any other SQL function in this manner (trim, etc.). You must use multiload or BTEQ.
Post #12554
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 1:02am

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.094. 7 queries. Compression Disabled.