Solved

Sybase-Load table from a flatfile

Posted on 2012-03-30
4
882 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
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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Alternative to ALTER in Sybase 1 395
Sybase sample database 13 679
SAP HANA use case satisfy OLAP applications only. How true? 7 223
Need help with SYBASE syntax 5 74
Note: This is the third blog post in a series on email clearinghouses (https://www.xmatters.com/alert-management/blog-email-has-failed-us?utm_campaign=70138000000ydLoAAI&utm_source=exex&utm_medium=article&utm_content=blog-post).   We’ve been talki…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 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

17 Experts available now in Live!

Get 1:1 Help Now