SQL/ PLSQL CODE

Hi Mohan
Could you send that Oracle(SQL& PL/SQL) coding standard PDF file to my email please:
[email protected]
thanks,
Suresh

Isn't school work marvelous?
Create an external table.
http://www.morganslibrary.org/reference/externaltab.html
Getting the data into a temporary table may make sense in SQL Server ... but not in Oracle.

Similar Messages

  • Hide or encrypt password in SQL/PLSQL code

    Hi,
    I need some help or suggestions to hide or encrypt database user password in SQL/PLSQL code. In our environment, we use a connect string with username/password for the JDBC connection. Our goal is to take out the password string and read it or pass it to the code on the fly.
    Thanks,
    Subroto

    So in the database somewhere you are storing username and password credentials? How do those credentials get sent to the Java application? Presumably, the Java application has to connect to the database, requiring a JDBC connection string, in order to query the table in order to get the username and password you've stored in the database.
    Assuming there are two different JDBC connection strings-- one in the Java application that connects to the database and a second that is stored in the database and used later by the Java application, who do you want to protect the data from? Do you want to protect it from other database users? Or do you want to protect it from the Java developers? Or something else?
    Justin

  • Sql/Plsql code to store data into a temporary table from a text file

    Dear all,
    I need to create a temporary table getting data from a text file. I am very new to data loading could you please help me how to read the text file in to a temporary table.
    i have text file like as below:
    order* items : books Purchasing
    start date:
    8-11-09
    Notes: Books are selling from aug10 to aug 25
    Action performed*
    Time*
    Verified By*
    sold* out from shop, sold out date:_________
    +1.+
    physics _______ book sold to ravi
    +2.+
    social _______ book this is a good book
    sold to kiran
    aug10th
    ronald
    +3.+
    maths book to sal
    +4.+
    english book__________ this was a newbook
    to raj
    jak
    return* to shop, return date:____________
    +1.+
    maths book return by:_____________ Verify book
    aug11th
    john
    +2.+
    story book by:_________ checked
    aug14th
    Now i need to create a temporary table with 5columns(order,Status,Action_Performed,Time,Verified_By) like as below:
    Now i need to create a temporary table named as books_order with 5columns(order,Status,Action_Performed,Time,Verified_By) like as below:
    Order               status     Action_Performed                         Time               Verified_By
    books Purchasing     sold          physics _______ book sold to ravi               _______          _________
    books Purchasing     sold          social _______ book this is a good book sold to kiran aug10th               ronald
    books Purchasing sold          maths book to sal                         _____               __________
    books Purchasing     sold          english book__________ this was a newbook to raj __________          jak
    books Purchasing return     maths book return by:_____________ Verify book      aug11th               john
    books Purchasing     return     story book by:_________ checked                aug14th               _________
    Thanks in advance.

    Hi,
    Thanks for your suggestions. I Was able to get the data using utl_file.get_line. But i was not able to the data if it is in the below format:
    I was able to read the data and storing if it is in the same line.But i dont know how to read below data
    Book. Type Name Location Ownership Code
    Story SL hyd SS-HYD
    In this data i have to search for 'Book. type' and then i need to save the word 'Story' to the column 'Book_type'
    Then i need to search for 'Name' and i need to save 'SL' into the column into 'Name'
    Then i need to search for 'Location' and i need to save 'hyd' into the column into 'Location'
    I was able to extract the data if it is in below format using utl_file.get_line
    Known Author: Unknown
    Less Selling Factors: Thunderstorms
    Reason: Unknown
    Any one can explain me how to solve the above criteria.
    Below i am explaining the same problem in detail.
    I have a text file as below and i have a table having 12 columns. Now i need to insert this text file into the table story_books.
    CREATE TABLE story_books
    book_id NUMBER,
    Category VARCHAR2(100 BYTE),
    Book_type VARCHAR2(100 BYTE),
    Name VARCHAR2(700 BYTE),
    Location VARCHAR2(700 BYTE),
    Ownership_code VARCHAR2(700 BYTE),
    Author VARCHAR2(700 BYTE),
    Less_Sel_fact VARCHAR2(700 BYTE),
    Reason VARCHAR2(700 BYTE),
    Buying VARCHAR2(700 BYTE),
    Suspected Book VARCHAR2(700 BYTE),
    Conditions VARCHAR2(700 BYTE)
    -------------------------text file---------------
    Books Out Table: Books
    Book. Type Name Location Ownership Code
    Story SL hyd SS-HYD
    Known Author: Unknown
    Less Selling Factors: Thunderstorms
    Reason: Unknown
    Buying (if applicable):
    Not Applicable
    Suspected Book:
    Unknown
    Conditions to increace sales:
    Advertisement in all areas
    i was able to read the data and storing if it is in the same line.But i dont know how to read below data
    Book. Type Name Location Ownership Code
    Story SL hyd SS-HYD
    In this data i have to search for 'Book. type' and then i need to save the word 'Story' to the column 'Book_type'
    Then i need to search for 'Name' and i need to save 'SL' into the column into 'Name'
    Then i need to search for 'Location' and i need to save 'hyd' into the column into 'Location'
    I was able to extract the data if it is in below format using utl_file.get_line
    Known Author: Unknown
    Less Selling Factors: Thunderstorms
    Reason: Unknown
    Any one can explain me how to solve the above criteria.
    Thanks in advance.

  • Sql/Plsql code to export data into a temporary table from a text file

    Dear all,
    I need to create a temporary table getting data from a text file. I am very new to data loading could you please help me how to read the text file in to a temporary table.
    i have text file like as below:
    order items : books Purchasing
    start date:
    8-11-09
    Notes: Books are selling from aug10 to aug 25
    Action performed
    Time
    Verified By
    sold out from shop, sold out date:_________
    1.
    physics _______ book sold to ravi
    2.
    social _______ book this is a good book
    sold to kiran
    aug10th
    ronald
    3.
    maths book to sal
    4.
    english book__________ this was a newbook
    to raj
    jak
    return to shop, return date:____________
    1.
    maths book return by:_____________ Verify book
    aug11th
    john
    2.
    story book by:_________ checked
    aug14th
    Now i need to create a temporary table and insert the data into the table from this text file.
    Now i need to create a temporary table named as books_order with 5columns(order,Status,Action_Performed,Time,Verified_By) like as below:
    Order     status     Action_Performed     Time     Verified_By
    books Purchasing     sold     physics _______ book sold to ravi     _______     _________
    books Purchasing     sold     social _______ book this is a good book sold to kiran aug10th     ronald
    books Purchasing sold     maths book to sal     _____     __________
    books Purchasing     sold     english book__________ this was a newbook to raj __________     jak
    books Purchasing return     maths book return by:_____________ Verify book aug11th     john
    books Purchasing     return     story book by:_________ checked aug14th     _________
    Thanks in advance.

    Isn't school work marvelous?
    Create an external table.
    http://www.morganslibrary.org/reference/externaltab.html
    Getting the data into a temporary table may make sense in SQL Server ... but not in Oracle.

  • To automate the SQL scripts using PLSQL Code

    Hi All,
    I have 20 database server (11.2.0.3) hosted on  unix and Windows platforms.
    Every day I have to kill inactive sessions from all the these 20 database servers. So I have made a below script::
    connect sys/&&sys_password@&&tns_database_name as sysdba
    SPOOL E:\DELETE_INACTIVE_SESSIONS.SQL
    set PAGESIZE 1000
    set LIN 5000
    SET ECHO OFF;
    SET FEEDBACK OFF;
    SET HEADING OFF;
    select 'alter system kill session '||'`'||SID||','||SERIAL#||'`'||' immediate;'  from v$session where status='INACTIVE' and username in ('OSS_DICTIONARY','ADMINISTRATOR');
    SPOOL OFF;
    @@E:\DELETE_INACTIVE_SESSIONS.SQL
    Is there any way so that this execution of script can be automated in PLSQL code for 20 servers so and that code could be put in batch file for execution(i.e. can be execute through batch file from my windows laptop).
    Thanks

    Shrma wrote:
    Is there no way to handle the sql scripts in PLSQL code?
    Well, remember that PL/SQL is executed on a specific server by a certain user so you are already connected when executing a PL/SQL code.
    You could actually use a SQL Plus script to connect to different servers using connect and run your script.
    i.e.:
    SQL> connect sys/pwd_server1@db_server1
    SQL> @killinactive.sql
    SQL> connect sys/pwd_server2@db_server2
    SQL> @killinactive.sql
    But it does not make so much difference with my previous solution.
    Please explain exactly what you would like to do.
    Regards.
    Al

  • Need advise on SQL,plsql developer career and future

    Hi all,
    I need all your advise in making an important decisions of my career path.I work in the IT field and have about total 4-5 years of work experience involving development and testing in a product based organization.
    Presently-i have got chance since last 4-5 months to work with writing PLSQL code,SQL etc on a part basis. I am very much interested to continue my career path as a PLSQL developer.
    But, unfortunately -in the total of my work experience-in the past 2-3 years-i worked with a internally developed DB query language(similar to SQL) and then from last few months with plsql. But this chance to work with PLSQL has been for less time and limited scope after which i will have to work on something different.
    Ii want to fully take on my career in SQL,PLSQL as Database Developer.
    Please advise me if my thinking seems logical and good and if I could do it. I have planned on applying for relevant SQL,PLSQL profile jobs.
    Now, My serious worry and concern is I feel that since i have worked very less with PLSQL-so am low in confidence that I feel i wont be able to answer ,or tell or not knowledgeable enough to be able to clear the technical interviews for SQL,plsql development profile which would need at least some years of experience.
    I have started studying and practsing PLSQL,sql by myself for from internet. So, can you all please advise me on how could i prepare myself for hard core technical interviews of SQL,PLSQL knowledge for about 2-3 years expertise.
    I know its not much possible to be competent so much in the subject by just studying and practicing.Its easy as saying to study and get it by myself-but i want to try and will put my best for it.
    Please help me with your inputs,all interview questions,hard ones-suggestions,links,any study materials, real time problems which i can try solving of SQL, PLSQL development.
    Thanks All

    Hi,
    A very good starting point is (in my opinion): [Steven Feuerstein PL/SQL Obsession|http://www.toadworld.com/Knowledge/DatabaseKnowledge/StevenFeuersteinsPLSQLObsession/tabid/153/Default.aspx]. Also the official site [PL/SQL Technology Center|http://www.oracle.com/technology/tech/pl_sql/index.html]
    Regards,

  • How to write a file in unix server through oracle plsql code

    Hi All,
    My requirement is to create and write a file (any file for eg txt file) in unix box with in a specified directory through oracle plsql code.
    Oracle sits in windows server.
    using utl_file package we can create directory where oracle resides and write it there in oracle server in our case windows..
    But here we need to create,write a file but in unix server which is different server than where the oracle server resides..
    we are using Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    Can any one one please help me out in this issue...
    Thanks in Advance.
    Prakash

    Mr Prakash,
    Why are you asking this question multiple times in every forum you can spell?
    Valid responses have been presented to you already two times.
    Can you explain why you can't follow them up, but continue to abuse this forum by repeating doc questions?
    Sybrand Bakker
    Senior Oracle DBA

  • NLS issue in Java/PLSQL code [ using ROWID]

    I have NLS related question regarding the following scenario in Java/PLSQL code ::-
    OracleResultSet ors = (OracleResultSet) stmt.executeQuery("select rowId from t where t.col = 'XX'");
    // The above query could return multiple rowIds.
    String strVal1 = null;
    String strVal2 = null;
    if(ors.next())
    strVal1 = ors.getROWID(1).stringValue();
    if(ors.next())
    strVal2 = ors.getROWID(1).stringValue();
    ArrayList strList = new ArrayList();
    strList.add(strVal1);
    strList.add(strVal2);
    Now I need to pass a list of rowId's from Java to PLSQL function f().
    oracle.sql.ARRAY rowListArr = convertArrayListToRowPointerList(strList, conn) ;
    OracleCallableStatement cstmt = (OracleCallableStatement)
    cstmt.prepareCall("begin f(?); end;");
    cstmt.setObject(1, rowListArr);
    cstmt.execute();
    where:-
    static oracle.sql.ARRAY convertArrayListToRowPointerList(ArrayList arr, Connection conn)
    throws SQLException {
    oracle.sql.ArrayDescriptor stDesc = ArrayDescriptor.createDescriptor
    ("DBUSER.ROWPOINTERLIST", conn);
    oracle.sql.Datum[] keyVals= new oracle.sql.Datum[arr.size()];
    for(int i = 0; i < arr.size(); i++) {
    keyVals[i] = new oracle.sql.CHAR((String) arr.get(i),
    oracle.sql.CHAR.DEFAULT_CHARSET);
    oracle.sql.ARRAY keyArr = new oracle.sql.ARRAY(stDesc, conn, keyVals);
    return keyArr;
    and
    create or replace type DBUSER.ROWPOINTERLIST as table of varchar2(4000);
    Will there be NLS issues in the above code, where I pass the rowId content
    that I obtain from one query, as array of string bind variables to a subsequent PLSQL procedure? --- first approach
    Or
    do I need to pass the rowId list , as a array of oracle.sql.ROWID via bind variables? -- second approach
    The problem I have in second approach is that in the DB we cannot define a type as a table of ROWID's. So currently I have RowPointerList as a table of varchar2's (note the length of list of rowId is not predetermined in my case, so I user table instead of varray).
    However I was wondering if the first approach will have any NLS issues.
    Will appreciate your comments.
    Thanks

    ROWIDs are represented as either hex-encoded values or base64 encoded values. Both encodings use pure ASCII, so there should be no NLS issues.
    I am not very familiar with the oracle.sql.ARRAY type, but unless absolutely necessary, I would avoid the oracle.sql.CHAR datatype (assuming 10g drivers). Using java.lang.String is preferred.
    -- Sergiusz

  • How to call jsp in PLSQL code (to upload a file in IFS)

    Hello,
    We develop our PORTAL (9.0.2) with PL/SQL way.
    We want to make a form to upload file in IFS.
    We create a form like that :
    htp.formOpen(cmethod =>'post',
         cenctype => 'multipart/form-data',
         curl => '/pls/ptlcollab/ptlcollab.GestionDoc_screenbuilder.manipTableIFS',
         cattributes => 'name="ifs"') ;
    htp.TableData(htf.FORMFILE(cname=>'file', cattributes => 'size="25"')) ;
    The manipTableIFS procedure calls a loaded java procedure which called a servlet which work with IFS.
    BUT, modplsql seems to want we directly upload the doc in a table but we want to upload the doc in iFS !!!
    So, the solutiuon seems to call a jsp (or a servlet directly from our plsql code).
    BUT, how could I do that ???
    Any help would be greatly appreciated.
    Regards.
    Luc.

    Something along these lines ought to do what you want:
    <html>
    <body>
    <form name='foobar' action='foobar.jsp'>
    <script language='Javascript'>
    function askim() {
      if (confirm('Is you sure?')) {
        document.foobar.submit();
      } else return false;
    </script>
    <input type='button' value='Submit' onClick='askim()'>
    </form>
    </body>
    </html>
    Your mileage may vary.
    But the idea here is that the Javascript merely submits the form if the user clicks "OK" on the confirmation pop-up. Otherwise, nothing happens. The form is submitted to a JSP file which accepts the request, does something (such as call your Java class), then prints out some HTML in response.

  • Which are the advantages of OWB Mappings over PLSQL code?

    Hi,
    I was wondering which are the advantages of OWB (10gr2 or 11g) Mappings vs simple PLSQL code when the mappings are, for performance reasons, only generated in set based mode.
    Regards
    Maurice

    I'd say it's the general benefits that an ETL tool is considered to have over hand crafted code e.g. maintainability and traceability. The latest versions of OWB also make it even easier to maintain TYPE2 dimensions etc.
    Of course benefits go the other way as well in that if you want the optimum performing code then a skilled PL/SQL developer will deliver that.
    Cheers
    Si

  • PLSQL code optimizing

    Hi
    My oracle db version is 11g R1/AIX5.3
    how following plsql code can be re-written for better performance
    CREATE OR REPLACE PROCEDURE CSCOMMON.POST_SEQ_PROCESS
    AS
       -- Declare variables to hold sequenced infomration.
       pragma autonomous_transaction;
       V_RECORD_ID           POST_SEQUENCING_PROCESS.RECORD_ID%TYPE;
       V_RECEIVED            POST_SEQUENCING_PROCESS.RECEIVED%TYPE;
       V_PROCESS_NAME        POST_SEQUENCING_PROCESS.PROCESS_NAME%TYPE;
       V_PROCESS_ID          POST_SEQUENCING_PROCESS.PROCESS_ID%TYPE;
       V_PROCESS_SEQ         POST_SEQUENCING_PROCESS.PROCESS_SEQ%TYPE;
       V_RECEIVER            POST_SEQUENCING_PROCESS.RECEIVER%TYPE;
       V_RECEIVER_ID         POST_SEQUENCING_PROCESS.RECEIVER_ID%TYPE;
       V_RECEIVER_SEQ        POST_SEQUENCING_PROCESS.RECEIVER_SEQ%TYPE;
       V_SENDER              POST_SEQUENCING_PROCESS.SENDER%TYPE;
       V_SENDER_ID           POST_SEQUENCING_PROCESS.SENDER_ID%TYPE;
       V_MESSAGE_ID          POST_SEQUENCING_PROCESS.MESSAGE_ID%TYPE;
       V_INSTANCE_ID         POST_SEQUENCING_PROCESS.INSTANCE_ID%TYPE;
       V_STATUS              POST_SEQUENCING_PROCESS.STATUS%TYPE;
       V_STEP_ID             POST_SEQUENCING_PROCESS.STEP_ID%TYPE;
       V_INTERNAL_ID         POST_SEQUENCING_PROCESS.INTERNAL_ID%TYPE;
       V_LOCK_ID             POST_SEQUENCING_PROCESS.LOCK_ID%TYPE;
       V_ERROR_HANDLING      POST_SEQUENCING_PROCESS.ERROR_HANDLING%TYPE;
       V_STARTED             POST_SEQUENCING_PROCESS.STARTED%TYPE;
       V_WARNINGS            POST_SEQUENCING_PROCESS.WARNINGS%TYPE;
       V_DOCUMENTTYPE_NAME   POST_SEQUENCING_PROCESS.DOCUMENTTYPE_NAME%TYPE;
       V_DOCUMENTTYPE_ID     POST_SEQUENCING_PROCESS.DOCUMENTTYPE_ID%TYPE;
       V_DOCUMENTTYPE_SEQ    POST_SEQUENCING_PROCESS.DOCUMENTTYPE_SEQ%TYPE;
       v_current             VARCHAR2 (600);
       v_sql_error           VARCHAR2 (600);
       lv_count              NUMBER;
       CURSOR c_first500
       IS
          SELECT RECORD_ID,
                 RECEIVED,
                 PROCESS_NAME,
                 PROCESS_ID,
                 PROCESS_SEQ,
                 RECEIVER,
                 RECEIVER_ID,
                 RECEIVER_SEQ,
                 SENDER,
                 SENDER_ID,
                 MESSAGE_ID,
                 INSTANCE_ID,
                 STATUS,
                 STEP_ID,
                 INTERNAL_ID,
                 LOCK_ID,
                 ERROR_HANDLING,
                 STARTED,
                 WARNINGS,
                 DOCUMENTTYPE_NAME,
                 DOCUMENTTYPE_ID,
                 DOCUMENTTYPE_SEQ
            FROM (  SELECT RECORD_ID,
                           RECEIVED,
                           PROCESS_NAME,
                           PROCESS_ID,
                           PROCESS_SEQ,
                           RECEIVER,
                           RECEIVER_ID,
                           RECEIVER_SEQ,
                           SENDER,
                           SENDER_ID,
                           MESSAGE_ID,
                           INSTANCE_ID,
                           STATUS,
                           STEP_ID,
                           INTERNAL_ID,
                           LOCK_ID,
                           ERROR_HANDLING,
                           STARTED,
                           WARNINGS,
                           DOCUMENTTYPE_NAME,
                           DOCUMENTTYPE_ID,
                           DOCUMENTTYPE_SEQ
                      FROM CSCOMMON.SEQUENCING_PROCESS
                  ORDER BY RECEIVED)
           WHERE ROWNUM < 101;
       P_RAND                NUMBER;
       V_LID                 NUMBER;
    BEGIN
       v_current := 'BEFORE CURSOR OPENING';
       SELECT COUNT (*) INTO lv_count FROM POST_SEQUENCING_PROCESS;
       OPEN c_first500;          
       LOOP
          SELECT CSCOMMON.SEQ_LID_SEQUENCING_PROCESS_NU.NEXTVAL
            INTO V_LID
            FROM DUAL;
         UPDATE CSCOMMON.SEQUENCING_PROCESS A
             SET A.LOCK_ID = V_LID ,
                 A.STATUS = 1,
                 A.STARTED = SYSDATE,
                 A.WARNINGS = 0
           WHERE NOT EXISTS
                        (SELECT 1
                           FROM CSCOMMON.SEQUENCING_PROCESS B
                          WHERE ( (A.RECEIVER_ID = B.RECEIVER_ID
                                   AND A.RECEIVER_SEQ = 1)
                                 OR (A.PROCESS_ID = B.PROCESS_ID
                                     AND A.PROCESS_SEQ = 1)
                                 OR (A.DOCUMENTTYPE_ID = B.DOCUMENTTYPE_ID
                                     AND A.DOCUMENTTYPE_SEQ = 1))
                                AND (A.ERROR_HANDLING = 0 OR B.STATUS != 4)
                                AND B.RECORD_ID < A.RECORD_ID)
                 AND A.STATUS = 2
                 AND 1024 =
                                        (SELECT WM1.STATUS
                           FROM WMLOG610.WMPROCESS WM1,
                                (  SELECT MAX (AUDITTIMESTAMP) AUDITTIMESTAMP,
                                          INSTANCEID
                                     FROM WMLOG610.WMPROCESS WM2
                                    WHERE INSTANCEID IN
                                             (SELECT INSTANCE_ID
                                                FROM CSCOMMON.SEQUENCING_PROCESS where rownum<101)
                                 GROUP BY INSTANCEID
                                 ORDER BY instanceid) WM2
                          WHERE     A.INSTANCE_ID = WM1.INSTANCEID
                                AND WM1.INSTANCEID = WM2.INSTANCEID
                                AND WM1.AUDITTIMESTAMP = WM2.AUDITTIMESTAMP
                                AND ROWNUM = 1)
                 AND A.LOCK_ID IS NULL
                 AND A.DOCUMENTTYPE_NAME != 'FxHaulage';
    commit;
          FETCH c_first500
          INTO V_RECORD_ID,
               V_RECEIVED,
               V_PROCESS_NAME,
               V_PROCESS_ID,
               V_PROCESS_SEQ,
               V_RECEIVER,
               V_RECEIVER_ID,
               V_RECEIVER_SEQ,
               V_SENDER,
               V_SENDER_ID,
               V_MESSAGE_ID,
               V_INSTANCE_ID,
               V_STATUS,
               V_STEP_ID,
               V_INTERNAL_ID,
               V_LOCK_ID,
               V_ERROR_HANDLING,
               V_STARTED,
               V_WARNINGS,
               V_DOCUMENTTYPE_NAME,
               V_DOCUMENTTYPE_ID,
               V_DOCUMENTTYPE_SEQ;
          EXIT WHEN c_first500%NOTFOUND;
          BEGIN
             v_current := 'INSERT INTO POST_SEQUENCING_PROCESS';
             IF (lv_count = 0)
             THEN
                INSERT INTO POST_SEQUENCING_PROCESS (RECORD_ID,
                                                     RECEIVED,
                                                     PROCESS_NAME,
                                                     PROCESS_ID,
                                                     PROCESS_SEQ,
                                                     RECEIVER,
                                                     RECEIVER_ID,
                                                     RECEIVER_SEQ,
                                                     SENDER,
                                                     SENDER_ID,
                                                     MESSAGE_ID,
                                                     INSTANCE_ID,
                                                     STATUS,
                                                     STEP_ID,
                                                     INTERNAL_ID,
                                                     LOCK_ID,
                                                     ERROR_HANDLING,
                                                     STARTED,
                                                     WARNINGS,
                                                     DOCUMENTTYPE_NAME,
                                                     DOCUMENTTYPE_ID,
                                                     DOCUMENTTYPE_SEQ)
                     SELECT *
                       FROM cscommon.sequencing_process A
                      WHERE lock_id IS NOT NULL
                            AND A.DOCUMENTTYPE_NAME != 'FxHaulage' order by lock_id;
                            commit;
                INSERT INTO CSCOMMON.PRE_SEQUENCING_PROCESS
                   (SELECT * FROM CSCOMMON.POST_SEQUENCING_PROCESS);
    commit;
                DELETE FROM CSCOMMON.POST_SEQUENCING_PROCESS;
                COMMIT;
                v_current := 'DELETE FROM SEQUENCING_PROCESS';
                DELETE FROM CSCOMMON.SEQUENCING_PROCESS
                      WHERE LOCK_ID IS NOT NULL
                            AND DOCUMENTTYPE_NAME != 'FxHaulage';
                COMMIT;
             ELSE
                RETURN;
             END IF;
          END;
       END LOOP;
       CLOSE c_first500;                    
       COMMIT;
    EXCEPTION
       WHEN OTHERS
       THEN
          v_sql_error := SQLERRM || ' - ' || v_current;
          ROLLBACK;
    END;
    /May be by using forall /bulk collections
    Thanks
    Raj

    You need to understand transactional consistency. Not only are your commits
    slowing things down, they are not good for maintaining transactional consistency.
    Ask yourself what would happen if there was a problem in your procedure after
    the first commit? How would you recover from that with some records
    updated but the rest of your procedure not having been run?
    In general you should only have one commit at the topmost level. By that I mean if
    there is a program that kicks of other ones and is the 'master' controller, that
    should be the one that decides to commit or rollback the whole transaction.
    Also you need to understand exception handling. Your exception processing is dangeroulsly wrong.
    Remove it.
    Finally, try and do this processing without using cursor loops: pure (set-based) SQL is much faster than
    slow cursor based PL/SQL and SQL together.

  • PLSQL code in a javascript code

    Can i write the PLSQL code in a javascript code?
    Actually i want to pass a value into a PLSQL code. First in javascript code i have to read a value of page item :PX_ITEM, then i have to pass that value in PLSQL code.

    Can i write the PLSQL code in a javascript code?No.
    PL/SQL runs in the database on the server. JavaScript runs in the browser on the client. Never the twain shall meet.
    Passing values between them requires a page submit or AJAX call.

  • Publish a plsql code as webservice without using JDEVELOPER or APEX

    Hi All,
    I am looking into how can we publish a PLSQL code as web-service without using JDEV OR APEX.
    When I google for this one I can see only by using JDEV or APEX we can publish Code as a web-service.
    Is there any way in oracle, just by using simple PLSQL packages we can publish code as a webservice.
    Appreciate your response.
    Thanks,
    MK.

    Apex does not publish PL/SQL code as web services. It is a web run-time and development framework. Something totally different.
    To turn a PL/SQL function into a web service is simple. You use the orawsv servlet in XDB - without making a single code change to the function. It will not even know it is called as a web service.
    To use orawsv, two basic steps. Configure and enable the servlet (raw HTTP/HTTPS connections will be handled by the Listener). This also entails enabling shared server in the database, if not already enabled. The 2nd step is to allow the function to be executed (via a HTTP call) as a web service, via granting specific roles.
    orawsv handles the HTTP call. It provides the WSDL. It parses SOAP envelopes as input. It makes the call (as a standard PL/SQL call), to the function being used as a web service. It returns the results of the PL/SQL function call, as a SOAP envelope output.
    See Support Notes:
    How to Setup Native Oracle XML DB Web Services [Article ID 444191.1]
    Sample Framework for testing Native Oracle XML DB Web Services [Article ID 803794.1]
    How to Browse Native Oracle XML DB Web Services Example [Article ID 1324235.1]

  • Debug plsql code in sqldeveloper

    Hi all,
    I am new to sql developer, can anyone help me how can i debug a plsql code in sqldeveloper for each step ( each line ) and also i want to view the value of the variables used in plsql code after completion of each line execution.
    Thanks,

    http://www.thatjeffsmith.com/archive/2011/12/the-plsql-debugger-strikes-back-episode-v/

  • How to tune plsql code

    hi all,
    tell me any one how to tune the plsql code in oracle plsql

    You could have googled a bit ->
    http://www.google.co.in/#hl=en&q=tuning+pl+sql+in+oracle&meta=&aq=&oq=tuning+pl+sql+in+oracle&fp=3c5f05f17abf6d93
    Regards.
    Satyaki De.

Maybe you are looking for

  • Submit report in BAPI

    Hi all, Is there is any restriction in using <b>submit report and return</b> statement in BAPI function modules ? Thanks , Joby

  • Connecting to a local SQL server .mdf file

    Hi all, In doing some prototyping of my database I started working with a local copy of an SQL Server database since it so conveniently integrated with the Visual Studio .NET tools I use. Now that I have spent far too much time working on a local pro

  • Booting problem, i'm really stressed :(

    hello, when i turn my MBP on and boot it into OS X (it has bootcamp), it only displays the apple logo with the spinning wheel, and it displays a circle with a slash in it with the spinning wheel still turning, please help me guys

  • Equium A110-233 Broken laptop screen

    Hi, I have an Equium A110-233, the screen is broken. I have attached an external monitor and it displays when booting up until it gets to the Windows logon screen then it switches back to the laptop screen. Is there any workaround known for this othe

  • HT3702 Payment card not working from abroad (singing in on different device from abroad)

    I cant find the way to contact itune support because my payment card details seems not to be working from abroad! I leave in uk and I am in tTurkey now! Please advise me what to do?