Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

Hello! I am trying to import data into my table using

INPUT INTO

The problem is my decimals is using , as a delimiter, and it expects .. So it won't work!

How can i change this? Search and replace in the input file is not an option!

I am using SQL Anywhere 10

asked 26 Jan '10, 12:06

Erik's gravatar image

Erik
21111
accept rate: 0%

edited 27 Jan '10, 15:37

Volker%20Barth's gravatar image

Volker Barth
40.2k361550822


Erik,

AFAIK formatting numbers is not possible with builtin tools in SA. The main reason is that "formatting" is seen as a client-task and not one for the server. (Though there definitely are reasons to take a different view, methinks.)

There are a few workarounds, cf. the newsgroup sybase.public.sqlanywhere.general.

Just a few threads that might fit:

news://forums.sybase.com:119/1dkft15000qu40c6vf0qbhibackbfcghju@4ax.com

news://forums.sybase.com:119/op.udxdyasyj0bybf@bonw00164.internal.imsglobal.com

(If those links don't work, you might search for decimal in this newsgroup.)

HTH Volker

permanent link

answered 27 Jan '10, 15:32

Volker%20Barth's gravatar image

Volker Barth
40.2k361550822
accept rate: 34%

Erik.

Probably you can pull the date in a staging (temporary) Table. You could read the Field in as a string value.

In as second step you can the push it into the correct destination.

insert into stageTable ...
select CAST( replace(stageTable.StrNumber,',','.') as numeric(12,4) ),.... 
form stageTable

HTH Thomas

permanent link

answered 28 Jan '10, 11:44

Thomas%20Duemesnil's gravatar image

Thomas Dueme...
2.7k293965
accept rate: 17%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×90
×14
×10
×4

question asked: 26 Jan '10, 12:06

question was seen: 4,449 times

last updated: 28 Jan '10, 11:44