Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Modify data from select before insert.

RE: Modify data from select before insert.

From: Justin Cave <justin_at_askddbc.com>
Date: Thu, 19 Aug 2004 13:21:56 -0600
Message-Id: <20040819192409.F20E072C0F6@turing.freelists.org>

 

If you are just doing basic string processing, INSTR and SUBSTR will probably be what's needed. For example

INSERT INTO table1( col1 )
  SELECT SUBSTR(col1, 1, 2) || '-' || SUBSTR(col1, 3)     FROM table2

Will add a dash as the third character of col1.

Justin Cave
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC

-----Original Message-----

From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Lyndon Tiu
Sent: Thursday, August 19, 2004 1:16 PM
To: oracle-l_at_freelists.org
Subject: Modify data from select before insert.

Hello guys,

I could use a few tips here.

I have a sql statement:

insert into table1
(
col1
)
select col1 from tabl2;

Problem is, I need to modify the data in the column from table2 first before inserting to table1. Like add a dash, after the third character ... chnage all A's to B's sort of thing.

Can you guys give me a few hints and perhaps a few keywords I can use to search google for?

Thank you very much.

--

Lyndon Tiu



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html


Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
Received on Thu Aug 19 2004 - 14:21:01 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US