Solved

Sybase-Load table from a flatfile

Posted on 2012-03-30
4
896 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

749 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