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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Cursor Loop How to

Re: Cursor Loop How to

From: Maiko <maiko_at_dds.nl>
Date: Tue, 20 Jul 1999 08:42:32 GMT
Message-ID: <3798362f.12124894@news.cistron.nl>


update Time_Table
set time_stamp = to_char(rownum + to_number(time_stamp)) where Create_Time = '1200000000'

On Mon, 19 Jul 1999 20:38:54 GMT, Paul <paulvon_at_my-deja.com> wrote:

>I have a table that has a time stamp stored as a text field. The
>problem is that I have several hundred that are the same.
>
>I know who to find them.
>SELECT Time_Stamp FROM Time_Table WHERE Create_Time = '1200000000'
>
>How to I find them and then add +1 to each of them progressively so that
>they all the records have a different time stamp.
>
>I do want to see the records that would be changed before I run the
>actual updating statement, so I want to use a select statement.
>
>I have know that the cursor when using a fetch statement needs a select
>into to work. This approach does not let me see what the changes would
>be prior to running the SQL.
>
>I have rights to update records in an existing table, but can't create a
>new table.
>
>Example:
>Original Revised
>1200000000 1200000000
>1200000000 1200000001
>1200000000 1200000002
>1200000000 1200000003
>1200000000 1200000004
>
>Help Me Please.
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
Received on Tue Jul 20 1999 - 03:42:32 CDT

Original text of this message

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