Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Posts
    113

    Unanswered: Transitioning from Sybase to Oracle

    Hello!

    I have a procedure on Sybase that I need to convert to Oracle. How do I do that?

    Here is the procedure:

    IF OBJECT_ID('dbo.proc_update_data') IS NOT NULL
    BEGIN
    DROP PROCEDURE dbo.proc_update_data
    IF OBJECT_ID('dbo.proc_update_data') IS NOT NULL
    PRINT '<<< FAILED DROPPING PROCEDURE dbo.proc_update_data >>>'
    ELSE
    PRINT '<<< DROPPED PROCEDURE dbo.proc_update_data >>>'
    END
    go
    create proc proc_update_data
    as
    declare
    @mess varchar(255),
    @dom int


    select @dom = datepart(day, getdate())

    if (@dom = 3)
    begin
    SELECT @mess = ("Start Move of tans_event_sum to tans_event_sum_hist at " + convert(char(25), getdate(), 109))
    PRINT @mess
    SELECT @mess = ("************************************************ *****")
    PRINT @mess

    insert into tans_event_sum_hist (list_acct_no, market_code, month_no, year_no, event_code, event_counter, new_list_acct_no)
    select list_acct_no, market_code, month_no, year_no, event_code, event_counter, new_list_acct_no
    from tans_event_sum
    end

    truncate table tans_event_sum

    insert into tans_event_sum (list_acct_no, market_code, month_no, year_no, event_code, event_counter)
    select list_acct_no, market_code, month_no, year_no, event_code, event_counter
    from larry_current_month

    SELECT @mess = ("Finish Event_Sum Insert at " + convert(char(25), getdate(), 109))
    PRINT @mess
    SELECT @mess = ("************************************************ *****")
    PRINT @mess

    go
    IF OBJECT_ID('dbo.proc_update_data') IS NOT NULL
    PRINT '<<< CREATED PROCEDURE dbo.proc_update_data >>>'
    ELSE
    PRINT '<<< FAILED CREATING PROCEDURE dbo.proc_update_data >>>'
    go
    EXEC sp_procxmode 'dbo.proc_update_data','unchained'
    go

  2. #2
    Join Date
    Apr 2004
    Posts
    113
    Here is what I came up with so far, however, it is giving me and error at the declare because it is expected a function:

    create procedure proc_update_data
    as
    declare
    @mess varchar(255),
    @dom int


    select @dom = datepart(day, getdate())

    if (@dom = 3)
    begin
    SELECT @mess = ("Start Move of tans_event_sum to tans_event_sum_hist at " + convert(char(25), getdate(),109))
    PRINT @mess
    SELECT @mess = ("************************************************ *****")
    PRINT @mess

    insert into tans_event_sum_hist (list_acct_no, market_code, month_no, year_no, event_code, event_counter, new_list_acct_no)
    select list_acct_no, market_code, month_no, year_no, event_code, event_counter, new_list_acct_no
    from tans_event_sum
    end

    truncate table tans_event_sum

    insert into tans_event_sum (list_acct_no, market_code, month_no, year_no, event_code, event_counter)
    select list_acct_no, market_code, month_no, year_no, event_code, event_counter
    from larry_current_month

    SELECT @mess = ("Finish Event_Sum Insert at " + convert(char(25), getdate(), 109))
    PRINT @mess
    SELECT @mess = ("************************************************ *****")
    PRINT @mess
    /

    EXIT;

  3. #3
    Join Date
    Apr 2004
    Posts
    113

    Bump!!!

    Bump!!!
    Bump!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •