Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sybase-Load table from a flatfile

Posted on 2012-03-30
4
Medium Priority
?
922 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 2000 total points
ID: 37790117
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
ID: 37796418
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 2000 total points
ID: 37796474
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
ID: 37814324
Thanks.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Transferring FSMO roles is done when an admin wants to split roles between certain Domain Controllers or the Domain Controller holding the Roles has been forcefully demoted using dcpromo / forceremoval
Ranking ecommerce websites is a vital process. You need to have a strong SEO (Search Engine Optimization) strategy. If you don’t have one, you are losing out on brand impressions, clicks and sales. Check this guide on how to improve website traffic …
Integration Management Part 2
Screencast - Getting to Know the Pipeline
Suggested Courses

877 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