HELP PLSQL

hi all,
i would like to know how to check if the last character in a string is a number or not.
thanks in advance
phani

HI CAN PLZ TELL IF THIS IS THE RITE WAY OF CHECKING
     select substr(lv_panel,-1) into x
     from dual;
     lv_pan1:=substr(lv_panel,1,length(lv_panel)-1);     
exception
     when others then
     lv_pan1:= lv_panel;
end;

Similar Messages

  • Help. plsql callback of a jms message. Not working

    had examples of AQ working in my 10g r2 database using simple queues.
    however my problem is I want to use a jms queue. I can enqueue onto it all the time but it never notifies my subscriber and I am drawing a blank. Can anyone help me? Thanks in advance.
    Using the example below the data just sits in the queue for ever.
    Here is the example assuming installing into oracle user : demo.
    begin
    dbms_aqadm.create_queue_table
    (Queue_table => 'jms_message'
    ,Queue_payload_type => 'sys.aq$_jms_message'
    ,multiple_consumers => true
    ,comment => 'demo queue table'
    dbms_aqadm.create_queue
    (queue_name => 'jms_message_request',
    queue_table => 'jms_message');
    dbms_aqadm.start_queue
    (queue_name => 'jms_message_request');
    end;
    drop table demo_data;
    drop sequence s_demo_data_id;
    create table demo_data
    (id number(10)
    ,stuff varchar2(2000)
    create sequence s_demo_data_id;
    create or replace procedure plsql_subscriber
    (context raw,
    reginfo sys.aq$_reg_info,
    descr sys.aq$_descriptor,
    payload sys.aq$_jms_message,
    payloadl number
    ) is
    dequeue_options dbms_aq.dequeue_options_t;
    message_properties dbms_aq.message_properties_t;
    message_handle RAW(16);
    message sys.aq$_jms_message;
    v_stuff demo_data.stuff%type;
    begin
    dequeue_options.msgid := descr.msg_id;
    dequeue_options.consumer_name := descr.consumer_name;
    dbms_aq.dequeue(queue_name => 'JMS_MESSAGE_REQUEST',
    dequeue_options => dequeue_options,
    message_properties => message_properties,
    payload => message,
    msgid => message_handle);
    v_stuff:=
    'Type: ' || message.get_type ||
    ' UserId: ' || message.get_userid ||
    ' AppId: ' || message.get_appid ||
    ' GroupId: ' || message.get_groupid ||
    ' GroupSeq: ' || message.get_groupseq;
    insert into demo_data values ( s_demo_data_id.nextval,v_stuff);
    commit;
    end;
    -- ADD plsql SUBSCRIBERS AND REGISTER THE QUEUES
    prompt -- create subscriber
    declare
    o_agent sys.aq$_agent;
    begin
    o_agent:=new sys.aq$_agent
    (name => 'SUBSCRIBER1'
    ,address => null
    ,protocol=> null
    dbms_aqadm.add_subscriber
    (queue_name => 'jms_message_request'
    ,subscriber => o_agent
    ,rule => null
    end;
    declare
    t_reg_list sys.aq$_reg_info_list;
    o_reg_info sys.aq$_reg_info;
    begin
    -- note as this is a multi consumer q we need the name to be in the format schema.queue:consumer_name
    o_reg_info:=new sys.aq$_reg_info
    (name =>'demo.jms_message_request:subscriber1'
    ,namespace =>dbms_aq.namespace_aq -- ie AQ streams
    ,callback => 'plsql://demo.plsql_subscriber'
    ,context => hextoraw('FF')
    t_reg_list:=new sys.aq$_reg_info_list();
    t_reg_list.extend();
    t_reg_list(1):=o_reg_info;
    /* -- note this suffers from oracle bug : 'count' is a reserved word and use of such a keyword causes this error
    -- when using a procedure call in PL/SQL.
    -- This is resolved by the fix for Bug 3966513 which will be in 10g Release 2.
    -- see below for fix
    dbms_aq.register
    (reg_list => t_reg_list
    ,count => 1);
    dbms_aq.register(t_reg_list,1);
    commit;
    end;
    DECLARE
    id pls_integer;
    agent sys.aq$_agent;
    map_message sys.aq$_jms_map_message;
    message sys.aq$_jms_message;
    enqueue_options sys.dbms_aq.enqueue_options_t;
    message_properties sys.dbms_aq.message_properties_t;
    msgid raw(16);
    BEGIN
    agent:= new sys.aq$_agent
    (name=>'producer' -- name of the producer
    ,address=>null -- return address
    ,protocol=>0 -- 0 default
    -- Consturct a empty map message object
    map_message := sys.aq$_jms_map_message.construct;
    -- Shows how to set the JMS header
    map_message.set_replyto(agent);
    map_message.set_type('myType');
    map_message.set_userid('me');
    map_message.set_appid('plsql_enq');
    map_message.set_groupid('myGroup');
    map_message.set_groupseq(1); -- is this messing it up
    -- Shows how to set JMS user properties
    id := map_message.clear_body(-1);
    map_message.set_string(id, 'STRING', 'Hello World!');
    map_message.flush(id);
    sys.aq$_jms_map_message.clean_all();
    message := sys.aq$_jms_message.construct(map_msg=>map_message);
    dbms_aq.enqueue(
    queue_name => 'jms_message_request',
    enqueue_options => enqueue_options,
    message_properties => message_properties,
    payload => message,
    msgid => msgid);
    commit;
    end;
    /

    Update:
    If I go to network in the dashboard it DOES see the airport but will not let me connect. I keep getting "connection failed." I know I have the right password ect. but no idea why it will not let me join.
    Do I need to get the paperclip out and reset the airport???

  • URGENT HELP PLSQL INSERT?

    I have view with 2 columns and a table with two cols.
    I need to INSERT into Table 1 from VIEW DISTICT CUST_JOB_ID WHERE SALARY is
    40,000 . in this CASE ABC(23000+21000) > 40,000 . INSERT SYSDATE. (This is a batch job running in the night). PQR is INSERTED and NOT HIJ into new table. VIEW1
    CUST_JOB_ID, SALARY
    ABC.. 23000
    ABC.. 21000
    DEF 39000
    XYZ.. 54000
    PQR .. 47000
    HIJ ... 15000
    TABLE1
    CUST_JOB_ID DATE
    ABC ............. 12/13/06
    XYZ .............. 5/4/ 05
    Thanks for advance help.
    Tigre.

    SQL> with employee as
      2   (select 'ABC' cust_job_id, 23000 salary from dual
      3    union all
      4    select 'ABC' cust_job_id, 21000 salart from dual
      5    union all
      6    select 'DEF' cust_job_id, 39000 salart from dual
      7    union all
      8    select 'XYZ' cust_job_id, 54000 salart from dual
      9    union all
    10    select 'PQR' cust_job_id, 47000 salart from dual
    11    union all
    12    select 'HIJ' cust_job_id, 15000 salart from dual)
    13  select e.cust_job_id,
    14         e.tot_sal
    15    from (select cust_job_id, sum(salary) tot_sal
    16            from employee
    17          group by cust_job_id) e
    18   where e.tot_sal > 40000
    19  ;
    CUST_JOB_ID    TOT_SAL
    ABC              44000
    PQR              47000
    XYZ              54000
    SQL> your code will look like something below:
      insert into table1
       (cust_job_id, date_column)
      select e.cust_job_id, sysdate
        from (select cust_job_id, sum(salary) tot_sal
                from employee
              group by cust_job_id) e
       where e.tot_sal > 40000

  • Please help-PLSQL complex procedure writing

    Hi all,
    I am back again and requesting your help on this.I want your help to properly write the below code because now i feel-that its very confusing and not easily readable and following the program is tough.
    I want to replace the same looping done below in many places using a function/or any other approaches.Then,need all your important suggestions in any other ways,approach...i can do the same which would be good for performance and best practices here.
    Please help me as i am very stuck with this and struggling so much.
    For any suggested things-please help me with the new code which will be very helping
    CREATE OR REPLACE PROCEDURE "TEST_PROCEDURE" (
       p_strtplanid    test_training_plan.tplan_id%TYPE,
       p_strpersonid   test_person.person_id%TYPE,
       p_strorg_id     test_org.org_id%TYPE
    IS
      /*Here declarartion of variables */
    BEGIN
       /*Since TP is presently in LR,verify if its completed or not*/
       SELECT COUNT (learning_record_id)
         INTO v_inttpcompltd
         FROM test_learning_record lr
        WHERE lr.catalog_item_type = 'training-plan'
          AND lr.status IN ('PASSED', 'WAIVED', 'TESTED_OUT')
          AND lr.lr_catalog_history_id = p_strtplanid
          AND lr.lr_person_id = p_strpersonid
          AND lr.lr_org_id = p_strorg_id;
       /*Credit based */
       SELECT is_credit_based
         INTO v_intcreditbased
         FROM test_training_plan
        WHERE tplan_id = p_strtplanid;
       IF (v_inttpcompltd > 0)
       THEN
          IF (v_intcreditbased = 1)
          THEN
             DBMS_OUTPUT.put_line ('Starting Credit based ');
             v_inttotreqactcompltd :=
                fn_tp_get_cmpltd_act_cnt (p_strtplanid,
                                          p_strpersonid,
                                          p_strorg_id
             SELECT NVL (EXTRACT (tplan_xml_data, '//numberOfCredits/text()').getstringval
                         0
                    NVL (EXTRACT (tplan_xml_data, '//accreditingOrg/text()').getstringval
                         0
               INTO v_intrequiredcredits,
                    v_straccreditingorg
               FROM test_training_plan
              WHERE tplan_id = p_strtplanid;
             SELECT accred_org_id
               INTO v_straccreditingorg
               FROM test_tp_acc_org
              WHERE tplan_id = p_strtplanid;
             IF (v_intrequiredcredits > v_inttotreqactcompltd)
             THEN
                DBMS_OUTPUT.put_line ('test_tp_acc_org ');
                FOR obj IN (SELECT t_objective_id,
                                   NVL (required_credits, 0) required_credits
                              FROM test_tp_objective
                             WHERE tplan_id = p_strtplanid)
                LOOP
                   DBMS_OUTPUT.put_line
                      (   ' Looping each Objective******************************'
                       || obj.t_objective_id
                   SELECT NVL (SUM (lcdt.credit_hours), 0)
                     INTO v_inttotreqacttobecompltd
                     FROM test_train_obj_activity toa,
                          test_tp_objective tpobj,
                          test_learningactivity_credits lcdt,
                          test_tp_acc_org acc_org
                    WHERE lcdt.learning_activity_id = toa.activity_id
                      AND lcdt.acc_org_id = v_straccreditingorg
                      AND toa.t_objective_id = tpobj.t_objective_id
                      AND tpobj.tplan_id = acc_org.tplan_id
                      AND toa.t_objective_id = obj.t_objective_id
                      AND tpobj.tplan_id = p_strtplanid
                      AND tpobj.t_objective_id = obj.t_objective_id
                      AND toa.is_required = 1;
                   DBMS_OUTPUT.put_line
                                   (   'Total credits for required activities****'
                                    || v_inttotreqacttobecompltd
                   --get credits for non event activities
                   SELECT NVL (SUM (credit_hours), 0)
                     INTO v_intnoneventbasedactcredit
                     FROM test_tp_objective tobj,
                          test_train_obj_activity toa,
                          test_learningactivity_credits lac,
                          test_learning_record lr,
                          test_tp_learning_activity tplplr,
                          test_learning_record tplr
                    WHERE tobj.t_objective_id = obj.t_objective_id
                      AND toa.t_objective_id = tobj.t_objective_id
                      AND toa.activity_id = lac.learning_activity_id
                      AND toa.activity_id = lr.lr_catalog_history_id
                      AND toa.is_required = 1
                      AND lr.learning_record_id = tplplr.activity_lp_lr_id
                      AND tplplr.tp_lp_lr_id = tplr.learning_record_id
                      AND tobj.tplan_id = p_strtplanid
                      AND tplr.lr_catalog_history_id = p_strtplanid
                      AND acc_org_id = v_straccreditingorg
                      AND lr.lr_person_id = p_strpersonid
                      AND tplr.lr_person_id = p_strpersonid
                      AND lr.status IN ('PASSED', 'WAIVED', 'TESTED_OUT');
                   --Get credits for events
                   SELECT NVL (SUM (credit_hours), 0)
                     INTO v_inteventbasedactcredit
                     FROM test_learningactivity_credits lac
                    WHERE lac.learning_activity_id IN (
                             SELECT event_id
                               FROM test_tp_objective tobj,
                                    test_train_obj_activity toa,
                                    test_learning_record lr,
                                    test_event_sessions sessions,
                                    test_tp_learning_activity tplplr,
                                    test_learning_record tplr
                              WHERE tobj.t_objective_id = obj.t_objective_id
                                AND tobj.t_objective_id = toa.t_objective_id
                                AND toa.activity_id = sessions.event_id
                                AND toa.is_required = 1
                                AND sessions.event_session_id =
                                                          lr.lr_catalog_history_id
                                AND lr.learning_record_id =
                                                          tplplr.activity_lp_lr_id
                                AND tplplr.tp_lp_lr_id = tplr.learning_record_id
                                AND tplr.lr_catalog_history_id = p_strtplanid
                                AND tobj.tplan_id = p_strtplanid
                                AND tplr.lr_person_id = p_strpersonid
                                AND lr.lr_person_id = p_strpersonid
                                AND lr.status IN
                                               ('PASSED', 'WAIVED', 'TESTED_OUT'))
                      AND acc_org_id = v_straccreditingorg;
                   v_inttotreqactcompltd :=
                            v_intnoneventbasedactcredit + v_inteventbasedactcredit;
                   DBMS_OUTPUT.put_line
                                (   ' Total credits of reqd. completed activities'
                                 || v_inttotreqactcompltd
                   IF (v_inttotreqacttobecompltd <= v_inttotreqactcompltd)
                   THEN
                      DBMS_OUTPUT.put_line
                         (   '****** START INSIDE OBJ-COUNT COMPLETED************** '
                          || obj.required_credits
                      v_strreturnval :=
                         fn_tp_obj_comp_act_cdt (p_strpersonid,
                                                 p_strtplanid,
                                                 obj.t_objective_id,
                                                 v_intcreditbased
                      DBMS_OUTPUT.put_line (   'FN_TP_GET_CMPLTD_ACT_CNT'
                                            || v_strreturnval
                      IF (obj.required_credits > v_strreturnval)
                      THEN
                         DBMS_OUTPUT.put_line
                                   || obj.required_credits
    *I want to write a function/or any other approaches to do the below looping and SELECT functionality and also read the return certain values selected.*
    *Most importantly- this query being run in several places throughout the whole main program and everytime I have to put this SQL there and*
    *which has increased the code by huge amount.*
    **Another thing is-I want to remove the NOT IN below and use a different approach.
                         /*Start processing of new activity */
                         FOR activity IN
                            (SELECT objact.activity_id, objact.activity_type,
                                    objact.is_required
                               FROM test_training_plan tp,
                                    test_tp_objective tp_obj,
                                    test_train_obj_activity objact
                              WHERE tp.tplan_id = tp_obj.tplan_id
                                AND tp.tplan_id = p_strtplanid
                                AND tp_obj.t_objective_id = obj.t_objective_id
                                AND tp_obj.t_objective_id = objact.t_objective_id
                                AND objact.activity_id NOT IN (
                                       SELECT tplplr.activity_id
                                         FROM test_learning_record lr,
                                              test_learning_record lr1,
                                              test_tp_learning_activity tplplr
                                        WHERE lr.lr_catalog_history_id =
                                                                tplplr.activity_id
                                          AND lr.learning_record_id =
                                                          tplplr.activity_lp_lr_id
                                          AND tplplr.tp_lp_lr_id =
                                                            lr1.learning_record_id
                                          AND lr1.lr_catalog_history_id =
                                                                      p_strtplanid
                                          AND lr.lr_person_id = p_strpersonid
                                          AND lr1.lr_person_id = p_strpersonid
                                          AND lr.status IN
                                                 ('PASSED', 'WAIVED',
                                                  'TESTED_OUT'))
                                AND objact.activity_id NOT IN (
                                       SELECT event_id
                                         FROM test_train_obj_activity toa,
                                              test_event_sessions sessions,
                                              test_learning_record lr1,
                                              test_tp_learning_activity tplearnact,
                                              test_learning_record tplr
                                        WHERE toa.activity_id = sessions.event_id
                                          AND sessions.event_session_id =
                                                         lr1.lr_catalog_history_id
                                          AND lr1.learning_record_id =
                                                      tplearnact.activity_lp_lr_id
                                          AND tplearnact.tp_lp_lr_id =
                                                           tplr.learning_record_id
                                          AND tplr.lr_catalog_history_id =
                                                                      p_strtplanid
                                          ---AND toa.is_required = 1
                                          AND toa.t_objective_id =
                                                                obj.t_objective_id
                                          AND tplr.lr_person_id = p_strpersonid
                                          AND lr1.lr_person_id = p_strpersonid
                                          AND lr1.status IN
                                                 ('PASSED', 'WAIVED',
                                                  'TESTED_OUT')))
                         LOOP
                            /*The function should return data so that i can validate them as the below ones*/
                            IF (activity.activity_type = 'Course')
                            THEN
                               sp_test_assign_coursetp (p_strpersonid,
                                                   activity.activity_id,
                                                   p_strpersonid,
                                                   activity.activity_type,
                                                   activity.is_required,
                                                   p_strtplanid,
                                                   v_straccreditingorg,
                                                   obj.t_objective_id,
                                                   v_strlpid
                            ELSIF (activity.activity_type = 'Test')
                            THEN
                               sp_assign_testtp (p_strpersonid,
                                                 activity.activity_id,
                                                 p_strpersonid,
                                                 activity.activity_type,
                                                 activity.is_required,
                                                 p_strtplanid,
                                                 v_straccreditingorg,
                                                 obj.t_objective_id
                            END IF;
                         END LOOP;
                         DBMS_OUTPUT.put_line ('Case of Optional Activity');
                      ELSE
                         /*Start processing of new activity */
                         FOR activity IN
                            (SELECT objact.activity_id, objact.activity_type,
                                    objact.is_required
                               FROM test_training_plan tp,
                                    test_tp_objective tp_obj,
                                    test_train_obj_activity objact
                              WHERE tp.tplan_id = tp_obj.tplan_id
                                AND tp.tplan_id = p_strtplanid
                                AND tp_obj.t_objective_id = obj.t_objective_id
                                AND objact.is_required = 1
                                AND tp_obj.t_objective_id = objact.t_objective_id
                                AND objact.activity_id NOT IN (
                                       SELECT tplplr.activity_id
                                         FROM test_learning_record lr,
                                              test_learning_record lr1,
                                              test_tp_learning_activity tplplr
                                        WHERE lr.lr_catalog_history_id =
                                                                tplplr.activity_id
                                          AND lr.learning_record_id =
                                                          tplplr.activity_lp_lr_id
                                          AND tplplr.tp_lp_lr_id =
                                                            lr1.learning_record_id
                                          AND lr1.lr_catalog_history_id =
                                                                      p_strtplanid
                                          AND lr.lr_person_id = p_strpersonid
                                          AND lr1.lr_person_id = p_strpersonid
                                          AND lr.status IN
                                                 ('PASSED', 'WAIVED',
                                                  'TESTED_OUT'))
                                AND objact.activity_id NOT IN (
                                       SELECT event_id
                                         FROM test_train_obj_activity toa,
                                              test_event_sessions sessions,
                                              test_learning_record lr1,
                                              test_tp_learning_activity tplearnact,
                                              test_learning_record tplr
                                        WHERE toa.activity_id = sessions.event_id
                                          AND sessions.event_session_id =
                                                         lr1.lr_catalog_history_id
                                          AND lr1.learning_record_id =
                                                      tplearnact.activity_lp_lr_id
                                          AND tplearnact.tp_lp_lr_id =
                                                           tplr.learning_record_id
                                          AND tplr.lr_catalog_history_id =
                                                                      p_strtplanid
                                          AND toa.is_required = 1
                                          AND toa.t_objective_id =
                                                                obj.t_objective_id
                                          AND tplr.lr_person_id = p_strpersonid
                                          AND lr1.lr_person_id = p_strpersonid
                                          AND lr1.status IN
                                                 ('PASSED', 'WAIVED',
                                                  'TESTED_OUT'))
                         LOOP
                            /*Move the TP only for required ids */
                            IF (activity.activity_type = 'Course')
                            THEN
                               SP_TEST_ASSIGN_COURSETP (p_strpersonid,
                                                   activity.activity_id,
                                                   p_strpersonid,
                                                   activity.activity_type,
                                                   activity.is_required,
                                                   p_strtplanid,
                                                   v_straccreditingorg,
                                                   obj.t_objective_id,
                                                   v_strlpid
                            ELSIF (activity.activity_type = 'Test')
                            THEN
                               sp_assign_testtp (p_strpersonid,
                                                 activity.activity_id,
                                                 p_strpersonid,
                                                 activity.activity_type,
                                                 activity.is_required,
                                                 p_strtplanid,
                                                 v_straccreditingorg,
                                                 obj.t_objective_id
                            END IF;
                         END LOOP;
                      END IF;
                   ELSE
                      DBMS_OUTPUT.put_line
                         ('*********/*No of required credits is more then completed
                                ******Start processing of new activity */'
                      /*Start processing of new activity */
                      FOR activity IN
                         (SELECT objact.activity_id, objact.activity_type,
                                 objact.is_required
                            FROM test_training_plan tp,
                                 test_tp_objective tp_obj,
                                 test_train_obj_activity objact
                           WHERE tp.tplan_id = tp_obj.tplan_id
                             AND tp.tplan_id = p_strtplanid
                             AND tp_obj.t_objective_id = obj.t_objective_id
                             AND objact.is_required = 1
                             AND objact.t_objective_id = tp_obj.t_objective_id
                             AND objact.activity_id NOT IN (
                                    SELECT tplplr.activity_id
                                      FROM test_learning_record lr,
                                           test_learning_record lr1,
                                           test_tp_learning_activity tplplr
                                     WHERE lr.lr_catalog_history_id =
                                                                tplplr.activity_id
                                       AND lr.learning_record_id =
                                                          tplplr.activity_lp_lr_id
                                       AND tplplr.tp_lp_lr_id =
                                                            lr1.learning_record_id
                                       AND lr1.lr_catalog_history_id =
                                                                      p_strtplanid
                                       AND lr.lr_person_id = p_strpersonid
                                       AND lr1.lr_person_id = p_strpersonid
                                       AND lr.status IN
                                               ('PASSED', 'WAIVED', 'TESTED_OUT'))
                             AND objact.activity_id NOT IN (
                                    SELECT event_id
                                      FROM test_train_obj_activity toa,
                                           test_event_sessions sessions,
                                           test_learning_record lr1,
                                           test_tp_learning_activity tplearnact,
                                           test_learning_record tplr
                                     WHERE toa.activity_id = sessions.event_id
                                       AND sessions.event_session_id =
                                                         lr1.lr_catalog_history_id
                                       AND lr1.learning_record_id =
                                                      tplearnact.activity_lp_lr_id
                                       AND tplearnact.tp_lp_lr_id =
                                                           tplr.learning_record_id
                                       AND tplr.lr_catalog_history_id =
                                                                      p_strtplanid
                                       AND toa.is_required = 1
                                       AND toa.t_objective_id = obj.t_objective_id
                                       AND tplr.lr_person_id = p_strpersonid
                                       AND lr1.lr_person_id = p_strpersonid
                                       AND lr1.status IN
                                               ('PASSED', 'WAIVED', 'TESTED_OUT')))
                      LOOP
                         /*Move the TP only for required ids */
                         IF (activity.activity_type = 'Course')
                         THEN
                            sp_assign_coursetp (p_strpersonid,
                                                activity.activity_id,
                                                p_strpersonid,
                                                activity.activity_type,
                                                activity.is_required,
                                                p_strtplanid,
                                                v_straccreditingorg,
                                                obj.t_objective_id,
                                                v_strlpid
                         ELSIF (activity.activity_type = 'Test')
                         THEN
                            sp_assign_testtp (p_strpersonid,
                                              activity.activity_id,
                                              p_strpersonid,
                                              activity.activity_type,
                                              activity.is_required,
                                              p_strtplanid,
                                              v_straccreditingorg,
                                              obj.t_objective_id
                         END IF;
                      END LOOP;
                   END IF;
                   FOR lr_lp_act IN (SELECT tplplr.activity_id,
                                            tplplr.tp_lp_lr_id
                                       FROM test_tp_objective tp_obj,
                                            test_train_obj_activity toa,
                                            test_learning_record lr,
                                            test_tp_learning_activity tplplr,
                                            test_learning_record tplr
                                      WHERE tplplr.activity_lp_lr_id =
                                                             lr.learning_record_id
                                        AND lr.lr_catalog_history_id =
                                                                   toa.activity_id
                                        AND tplplr.tp_lp_lr_id =
                                                           tplr.learning_record_id
                                        AND tp_obj.t_objective_id =
                                                                toa.t_objective_id
                                        AND tp_obj.tplan_id = p_strtplanid
                                        AND tplplr.lp_lr_flag = 'LR'
                                        AND tp_obj.t_objective_id =
                                                                obj.t_objective_id
                                        AND lr.status IN
                                               ('PASSED', 'WAIVED', 'TESTED_OUT')
                                        AND lr.lr_person_id = p_strpersonid
                                        AND tplr.lr_person_id = p_strpersonid)
                   LOOP
                      DBMS_OUTPUT.put_line
                          (   'Get data for the activity to update TPs LP id****'
                           || v_strlpid
                      DBMS_OUTPUT.put_line
                         (   'Values which I am updating----lr_lp_act.activity_id---'
                          || obj.t_objective_id
                      DBMS_OUTPUT.put_line
                         (   'Values which I am updating----lr_lp_act.activity_id---'
                          || lr_lp_act.activity_id
                      DBMS_OUTPUT.put_line
                         (   'Values which I am updating----lr_lp_act.tp_lp_lr_id---'
                          || lr_lp_act.tp_lp_lr_id
                      UPDATE test_tp_learning_activity
                         SET tp_lp_lr_id = v_strlpid
                       WHERE activity_id = lr_lp_act.activity_id
                         AND tp_lp_lr_id = lr_lp_act.tp_lp_lr_id;
                      UPDATE test_learning_record
                         SET is_for_training_plan = 'NO'
                       WHERE learning_record_id IN (
                                         SELECT activity_lp_lr_id
                                           FROM test_tp_learning_activity
                                          WHERE tp_lp_lr_id =
                                                             lr_lp_act.tp_lp_lr_id);
                   END LOOP;
                END LOOP;
                DELETE FROM test_learning_record_details
                      WHERE learning_record_id =
                               (SELECT learning_record_id
                                  FROM test_learning_record
                                 WHERE lr_catalog_history_id = p_strtplanid
                                   AND lr_person_id = p_strpersonid
                                   AND status = 'PASSED');
                DBMS_OUTPUT.put_line
                   ('UPDATE
                                        test_learning_record_details'
                DELETE FROM test_learning_record
                      WHERE learning_record_id =
                               (SELECT learning_record_id
                                  FROM test_learning_record
                                 WHERE lr_catalog_history_id = p_strtplanid
                                   AND lr_person_id = p_strpersonid
                                   AND status = 'PASSED');
             END IF;

    Hello, as I mentioned on the other thread, views are the way to go here, not functions (they can be expensive from a performance perspective).
    Therefore, for each group of repeated SELECTs, can you create a view based on that SELECT, and then substitute the view for the SELECTs in this code, and repost it (you know the code best) -- it will be easier then to rationalise it, and it would seem very likely that the LOOPs could be minimised if not eliminated altogether.
    Edit
    For example, you could try something like:
    CREATE OR REPLACE VIEW TEST_EVENT_V
    AS
      SELECT event_id
                                         FROM test_train_obj_activity toa,
                                              test_event_sessions sessions,
                                              test_learning_record lr1,
                                              test_tp_learning_activity tplearnact,
                                              test_learning_record tplr
                                        WHERE toa.activity_id = sessions.event_id
                                          AND sessions.event_session_id =
                                                         lr1.lr_catalog_history_id
                                          AND lr1.learning_record_id =
                                                      tplearnact.activity_lp_lr_id
                                          AND tplearnact.tp_lp_lr_id =
                                                           tplr.learning_record_id
                                          AND tplr.lr_catalog_history_id =
                                                                      p_strtplanid
                                          ---AND toa.is_required = 1
                                          AND toa.t_objective_id =
                                                                obj.t_objective_id
                                          AND tplr.lr_person_id = p_strpersonid
                                          AND lr1.lr_person_id = p_strpersonid
                                          AND lr1.status IN
                                                 ('PASSED', 'WAIVED',
                                                  'TESTED_OUT'))And then replace all the NOT INs associate with that SQL with:
    AND objact.activity_id NOT IN (
    SELECT event_id
       FROM TEST_EVENT_V)

  • WAS on Linux seens to be slow

    After having installed WAS for linux, things seemed to work OK.
    It seemed however that database-generated pages were very slow.
    To find out what was wrong we mixed platforms:
    Database on sun, WAS on sun
    Database on linux, WAS on sun
    Database on sun, WAS on linux
    Database on linux, WAS on linux
    Database on linux, WAS on WinNT
    Database on WinNT, WAS on WinNT
    etc..
    Every combination performed well, except when WAS was running on
    Linux. Dispite the fact that the performance for WAS on Linux was
    bad, the Linux wasn't doing really much: no heavy CPU usage, or
    much I/O.
    Any idea's about what's wrong?
    null

    FROM A DIFFERENT THREAD ...
    Mike Thomas (guest) wrote:
    : Hi,
    : There may be a bug in the OAS, in the code where
    : the plsql cartridge talks to the web listener, and
    : vice-versa. I suspect there is a semephore resource
    : initialized incorrectly, is set 0 when should be 1,
    : or a wait test condition off by 1. Big guess.
    : My guess comes from this little test.
    : Test: Use two browser windows, and do the same
    : plsql operations. When you do an operation in the
    : first window, it delays up to 10 seconds, but if you
    : go to the second window and attempt to perform the
    : same operation, both plsql commands process
    : immeditately (yes, immediately). If you don't
    : see results immediately, you may be swapping
    : pages in memory. Test this with vmstat or just
    : load and run the XOSVIEW package.
    : Therefore, I figure we need an Oracle bug fix.
    : A hack that seems to help is to run the following
    : command in a spare xterm:
    : su - oracle
    : owsstat -h tec82.teclab.com -p 8888 -poll 2
    : Use your own domain settings. What this does
    : is poll the web listener every 2 seconds, which
    : seems to help plsql operations. It dumps all
    : kinds of listener timeout warnings on the screen,
    : but don't worry.
    : Also, I definately recommend everyone get the
    : Try and Buy CDROM version of the OAS 3.0.2 for
    : LINUX. There is a little 14 page insert, in addition
    : to the Installation Guide, with the title "Web
    : Applicaion Server Performance Tuning Guide for LINUX",
    : Release 3.0.2, Sept 1998. Reading this is a must.
    : Its only 5 bucks for the trial CDROM and documentation.
    : Good luck.
    : Regards,
    : Mike Thomas
    MIKE!!!!
    Thanks for you insight! I couldn't believe my eyes when I did
    what you
    suggested and it worked like a charm. Is there a bug fix for
    this out
    there yet? I am just installing the 302 product because there
    seems to
    be alot of furver and negativity about the 40 product. Have you
    installed 40? If so, does that work better?
    Thanks,
    DHT
    null

  • Urgent - How to call a Web Services from PLSQL - Please help

    Hello,
    I am very much new to WebServices, need to call web services through PLSQL. I have a urgent requirement, where i need to call the web services by passing from some paramters to it and the web services will return a varchar values as 'PASSED' or 'FAILED'.
    Can you please approch me the best way to start with.
    Thanks,
    Srikanth.

    Hi,
    I need to do it from PLSQL API's not from JAVA.
    I have started developing the code through UTIL_HTTP. Getting lots of error.
    Can you please guide me through these error.
    Below is the wsdl and a blcok where i am trying to retrive the value from webservice.
    Hope this will help you.
    Code:
    declare
    soap_request varchar2(30000);
    soap_respond varchar2(30000);
    http_req utl_http.req;
    http_resp utl_http.resp;
    resp XMLType;
    i integer;
    begin
    soap_request:= '<?xml version = "1.0" encoding = "UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
    <ns1:soapCheckRequest1 wsdl:ns1="https://isportal-qa.iss.net/exportcompliancemanager/services/ExportCheckService" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <FirstName xsi:type="xsd:string">saddam</FirstName>
    <LastName xsi:type="xsd:string">hussein</LastName>
              <companyName xsi:type="xsd:string">samueladams</companyName>
              <address1 xsi:type="xsd:string">123 APT</address1>
              <address3 xsi:type="xsd:string">Atlanta</address3>
              <city xsi:type="xsd:string">uk</city>
              <stateOrRegion xsi:type="xsd:string">GA</stateOrRegion>
              <postalCode xsi:type="xsd:string">30338</postalCode>
              <email xsi:type="xsd:string">sj@samueladams</email>
              <isoCountryCode xsi:type="xsd:string">US</isoCountryCode>
              <endUserIP xsi:type="xsd:string">209.134.168.203</endUserIP>
    </ns1:soapCheckRequest1>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    http_req:= utl_http.begin_request
    ( 'http://isportal-qa.iss.net/exportcompliancemanager/services/ExportCheckService'
    , 'POST'
    , 'HTTP/1.1'
    utl_http.set_header(http_req, 'Content-Type', 'text/xml'); -- since we are dealing with plain text in XML documents
    utl_http.set_header(http_req, 'Content-Length', length(soap_request));
    utl_http.set_header(http_req, 'SOAPAction', ''); -- required to specify this is a SOAP communication
    utl_http.write_text(http_req, soap_request);
    http_resp:= utl_http.get_response(http_req);
    DBMS_OUTPUT.PUT_LINE('-------utl_http.get_response---------------------');
    DBMS_OUTPUT.PUT_LINE('http_resp.status_code is :'||http_resp.status_code );
    DBMS_OUTPUT.PUT_LINE('http_resp.reason_phrase is :'||http_resp.reason_phrase);
    DBMS_OUTPUT.PUT_LINE('http_resp.http_version is :'||http_resp.http_version);
    DBMS_OUTPUT.PUT_LINE('http_resp.private_hndl is :'||http_resp.private_hndl);
    DBMS_OUTPUT.PUT_LINE('-------utl_http.get_response----------------------');
    utl_http.read_text(http_resp, soap_respond);
    utl_http.end_response(http_resp);
    resp:= XMLType.createXML(soap_respond);
    resp:= resp.extract('/soap:Envelop/soap:Body/child::node()'
    , 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"'
    i:=0;
    loop
    dbms_output.put_line(substr(soap_respond,1+ i*255,250));
    i:= i+1;
    if i*250> length(soap_respond)
    then
    exit;
    end if;
    end loop;
    end;
    Error Message
    http_resp.reason_phrase is :Internal Server Error
    http_resp.http_version is :HTTP/1.1
    http_resp.private_hndl is :0
    -------utl_http.get_response----------------------
    <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultco
    apenv:Server.userException</faultcode><faultstring>org.xml.sax.SAXParseException: The prefix &quot;ns1&quot; for element &quot;ns1:soapCheckRequest1&quot; is not bound.</faultstring><detail><ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">atlcms
    2.iss.net</ns1:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
    <?xml version="1.0" encoding="UTF-8" ?>
    - <wsdl:definitions targetNamespace="https://isportal-qa.iss.net/exportcompliancemanager/services/ExportCheckService" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="https://isportal-qa.iss.net/exportcompliancemanager/services/ExportCheckService" xmlns:intf="https://isportal-qa.iss.net/exportcompliancemanager/services/ExportCheckService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    - <!--
    WSDL created by Apache Axis version: 1.3
    Built on Oct 05, 2005 (05:23:37 EDT)
    -->
    - <wsdl:message name="soapCheckResponse1">
    <wsdl:part name="soapCheckReturn" type="soapenc:string" />
    </wsdl:message>
    - <wsdl:message name="soapCheckRequest1">
    <wsdl:part name="firstName" type="soapenc:string" />
    <wsdl:part name="lastName" type="soapenc:string" />
    <wsdl:part name="companyName" type="soapenc:string" />
    <wsdl:part name="address1" type="soapenc:string" />
    <wsdl:part name="address2" type="soapenc:string" />
    <wsdl:part name="address3" type="soapenc:string" />
    <wsdl:part name="city" type="soapenc:string" />
    <wsdl:part name="stateOrRegion" type="soapenc:string" />
    <wsdl:part name="postalCode" type="soapenc:string" />
    <wsdl:part name="email" type="soapenc:string" />
    <wsdl:part name="phone" type="soapenc:string" />
    <wsdl:part name="isoCountryCode" type="soapenc:string" />
    <wsdl:part name="endUserId" type="soapenc:string" />
    <wsdl:part name="endUserIP" type="soapenc:string" />
    <wsdl:part name="endUserSession" type="soapenc:string" />
    <wsdl:part name="performGovCheck" type="xsd:boolean" />
    <wsdl:part name="sendEmailNotification" type="xsd:boolean" />
    <wsdl:part name="screeningLevelBasedOnSuppliedCountryCode" type="xsd:boolean" />
    <wsdl:part name="screeningLevelBasedOnEndUserIP" type="xsd:boolean" />
    <wsdl:part name="soundexMatch" type="xsd:boolean" />
    </wsdl:message>
    - <wsdl:message name="soapCheckRequest">
    <wsdl:part name="firstName" type="soapenc:string" />
    <wsdl:part name="lastName" type="soapenc:string" />
    <wsdl:part name="companyName" type="soapenc:string" />
    <wsdl:part name="address1" type="soapenc:string" />
    <wsdl:part name="address2" type="soapenc:string" />
    <wsdl:part name="address3" type="soapenc:string" />
    <wsdl:part name="city" type="soapenc:string" />
    <wsdl:part name="stateOrRegion" type="soapenc:string" />
    <wsdl:part name="postalCode" type="soapenc:string" />
    <wsdl:part name="email" type="soapenc:string" />
    <wsdl:part name="phone" type="soapenc:string" />
    <wsdl:part name="isoCountryCode" type="soapenc:string" />
    <wsdl:part name="endUserId" type="soapenc:string" />
    <wsdl:part name="endUserIP" type="soapenc:string" />
    <wsdl:part name="endUserSession" type="soapenc:string" />
    <wsdl:part name="performGovCheck" type="xsd:boolean" />
    <wsdl:part name="sendEmailNotification" type="xsd:boolean" />
    <wsdl:part name="screeningLevelBasedOnEndUserIP" type="xsd:boolean" />
    <wsdl:part name="soundexMatch" type="xsd:boolean" />
    </wsdl:message>
    - <wsdl:message name="soapCheckResponse">
    Thanks and Regard,
    Srikanth

  • Plsql webservices deploy error in weblogic.... Can anybody help me.. Urgent

    Could any body look into this exception....
    I am stuggling with this for the last one week........
    I have generated the webservices from PLSql procedure, deployed and tested in oc4j which is successfull running and I can access the webservice too.....
    The same ear file, when i deploy in to weblogic I am getting the follwing error, can anybody look in to this and help me....
    <May 20, 2006 2:09:14 PM GMT+05:30> <Error> <Deployer> <BEA-149231> <Unable to s
    et the activation state to true for the application 'gtry-gtry-WS'.
    weblogic.application.ModuleException: [HTTP:101216]Servlet: "gwsSoapHttpPort" fa
    iled to preload on startup in Web application: "gtry-gtry-context-root".
    java.lang.IllegalStateException: could not find schema type named {{http}//orass
    pcon/Gws.wsdl/types/}EmpRecUser
    at weblogic.wsee.bind.runtime.internal.AnonymousTypeFinder$GlobalTypeNod
    e.getSchemaType(AnonymousTypeFinder.java:181)
    at weblogic.wsee.bind.runtime.internal.AnonymousTypeFinder.getTypeNamed(
    AnonymousTypeFinder.java:86)
    at weblogic.wsee.bind.runtime.internal.Deploytime109MappingHelper.create
    BindingTypeFrom(Deploytime109MappingHelper.java:888)
    at weblogic.wsee.bind.runtime.internal.Deploytime109MappingHelper.proces
    sTypeMappings(Deploytime109MappingHelper.java:466)
    at weblogic.wsee.bind.runtime.internal.Deploytime109MappingHelper.initBi
    ndingFileFrom109dd(Deploytime109MappingHelper.java:246)
    at weblogic.wsee.bind.runtime.internal.Deploytime109MappingHelper.<init>
    (Deploytime109MappingHelper.java:162)
    at weblogic.wsee.bind.runtime.internal.RuntimeBindingsBuilderImpl.create
    RuntimeBindings(RuntimeBindingsBuilderImpl.java:80)
    at weblogic.wsee.ws.WsBuilder.createRuntimeBindingProvider(WsBuilder.jav
    a:272)
    at weblogic.wsee.ws.WsBuilder.buildService(WsBuilder.java:94)
    at weblogic.wsee.ws.WsFactory.createServerService(WsFactory.java:58)
    at weblogic.wsee.server.servlet.WebappWSServlet.initRuntime(WebappWSServ
    let.java:70)
    at weblogic.wsee.server.servlet.WebappWSServlet.initImpl(WebappWSServlet
    .java:32)
    at weblogic.wsee.server.servlet.BaseWSServlet.init(BaseWSServlet.java:40
    at javax.servlet.GenericServlet.init(GenericServlet.java:256)
    at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(St
    ubSecurityHelper.java:276)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    121)
    at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecuri
    tyHelper.java:68)
    at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubL
    ifecycleHelper.java:58)
    at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHel
    per.java:48)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
    mpl.java:493)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppS
    ervletContext.java:1688)
    Thanks in Advance
    Jayanthy.

    Hi Supriya,
    Check the following:
    * Whether the Report is locked in the server.
    * Are the parameters you pass from the form to report have the similar data types.
    Hope your problem is fixed.
    Regards.

  • Help Required :Excel Upload Into Oracle Table Using PLSQL Procedure/Package

    Please Help , Urgent Help Needed.
    Requirement is to Upload Excel file Into Oracle Table Using PLSQL Procedure/Package.
    Case's are :
    1. Excel File is On Users/ Client PC.
    2. Application is on Remote Server(Oracle Forms D2k).
    3. User Is Using Application Using Terminal Server LogIn.
    4. So If User Will Use to GET_FILE_NAME() function of D2K to Get Excel File , D2k Will Try to pick File from That Remote Server(Bcs User Logind from Terminal Server Option).
    5. Cannot Use Util_File Package Or Oracle Directory to Place That File on Server.
    6. we are Using Oracle 8.7
    So Need Some PL/SQL Package or Fuction/ Procedure to Upload Excel file on User's Pc to Oracle Table.
    Please Guide me wd some Code. or with Some Pl/SQL Package, or With SOme Hint. Or any Link ....
    Jus help to Sort This Issue ........
    you can also write me on :
    [email protected], [email protected]

    I also Tried to Use This
    But How can i Use SQLLDR Command In Stored Procedure.
    Well IN SQL*PlUS it is successfull but in Stored Procedure /Package ,PL/SQL does not recognise the OS commands.
    So now my Question How can I recognise the SQLLDR Commnad in Stored Procedure.

  • Help Required:How Upload Excel file Into Oracle Table Using PLSQL Procedure

    Please Help , Urgent Help Needed.
    Requirement is to Upload Excel file Into Oracle Table Using PLSQL Procedure/Package.
    Case's are :
    1. Excel File is On Users/ Client PC.
    2. Application is on Remote Server(Oracle Forms D2k).
    3. User Is Using Application Using Terminal Server LogIn.
    4. So If User Will Use to GET_FILE_NAME() function of D2K to Get Excel File , D2k Will Try to pick File from That Remote Server(Bcs User Logind from Terminal Server Option).
    5. Cannot Use Util_File Package Or Oracle Directory to Place That File on Server.
    6. we are Using Oracle 8.7
    So Need Some PL/SQL Package or Fuction/ Procedure to Upload Excel file on User's Pc to Oracle Table.
    Please Guide me wd some Code. or with Some Pl/SQL Package, or With SOme Hint. Or any Link ....
    Jus help to Sort This Issue ........
    you can also write me on :
    [email protected], [email protected]

    TEXT_IO is a PL/SQL package available only in Forms (you'll want to post in the Forms forum for more information). It is not available in a stored procedure in the database (where the equivalent package is UTL_FILE).
    If the Terminal Server machine and the database machine do not have access to the file system on the client machine, no application running on either machine will have access to the file. Barring exceptional setups (like the FTP server on the client machine), your applications are not going to have more access to the client machine than the operating system does.
    If you map the client drives from the Terminal Server box, there is the potential for your Forms application to access those files. If you want the files to be accessible to a stored procedure in the database, you'll need to move the files somewhere the database can access them.
    Justin

  • Help with truncating a table using plsql procedure in different schema

    I have a plsql procedure in schema A that truncates a table that is given in as parameter.
    create or replace procedure truncate_table(schema, table_name)
    EXECUTE IMMEDIATE 'TRUNCATE TABLE '||schema||'.'||table_name;
    end;
    The above procedure has public execute grant.
    I need to truncate a table in schema B. I have a plsql procedure in schema B that calls the truncate_table procedure and passes in the schema B table name.
    Since the table is in schema B, should the delete grant on the table be given to user A or user B to truncate the table in schema B?
    Thanks in advance.

    Procedure created in schema A
    create or replace
    procedure truncate_table(l_schema varchar2, table_name varchar2) authid current_user
    as
    begin
    EXECUTE IMMEDIATE 'TRUNCATE TABLE '||l_schema||'.'||table_name;
    end;from schema B
    grant delete on table1 to Schema_A
    from schema A
    exec truncate_table('Schema_B','Table1');
    Hope this helps.
    Alvinder

  • Help required with plsql

    Hi all
    I am a novice user , and I have some dumb question :
    1.How do I create and execute plsql procedures in apex ??
    2.I am not able to display anything in my regions or items using dbms_output.put_line('hello');
    3.Is there any dummy's guide to plsql in apex ?? I could not find anything in the documentation that comes with apex.
    Thanks & Regards
    -Shantanu Dhanuka

    Hi,
    PL/SQL is used throughout Apex applications and for various reasons, so it would not be possible to provide a simple answer!
    There are various documents available from oracle.com. For example, here's a link to a document that explains many Apex concepts and provides simple instructions to follow. If you look at the bottom of the document you'll see how to output text on a page using PL/SQL:
    http://download-uk.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28550/ui.htm#BABGGACI
    PL/SQL is an extensive language - I'm not sure that there is an on-line "Dummies guide" but here's another link that you could try:
    http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14261/toc.htm
    If you have specific tasks that you wish to perform and you believe that PL/SQL can help, please post a request for help in this forum explaining what you are trying to do.
    Regards
    Andy

  • Please share me the latest Oracle Help files (ora.hlp, sql.hlp, plsql.hlp)

    Dear my good friends,
    Would you kindly share the latest Oracle Help files of Oracle 10g version or show me the url address (http://...) to download those Help files.
    Some help files of Oracle such as: ora.hlp, sql.hlp, plsql.hlp, etc.
    Thank you very much for your help.
    Best Regards,
    Anna Mary.

    The HTML doc seems to be enough.<br>
    We have installed it on one of our webserver for internal usage, and it works fine.<br>
    <br>
    Nicolas.

  • PLSQL Practice-----Please help!!!

    Hi,
    I'm a beginner for the PLSQL. if someone give me some tips, It's really helpful for me.
    There two table.
    Table A (Transaction table : keep coming a rows)
    A_id B
    111 aaa,bbb,ccc
    222 yyy,ss,ccc
    333 sss,yyy,ddd
    Table B (Fixed code table)
    X_id Y
    xxx aaa,bbb,ccc
    yyy ggg,bb,cca
    zzz sss,yyy,ddd
    Table C
    A_id X_id
    1. First of all, I have to compare two table A & B (between B col & Y col). if the two columns match, I want to insert A_id & X_id into Table C.
    2. If the two columns are not match, I want to insert A_id & "OTHER"(Instead of the X_id) into the Table C.
    How can I get below results?
    A_ID X_ID
    111 xxx
    222 OTHER
    333 zzz

    duplicate thread.. and try this...
    SQL> select * from table_a;
    A_ID B
    111 aaa,bbb,ccc
    222 yyy,ss,ccc
    333 sss,yyy,ddd
    SQL> select * from table_b;
    X_ID Y
    xxx aaa,bbb,ccc
    yyy ggg,bb,cca
    zzz sss,yyy,ddd
    SQL> select * from table_c;
    no rows selected
    SQL> Insert into Table_C select table_a.a_id,nvl(table_b.x_id,'Other') From table_a left outer join table_b on table_a.B = table_b.Y;
    3 rows created.
    SQL> select * from table_c;
    A_ID X_ID
    111 xxx
    333 zzz
    222 Other

  • PLSQL ERROR. REQUIRED HELP...!!

    Hi,
    I developed the following code which is throwing PLSQL ERROR. (error is below the code). Pls Help me out.
    CODE :
    Declare
    vRow binary_integer;
    v_pro_id number;
    i NUMBER := 1;
    cursor c1 IS (select BUSINESS_UNIT_ID, OBJECT_TYPE_ID, TASK_ID, CHECKLIST_HEADER_ID, CHECKLIST_ID, DEFAULT_SELF_REVIEW_FLAG, DEFAULT_PEER_REVIEW_FLAG, DEFAULT_ORIGIN_OF_DEFECTS, DEFAULT_ADMIN_SEVERITY, DEFAULT_ADMIN_CLASSIFICATION from RCL.RCL_CL_ADMIN_SETUP where BUSINESS_UNIT_ID = :P270_BUID);
    rec c1%ROWTYPE;
    TYPE bu IS TABLE OF RCL.RCL_CL_ADMIN_SETUP%ROWTYPE INDEX BY BINARY_INTEGER;
    bu_rec bu;
    begin
    FOR k IN 1..wwv_flow.g_f01.count LOOP
    vRow := wwv_flow.g_f01(k);
    open c1;
    fetch c1 into rec;
    bu_rec(i) := rec;
    WHILE (c1%FOUND) LOOP
    i := i + 1;
    FETCH c1 INTO rec;
    bu_rec(i) := rec;
    end loop;
    close c1;
    FOR j IN 1..i-1 LOOP
    select id into v_pro_id from projects where id = wwv_flow.g_f32(vRow);
    INSERT INTO RCL.RCL_CL_PROJECT_SETUP
    (BUSINESS_UNIT_ID
    ,PROJECT_ID
    ,OBJECT_TYPE_ID
    ,TASK_ID
    ,CHECKLIST_HEADER_ID
    ,CHECKLIST_ID
    ,DEFAULT_SELF_REVIEW_FLAG
    ,DEFAULT_PEER_REVIEW_FLAG
    ,PROJECT_ORIGIN_OF_DEFECTS
    ,DEFAULT_PROJECT_SEVERITY
    ,DEFAULT_PROJECT_CLASSIFICATION)
    VALUES
    (bu_rec(j).BUSINESS_UNIT_ID
    ,v_pro_id
    ,bu_rec(j).OBJECT_TYPE_ID
    ,bu_rec(j).TASK_ID
    ,bu_rec(j).CHECKLIST_HEADER_ID
    ,bu_rec(j).CHECKLIST_ID
    ,bu_rec(j).DEFAULT_SELF_REVIEW_FLAG
    ,bu_rec(j).DEFAULT_PEER_REVIEW_FLAG
    ,bu_rec(j).DEFAULT_ORIGIN_OF_DEFECTS
    ,bu_rec(j).DEFAULT_ADMIN_SEVERITY
    ,bu_rec(j).DEFAULT_ADMIN_CLASSIFICATION);
    END LOOP;
    END LOOP;
    end;
    Error :
    1 error has occurred
    ORA-06550: line 11, column 25: PLS-00302: component 'RCL_CL_ADMIN_SETUP' must be declared ORA-06550: line 11, column 1: PL/SQL: Item ignored ORA-06550: line 21, column 14: PLS-00382: expression is of wrong type ORA-06550: line 21, column 1: PL/SQL: Statement ignored ORA-06550: line 25, column 14: PLS-00382: expression is of wrong type ORA-06550: line 25, column 1: PL/SQL: Statement ignored ORA-06550: line 46, column 4: PLS-00487: Invalid reference to variable 'RCL.RCL_CL_ADMIN_SETUP%ROWTYPE'.
    Regards,
    VM

    Complete Grant. Its working now.. Just got a solution from some forum. It happened due to a SYNONYMs. There was a SYNONYM name "RCL". I dropped that synonym and its working but the values are not getting inserted now... :(

  • Oracle8i and Oas 4081 - PLSQL TOOLKIT - Urgent Please help.

    Hi ,
    I installed Oracle 8i and Oas4081 on different ORACLE_HOME on the Linux 6.1 . When I tried to install the PLSQL toolkit it giving me an Oracle Database error 63744.
    But I am enabled the sql_trace and I found OAS is successfully connecting to Oralce8i database, but it failing for some reason.
    Do we need to do anything special on Oracle 8i side to install the PLSQL toolkit ..??
    .Please help ...
    Thanks in advance ..
    kkumar

    Is this what you're looking for?
    Usage Notes
    If the input data or key given to the DES3DECRYPT procedure is empty, then the procedure raises the error ORA-28231 "Invalid input to Obfuscation toolkit."
    If the input data given to the DES3DECRYPT procedure is not a multiple of 8 bytes, the procedure raises the error ORA-28232 "Invalid input size for Obfuscation toolkit." ORA-28233 is NOT applicable for the DES3DECRYPT function.
    If the key length is missing or is less than 8 bytes, then the procedure raises the error ORA-28234 "Key length too short." Note that if larger keys are used, extra bytes are ignored. So a 9-byte key will not generate an exception.
    C.

Maybe you are looking for