Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2002
    Location
    India
    Posts
    40

    Unanswered: How to convert from SQL to PL/SQL, help our for my code..

    Hello

    I have one SQL file with following sql queries.

    Create table @temp1
    (A varchar2(20),
    b varchar2(20),
    c varchar2(20),
    d varchar2(20),
    e varchar2(20),
    f varchar2(20),
    g varchar2(20));

    Create table @temp2 as
    SELECT A,B,C
    From X
    Group by Y,Z,W;


    Create table @temp3 as
    SELECT A,B,C
    From XX
    Group by Y,Z,W;

    Insert into @temp1(
    A,B,C
    Select 'SS',
    B,
    c
    From @temp2 a,
    @temp3 b
    Where a.a = b.a and a.b = a.b;

    Insert into @temp1(
    A,B,C
    Select 'SS1',
    B,
    c
    From Itm;

    Insert into @temp1(
    A,B,C
    Select 'SS2',
    B,
    c
    From YYY;

    Insert into @temp1(
    A,B,C
    Select 'SS3',
    B,
    c
    From ZZZ;

    Finally ...we have the sql statement
    which select all the required data from the some other table and also above created
    temp table 1 (@temp1).....

    Now we want to migrate to PL/SQL ...can any one let me know what is the best/better
    way to migrate, i can use cursors..but how in this....
    Please let me know with some sample code ....for above sample code...

    Thanks in advance...
    Suryadevara

  2. #2
    Join Date
    Apr 2004
    Posts
    246
    Why do you want to migrate? If it ain't broke, don't fix it.
    And... do you want to migrate the create table statements? Why would you need to - once the tables are created, they're created. No need to recreate.

  3. #3
    Join Date
    Jun 2002
    Location
    India
    Posts
    40
    Thx for u r reply...see those tables are deleted once data is fetched to .csv files.

    so is there any other way to use cursors..in loops and update those values
    as we did in temp tables..

    Help me out on this ASAP

    Thanks
    Suryadevara

Posting Permissions

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