1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Code logic

Discussion in 'SQL PL/SQL' started by krithika@2001, Jun 28, 2009.

  1. krithika@2001

    krithika@2001 Active Member

    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    80
    1 Declare
    2 CURSOR v_sql is
    3 SELECT SYSDATE
    4 FROM DUAL;
    5 Begin
    6 for i in v_sql
    7 loop
    8 null;
    9 end loop;
    0* end;

    Can anybody tell me how to execute this query and explain the logic too plsss


    Regards
    Krithika
     
  2. debasisdas

    debasisdas Active Member

    Messages:
    46
    Likes Received:
    3
    Trophy Points:
    90
    Location:
    Bangalore, India
    There is no logic in that piece of code.

    simply selecting the system date and doing nothing after that.
     
  3. krithika@2001

    krithika@2001 Active Member

    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    80
    how to execute it?
     
  4. rajavu

    rajavu Forum Guru

    Messages:
    815
    Likes Received:
    52
    Trophy Points:
    610
    Location:
    @ Bangalore , India
    As simple as that .. .

    Paste the code inSql prompt and press ENTER
    Code (SQL):

    SQL> DECLARE
      2    CURSOR v_sql IS
      3    SELECT SYSDATE
      4    FROM DUAL;
      5   BEGIN
      6   FOR i IN v_sql
      7   loop
      8    NULL;
      9   END loop;
     10  END;
     11  /

    PL/SQL PROCEDURE successfully completed.

    SQL>