INSERT INTO target_table (target_column) SELECT decode(source_column, '?', 98, 'X', NULL, source_column) FROM source_table;
1. This isn't pl/sql, just pure insert statement 2. If datatype of target_column is Number You cannot insert 'Missing info' in this column, use NULLs instead 3. If You don't know what decode does look into docs Gints Plivna IT Sist�mas, Mer�e�a 13, LV1050 R�ga http://www.itsystems.lv/gints/ Roland.Skoldbl [EMAIL PROTECTED] To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]> Sent by: cc: [EMAIL PROTECTED] Subject: Inserts with different conditions in pl/sql om 2001.11.13 10:20 Please respond to ORACLE-L Hallo, How can I write in a pl/sql block if I want to do an insert from one table to another table and at the same time translate the value '?' to 98 and the value 'X' to 'Missing info' Both those values can exist in the first table. The datatyupe in table one is varchar2 and in table two it is numberdatatype. Please help me. Thanks in advance. Roland S -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
