Thursday, 11 July 2013

The PL/SQL Engine

Oracle uses a PL/SQL engine to processes the PL/SQL statements. A PL/SQL code can be stored in the client system (client-side) or in the database (server-side).

2 comments :


  1. Marhaba,


    Fully agree on Ap Runa Mafi List 3 . We’re seeing a lot of projects tackle big complex problems but few seem to have taken into consideration and in particular reasons to adopt.


    I want to execute the different files at the run time in the SQL PLUS

    Ex: I have two different files like ABC.SQL, XYZ.SQL,

    I had declared one bind variable to hold file_name .

    var file_name VARCHAR2(200);
    DECLARE
    sr VARCHAR2(20) :='ABC';
    BEGIN
    IF sr ='ABC' THEN
    :file_name :='ABC.SQL';
    ELSE
    :file_name :='XYZ.SQL';
    END IF;
    END;
    /
    PRINT file_name


    Now i want to execute the file which is there in :file_name bind variable

    SQL>@:file_name



    It was cool to see your article pop up in my google search for the process yesterday. Great Guide.
    Keep up the good work!


    Obrigado,

    ReplyDelete
  2. Hello There,

    11/10!! Your blog is such a complete read. I like your approach with The PL/SQL Engine . Clearly, you wrote it to make learning a cake walk for me.

    there are TWO tables as below
    USER_DATA_B
    1>USER_ID
    2>CUST_ID
    3>CREATE_DT
    4>LOG_ID

    USER_LOGON_ID_CHANGE_B
    1> ID
    2>USER_ID
    3>NEW_LOGON_ID
    4>OLD_LOGON_ID
    5>OLD_CREATE_DT
    6>ROW_CREATE_DT

    the existing query to show the details in UI is as below

    SELECT USER_ID,OLD_CREATE_DT,ROW_CREATE_DT FROM USER_LOGON_ID_CHANGE_B WHERE OLD_LOGON_ID=?
    AND NEW_LOGON_ID IS NULL
    UNION
    SELECT USER_ID,CREATE_DT,NULL FROM USER_DATA_B WHERE LOG_ID=?
    ORDER BY OLD_CREATE_DT

    Now, my requirement is to join the above query with the following table
    CUSTOMER_ATTRIBUTE_B
    1>CUST_ID
    2> ATTRIBUTE_TYPE_CD
    3>ATTRIBUTE_DATA

    The new query output should be below
    1>USER_ID
    2>OLD_CREATE_DT,
    3>ROW_CREATE_DT
    4> ATTRIBUTE_TYPE_CD
    5>ATTRIBUTE_DATA

    Great effort, I wish I saw it earlier. Would have saved my day :)

    Thank you,
    Preethi.

    ReplyDelete