Solved

Sybase-Load table from a flatfile

Posted on 2012-03-30
4
910 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

This article explains the fundamentals of industrial networking which ultimately is the backbone network which is providing communications for process devices like robots and other not so interesting stuff.
The recent Petya-like ransomware attack served a big blow to hundreds of banks, corporations and government offices The Acronis blog takes a closer look at this damaging worm to see what’s behind it – and offers up tips on how you can safeguard your…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

615 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