Home » RDBMS Server » Server Utilities » Reverse string in SQL loader?
Reverse string in SQL loader? [message #71802] Wed, 15 January 2003 12:43 Go to next message
Ofer
Messages: 2
Registered: January 2003
Junior Member
Hi.
What is the Syntax (if there is an option at all)
to put the values in reverse order with the SQL loader

for example..
1000}abc}

will look in database:
1000}cba}

(after using sqlloader

load data
replace
into table XXXXX fields terminated by "}"
trailing nullcols
(num,
data char,)

how do i make 'data' to be inserted in reverse order?
thanks!
Re: Reverse string in SQL loader? [message #71803 is a reply to message #71802] Wed, 15 January 2003 13:01 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
C:>type test.ctl
LOAD DATA
INFILE 'test.dat'
replace
into  table test446 FIELDS TERMINATED BY ',' optionally enclosed by '"'
(
id,
name char "reverse(:name)"
)

----------------------------------------------------------------------

C:>type test.dat
1,"magvive"
2,"someone"
3,"nobody"

----------------------------------------------------------------------

C:>sqlldr userid=mag/mag control=test.ctl

----------------------------------------------------------------------

SQL*Loader: Release 8.1.6.0.0 - Production on Wed Jan 15 14:47:35 2003

(c) Copyright 1999 Oracle Corporation.  All rights reserved.

Commit point reached - logical record count 2
Commit point reached - logical record count 3

----------------------------------------------------------------------

C:>sqlplus mag/mag

SQL*Plus: Release 8.1.6.0.0 - Production on Wed Jan 15 14:47:43 2003

(c) Copyright 1999 Oracle Corporation.  All rights reserved.

Connected to:
Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production

SQL> select * from test446;

        ID NAME
---------- ----------
         3 ydobon
         1 evivgam
         2 enoemos

SQL>

Re: Reverse string in SQL loader? [message #71814 is a reply to message #71803] Wed, 15 January 2003 15:10 Go to previous message
Ofer
Messages: 2
Registered: January 2003
Junior Member
Thanks alot!!! :)
Previous Topic: trigger
Next Topic: IMP utility has a bug? when CONSTRAINTS = N
Goto Forum:
  


Current Time: Mon May 13 23:05:01 CDT 2024