Home » RDBMS Server » Server Utilities » replace "." with ","
icon9.gif  replace "." with "," [message #156588] Thu, 26 January 2006 02:08 Go to next message
Tvojmuc
Messages: 2
Registered: January 2006
Junior Member
Hello Embarassed
I have a problem whit upload data to oracle from access
The problem is that I use next script

‘________________________________________
load data
infile 'DEL_NALOG.dat' "str '<EORD>'"
into table DEL_NALOG
fields terminated by '<EOFD>'
trailing nullcols
(DN CHAR(255),
SIFRA CHAR(255),
PLAN,
DEJANSKO,
ODPRTJE DATE 'mm/dd/yyyy HH24:mi:ss',
KONEC DATE 'mm/dd/yyyy HH24:mi:ss',
UPORABNIK_ODP CHAR(255),
UPORABNIK_ZAK CHAR(255),
PODATEK,
OBRAT,
TIP_IZDELKA,
SERIJA,
SERIJA_ODPIRANJE,
IZDELEK CHAR(255),
AKTIVEN,
PREDVIDEN_KONEC DATE 'mm/dd/yyyy HH24:mi:ss',
ENOTA CHAR(255),
ID)

‘________________________________________

I have problem because in field “dejansko” is data like »100.1« but I must insert in table »100,1«
How could I use replace string, for replace ».« with »,«
Thank
Re: replace "." with "," [message #156596 is a reply to message #156588] Thu, 26 January 2006 03:20 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Modify
DEJANSKO,
to
DEJANSKO "REPLACE( :\"DEJANSKO\" ,'.',',')",


Warning! Untested code, this comes from memory Wink

PS: Moved to the appropriate forum.

MHE

[Updated on: Thu, 26 January 2006 03:20]

Report message to a moderator

Re: replace "." with "," [message #156601 is a reply to message #156588] Thu, 26 January 2006 04:07 Go to previous messageGo to next message
vban2000
Messages: 207
Registered: March 2005
Senior Member
Thanks Maaher, one more things learned today!

I tested my successfully using the following:

LOAD DATA
INFILE *
INTO TABLE dept
APPEND
FIELDS TERMINATED BY ','
TRAILING nullcols
(deptno,
 dname "REPLACE(:dname, '.', ',')"
)
BEGINDATA
50, SALES.pc


when I put \", it does not work.

In addidtion, some I also tried "nested function"
dname "upper(replace(:dname, '.', ','))"


Result
DEPTNO	DNAME	LOC	LAST_UPDATED
50	 SALES,pc		
50	 SALES,PC		



Regards
AnDy
Re: replace "." with "," [message #156604 is a reply to message #156601] Thu, 26 January 2006 04:28 Go to previous messageGo to next message
Tvojmuc
Messages: 2
Registered: January 2006
Junior Member
Thank they work now
I use: "REPLACE(:\DEJANSKO\,'.',',')"
Laughing Laughing
Re: replace "." with "," [message #156608 is a reply to message #156596] Thu, 26 January 2006 04:51 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Just like I told you:
Maaher wrote on Thu, 26 January 2006 10:20

Warning! Untested code, this comes from memory Wink

Laughing
MHE
Previous Topic: import question
Next Topic: export on red hat
Goto Forum:
  


Current Time: Tue Jul 02 03:49:50 CDT 2024