All Forums Tools
pkdash83 2 posts Joined 07/14
25 Jul 2014
Issues with loading date field using BTEQ script

Hi Guys,
I'm pretty new to BTEQ script. I was trying to load a table which has a date column but it's not being inserted properly.
I'm using the below code, this loads the data but the date column loads a s a float and not as a date field.
I've tried changing the date field to varchar and date format both in the script and table but it doesn't load it.
Can anyone tell me where I'm doing wrong?
--For creating table--
DROP TABLE play_pen.Stock_Clearance; 
CREATE MULTISET  TABLE play_pen.Stock_Clearance ,NO FALLBACK , 
      Retail_outlet_number VARCHAR(4), 
      Base_Product_Number VARCHAR(8), 
      Launch_Date FLOAT, 
      Event  VARCHAR(9)    
---BTEQ Script---
.IMPORT VARTEXT ',' FILE = 'D:\Displaced_Lines.txt'
.REPEAT * PACK 5000;
RETAIL_OUTLET_NUMBER   (varchar(4)),
EVENT (varCHAR(9))
INSERT INTO play_pen.Stock_Clearance

(              RETAIL_OUTLET_NUMBER ,
                BASE_PRODUCT_NUMBER ,
                LAUNCH_DATE ,
                :LAUNCH_DATE ,

dnoeth 4628 posts Joined 11/04
25 Jul 2014

- when you define VARTEXT all fields must be defined as VARCHAR in USING
- a FLOAT is a FLOAT and not a DATE


You must sign in to leave a comment.