Home » SQL & PL/SQL » SQL & PL/SQL » SQL Help
icon7.gif  SQL Help [message #261509] Wed, 22 August 2007 18:59 Go to next message
msapulai
Messages: 3
Registered: August 2007
Location: Papua New Guinea
Junior Member

I have a table called COMPANIES, it has a couple of COLUMNS but the two I want to work with are REGISTRATION_NUMBER, STATUS and CESSATION_DATE

I have a list (2000 companies with registration number)...what I want to do is update the STATUS and CESSATION_DATE of all the companies in the list, they are not in any order.

Is there a script I can use, do not want to run the UPDATE query 2000 times

Please help

monica@ipa.gov.pg

Re: SQL Help [message #261510 is a reply to message #261509] Wed, 22 August 2007 19:05 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
>Is there a script I can use, do not want to run the UPDATE query 2000 times

Any scipt is Operating System dependent & we don't know what your OS is because you did NOT read & FOLLOW the posting guidelines as stated in the STICKY post at top of forum.

2000 updates is not that many.

An alternative would be to access the raw data file as an external table; then you'd be able to complete the task with a single UPDATE statement.
Re: SQL Help - SORRY MORE INFOR [message #261511 is a reply to message #261509] Wed, 22 August 2007 19:08 Go to previous messageGo to next message
msapulai
Messages: 3
Registered: August 2007
Location: Papua New Guinea
Junior Member

Database is Oracle 10g on WIndows and I am using ORACLE SQL*PLUS
Re: SQL Help [message #261512 is a reply to message #261510] Wed, 22 August 2007 19:10 Go to previous messageGo to next message
msapulai
Messages: 3
Registered: August 2007
Location: Papua New Guinea
Junior Member

Thats fine I can create a temporary table with the raw data but need help with the UPDATE statement
Re: SQL Help [message #261513 is a reply to message #261509] Wed, 22 August 2007 19:24 Go to previous message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
You need to provide (using code tags as noted in STICKY) the CUT & PASTE results from below

SQL> DESC Table_2B_UPDATED

&

SQL> DESC RAW_EXTERNAL_TABLE

[Updated on: Wed, 22 August 2007 19:24] by Moderator

Report message to a moderator

Previous Topic: Problem with data (too long query execution)
Next Topic: connect by loop in user data
Goto Forum:
  


Current Time: Thu Dec 08 00:36:43 CST 2016

Total time taken to generate the page: 0.13477 seconds