Solved

Sybase-Load table from a flatfile

Posted on 2012-03-30
4
868 Views
Last Modified: 2012-06-27
Hi,

I am trying to load a flat file delimited by ',' into a table. Attached is the error I am getting.
"Cannot convert to numeric". My flat file has it's first row as the header and the data starts from the second row. The first data is 5467 which is numeric. I don't know the cause.
Please help. Thanks.
Sybase-table.JPG
Sybase-error.JPG
0
Comment
Question by:thomaszhwang
  • 2
  • 2
4 Comments
 
LVL 24

Accepted Solution

by:
Joe Woodhouse earned 500 total points
Comment Utility
Can you show us your exact LOAD TABLE command? Are you skipping the first row? IQ doesn't know what a header is and assumes if you tell it to load a file, you mean everything in the file...
0
 

Author Comment

by:thomaszhwang
Comment Utility
Joe,

Here is my load statement,

load table Sales_Report_Due_Date
(SALES_REPORT_DUE_DATE_ID,CONTRACT_KEY,BATCH_JOB_ID,REPORT_RECEIVED,REPORT_VALIDATED,REPORT_PERIOD,REPORT_DUE,REPORT_STATUS,ROW_COUNT,REPORT_PERIOD_ACTUAL,SUBMISSION_NUMBER)
FROM 'C:\sales.txt'
ESCAPES OFF

The first line has headers. But I tried removing that and do an upload but it throws an error "could not convert 5894 to numeric" column:submission number.

My first line in flat file is,

5894,75,,,,200102,2001-03-15 00:00:00,,,,1

Also 5894 should be for the column SALES_REPORT_DUE_DATE_ID. I am not sure why it refers to submission number column at the end. Please help.

Thanks.
0
 
LVL 24

Assisted Solution

by:Joe Woodhouse
Joe Woodhouse earned 500 total points
Comment Utility
You need to specify delimiters for each column. IQ doesn't know where one column ends and the next begins. You're also missing other mandatory elements of the LOAD TABLE command like "QUOTES OFF".
0
 

Author Closing Comment

by:thomaszhwang
Comment Utility
Thanks.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the fileā€¦

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now