Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2013
    Posts
    3

    Unanswered: Oracle Script help please

    Hi All,

    I am trying to change the following SQL script to run it on Oracle DB. I am not sure about Syntax. Can you someone help me with it please?


    DECLARE @student_id INT
    DECLARE @getid CURSOR
    DECLARE @Student_db_id INT

    SET @Student_db_id = 11
    SET @getid= CURSOR FOR
    SELECT student_id
    FROM student_tbl
    WHERE Student_db_id = @Student_db_id

    OPEN @getid
    FETCH NEXT
    FROM @getid INTO @student_id
    WHILE @@FETCH_STATUS = 0
    BEGIN
    EXEC purge_by_student @student_id, @Student_db_id
    FETCH NEXT
    FROM @getid INTO @student_id
    END

    CLOSE @getid
    DEALLOCATE @getid

    DELETE FROM STUDENT_IMPORT_FAILURE WHERE Student_db_id = @Student_db_id
    DELETE FROM student_tbl WHERE Student_db_id = @Student_db_id

    Thank you in advance.

  2. #2
    Join Date
    Dec 2007
    Posts
    253
    Best possible advice to give is:
    Ignore that code.
    Get the requirements for what is needed.
    Build the code in Oracle fro the requirements.

  3. #3
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713
    Besides, it's incomplete unless you also have the code for "purge_by_student" procedure.

    So just do what pablolee suggest.
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

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