Can't Run Stored Procedure in Package

Hi,
I am trying to run a stored procedure that has multiple in and out paramaters. The procedure can only be viewed in my Connections panel by navigating Oher Users | <user> | Packages | <package> | <procedure>
If I right click <procedure>, the menu items are "Order Members By..." and "Create Unit Test" (greyed out). The ability to "Run" the procedure does not seem possible when it's accessed by user.
I have been trying to find an example of how to create an anonymous block so that I can run the procedure as a SQL file, but haven't found anything that works.
Does anyone know how I can execute this procedure from SQL Developer? I am using Version 2.1.1.64.
Thanks in advance!

Thanks for replying. I did understand the basics of an anonymous block, but what I didn't understand was how to set the out parameters. I should have been more detailed in my question. However, I did get the answer here:
http://stackoverflow.com/questions/3991721/run-stored-procedure-in-sql-developer
Thanks again for replying. I appreciate you taking the time.

Similar Messages

  • How can I execute Stored Procedures in PARALLEL and DYNAMICALLY ?

    Hi 
    I have a stored procedure. It can be executed like this
    exec test @p = 1;
    exec test @p = 2
    exec test @p = n;
    n can be hundred.
    I want the sp being executed in parallel, not sequence. It means the 3 examples above can be run at the same time.
    If I know the number in advance, say 3, I can create 3 different Execution SQL Tasks. They can be run in parallel.
    However, the n is not static. It is coming from a table. 
    How can I execute Stored Procedures in PARALLEL and DYNAMICALLY ?
    I think about using script task. In the script, I get the value of n, and the list of p, from the table, then running a loop with. In the loop, I create a threat and in the threat, I execute the sp like : exec test @p = p. So the exec test may
    be run parallel. But I am not sure if it works.
    Any idea is really appreciated.

    Hi nam_man,
    According to your description, you want to call stored procedures in parallel, right?
    In SSIS, we can create separate jobs with different stored procedures, then set the same schedule to kick the jobs off at the same time. In this way, we should be careful to monitor blocking and deadlocking depending on what the jobs are doing.
    We can also put all stored procedures in SSIS Sequence container, then they will be run in parallel.
    For more information about SSIS job and Sequence container, please refer to the following documents:
    http://www.mssqltips.com/sqlservertutorial/220/scheduling-ssis-packages-with-sql-server-agent/
    https://msdn.microsoft.com/en-us/library/ms139855(v=sql.110).aspx
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • Oracle stored Procedure and Packages in CR4E

    Hi,
    I want to use Stored Procedure in CR4E. I don't know how to use Stored Procedures and packages in Crystal Reports for Eclipse. In the data source explorer I can only see the Tables, Views and Stored Procedures but not packages from my Schema and when I can only drag & drop the Tables and Views into the Field Explorer, I can't drag & Drop the Stored Procedures.
    I managed to attached the stored procedure from CR studio. I opened the report in CR4E and I can see the stored procedure and can preview the data. When I try to run the report and override the datasource, it throws oracle error saying "ORA-01008: Not all variables bound". When I tried to use the option
    DBOptions._doNotVerifyDB
    while replacing connection I get the this error
    java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
         at java.lang.Boolean.compareTo(Boolean.java:26)
         at com.crystaldecisions.sdk.occa.report.lib.ClonableMap.hasContent(ClonableMap.java:112)
         at com.crystaldecisions.client.helper.CloneUtil.hasContent(CloneUtil.java:135)
         at com.crystaldecisions.sdk.occa.report.data.ConnectionInfo.hasContent(SourceFile:151)
         at com.crystaldecisions.client.helper.CloneUtil.hasContent(CloneUtil.java:135)
         at com.crystaldecisions.sdk.occa.report.data.Table.hasContent(SourceFile:286)
         at com.crystaldecisions.sdk.occa.report.data.Procedure.hasContent(SourceFile:212)
         at com.crystaldecisions.sdk.occa.report.lib.ArrayListMerger.haveMatchingContent(ArrayListMerger.java:232)
         at com.crystaldecisions.sdk.occa.report.lib.ArrayListMerger.mergePass(ArrayListMerger.java:138)
         at com.crystaldecisions.sdk.occa.report.lib.ArrayListMerger.merge(ArrayListMerger.java:86)
         at com.crystaldecisions.sdk.occa.report.lib.ControllableList.copyTo(ControllableList.java:68)
         at com.crystaldecisions.sdk.occa.report.data.Database.copyTo(SourceFile:105)
         at com.crystaldecisions.sdk.occa.report.lib.ControllableHelper.copyToPreservingReferences(ControllableHelper.java:153)
         at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.a(SourceFile:2556)
         at com.crystaldecisions.sdk.occa.report.application.b9.onDataSourceChanging(SourceFile:315)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:971)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:4078)
         at com.crystaldecisions.sdk.occa.report.application.bv.new(SourceFile:121)
         at com.crystaldecisions.sdk.occa.report.application.bv.int(SourceFile:91)
         at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.performDo(SourceFile:151)
         at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.a(SourceFile:106)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:2159)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.mapFields(SourceFile:4061)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:3914)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.replaceConnection(SourceFile:3880)
         at
    Please advice if Stored procedures and packages are supported in CR4E ?

    Hi, Jack76,
    According to the [CR4E Release Notes|http://help.sap.com/businessobject/product_guides/cr4E/en/cr4e_relnotes_en.pdf] (available from the [CR4E Download page|http://www.businessobjects.com/campaigns/forms/downloads/crystal/eclipse/datasave.asp]), stored procedures are supported, as long as they don't use parameters that need null values.
    I don't see any references to packages.
    Bryan

  • Can not see Stored Procedures owned by "Code Owner"

    Post Author: BinChen
    CA Forum: Deployment
    I am using Data Source defined with "CR Oracle ODBC Driver 5.0" in "Data Source (ODBC)".
    But in Crystal Report XI, I can not see CodeOwner when I can created a new connection using ODBC (RDO).
    I can see CodeOwner and all SP defined under it when I use "Oracle Server" directly or use sqlplus.

    Post Author: BinChen
    CA Forum: Deployment
    I'm using Window XP with Oracle 10g2R
    To be more clear,
    I have an ODBC Data Source defined as "DEV" and when I created a connection using ODBC, I can only see some database account section like: APP, APPREF, PUBLIC, SYS, SUSTEM. But I can not see CodeOwner.
    If I connected without using ODBC, I can also see CODEOWNER and then all its stored procedures.
    So why I can not see Stored Procedures defined under CODEOWNER using ODBC?
    I have an exsiting report, even I can not see CODEOWNER, but I have no problem to run and preview the report also to "verify database".

  • Help....on stored procedure (or package)

    Hi,
    I have any problem to create stored procedure in Oracle, Can you help me?
    I have to create a stored procedure (or package) in order to reserve the free rooms to the students in the period comprised between the DATE_START and DATE_END.
    Table of the present rooms in building BL1 (RM): SEX 1 = M - SEX 2 = F SEX = 0 (ROOM WITHOUT SEX)
    BL_ID.....FL_ID.......RM_ID.........SEX......RM_STD.....RM_CAT
    BL1.........1..........101..............1........S........ROOM
    BL1.........1..........102..............0........D........ROOM
    BL1.........1..........103..............2........T........ROOM
    BL1.........2..........201..............2........S........ROOM
    BL1.........2..........202..............1........D........ROOM
    BL1.........2..........203..............1........T........ROOM
    BL1.........3..........301..............2........S........APARTMENT
    BL1.........3..........302..............2........D........APARTMENT
    BL1.........3..........303..............1........T........APARTMENT
    BL1.........3..........304..............1........D........APARTMENT
    BL1.........3..........305..............0........D........APARTMENT
    Table of the students (EM):
    EM_ID...........BL_ID.......FL_ID........RM_ID........COD_STUD
    SABRINA..........BL1..........1............102.........524505
    TAKEM............BL1..........1............103.........569673
    SERAFINO.........BL1..........1............103.........589920
    STELLA...........BL1..........1............102.........574659
    CHIARA...........BL1..........1............101.........587845
    VIDAL............BL1..........1............102.........602877
    ROSARIA..........BL1..........2............202.........517070
    LUCA.............BL1..........2............201.........602743
    DANIELA..........BL1..........2............203.........602865
    ANNAMARIA........BL1..........3............305.........588721
    LUIGI............BL1..........3............304.........546517
    Type of rooms (RM_STD):
    RM_STD.......STD_EM........DESCRIPTION
    D.............4..............DOUBLE
    T.............6..............TRIPLE
    S.............2..............SINGLE
    Tables of the reservations carried out from the students (RMPCT):
    EM_ID......BL_ID........FL_ID......RM_ID......DATE_START.......DATE_END.......COD_STUD
    CHIARA......BL1.........1..........101.......11/02/2004.......12/02/2004.......587845
    CHIARA......BL1.........1..........101.......03/02/2005.......16/02/2005.......587845
    SERAFINO....BL1.........1..........102.......12/02/2004.......19/02/2004.......589920
    VIDAL.......BL1.........1..........102.......16/02/2004.......01/03/2004.......602877
    SERAFINO....BL1.........1..........103.......01/02/2004.......15/02/2004.......589920
    TAKEM.......BL1.........1..........103.......04/02/2005.......10/02/2005.......569673
    LUCA........BL1.........2..........201.......03/02/2005.......23/02/2005.......602743
    ROSARIA.....BL1.........2..........202.......03/02/2005.......16/02/2005.......517070
    DANIELA.....BL1.........2..........203.......03/02/2005.......04/02/2005.......602865
    LUIGI.......BL1.........3..........301.......03/02/2005.......23/02/2005.......546517
    VALERIA.....BL1.........3..........302.......12/02/2004.......16/02/2004.......515348
    CHIARA......BL1.........3..........302.......05/02/2004.......15/02/2004.......587845
    CHIARA......BL1.........3..........304.......10/02/2004.......12/02/2004.......587845
    CHIARA......BL1.........3..........305.......20/01/2004.......04/02/2004.......587845
    ANNAMARIA...BL1.........3..........305.......03/02/2005.......16/02/2005.......588721
    INPUT PARAMETERS:
    CREATE OR REPLACE Procedure RESERVE_ROOMS (stud_name varchar2,
    cod_stud varchar2,
    bl_in varchar2,
    fl_in varchar2,
    rm_in in varchar2,
    sex_in varchar2,
    date_start_in varchar2,
    date_end_in varchar2)
    CONDITIONS:
    verify if there are students in table EM:
    select count (1)
    into v_appo
    from em
    where em_id = stud_name
    and cod_stud = cod_stud;
    if v_appo = 0 then
    insert new student:
              insert into em (em_id,cod_sud,sex)
    values (stud_name,cod_stud,sex_in);
    Now I must verify the free rooms in the period comprised between the DATE_START_IN and DATE_END_IN.
    I tried this query: (seem correct...have you any idea?)
    select bl_id,fl_id,rm_id,RM_STD
    from rm
    where (bl_id,fl_id,rm_id,RM_STD) not in (select a.bl_id,a.fl_id,a.rm_id,A.RM_STD
                             from rm a, rmpct b
                             where a.bl_id=b.bl_id
                             and a.fl_id=b.fl_id
                             and a.rm_id=b.rm_id
                             AND((b.date_start <= TO_DATE(date_start_in, 'dd-mm-YYYY')
                             AND b.date_end >= TO_DATE(date_end_in, 'dd-mm-YYYY'))
                             OR ( b.date_end <= TO_DATE(date_end_in, 'dd-mm-YYYY'))
                             AND b.date_end >= TO_DATE(date_start_in, 'dd-mm-YYYY')
                             OR ( b.date_start >= TO_DATE(date_start_in, 'dd-mm-YYYY')
                             and b.date_start <= TO_DATE(date_end_in, 'dd-mm-YYYY')
                             AND b.date_end >= TO_DATE(date_end_in, 'dd-mm-YYYY'))))
    with this query I get all free rooms in period date_start_in - date_end_in, but I must,also,verify if there are double or triple rooms (reserved) with minus of 2 (double) or minus of 3 (triple) students. If there are I can reserved these rooms.
    I tried to verify with these steps:
    CREATE OR REPLACE VIEW COUNT_EM ( BL_ID,
    FL_ID, RM_ID, NUMBER_EM ) AS
    (SELECT rm.bl_id, rm.fl_id, rm.rm_id, COUNT(*) as numero_em
    FROM em, rm
    WHERE em.bl_id(+) = rm.bl_id
    AND em.fl_id(+) = rm.fl_id
    AND em.rm_id(+) = rm.rm_id
    and rm.rm_std in ('S', 'D', 'T')
    group by rm.bl_id, rm.fl_id, rm.rm_id)
    CREATE OR REPLACE VIEW COUNT_RMPCT ( BL_ID,
    FL_ID, RM_ID, STD_EM, NUMBER_RMPCT
    ) AS
    SELECT rm.bl_id, rm.fl_id, rm.rm_id, rmstd.std_em, COUNT(*) as numero_rmpct
    FROM rm, rmpct,rmstd
    WHERE rmpct.bl_id(+) = rm.bl_id
    AND rmpct.fl_id(+) = rm.fl_id
    AND rmpct.rm_id(+) = rm.rm_id
    and rm.rm_std=rmstd.rm_std
    and rm.rm_std in ('S', 'D', 'T')
    AND((rmpct.date_start <= TO_DATE(date_start_in', 'dd-mm-YYYY')
    AND rmpct.date_end >= TO_DATE(date_end_in, 'dd-mm-YYYY'))
    OR ( rmpct.date_end <= TO_DATE(date_end_in, 'dd-mm-YYYY'))
    AND rmpct.date_end >= TO_DATE(date_start_in, 'dd-mm-YYYY')
    OR ( rmpct.date_start >= TO_DATE(date_start_in, 'dd-mm-YYYY')
    and rmpct.date_start <= TO_DATE(date_end_in, 'dd-mm-YYYY')
    AND rmpct.date_end >= TO_DATE(date_end_in, 'dd-mm-YYYY')))
    group by rm.bl_id, rm.fl_id, rm.rm_id, rmstd.std_em
    AND FINALLY:
    select a.bl_id, a.fl_id, a.rm_id, a.NUMBER_RMPCT, B.NUMBER_EM, a.std_em, (a.std_em - (a.NUMBER_RMPCT+B.NUMBER_EM)) RM_FREE
    from COUNT_RMPCT a, COUNT_EM b
    where a.bl_id=b.bl_id
    and a.fl_id=b.fl_id
    and a.rm_id=b.rm_id
    if RM_FREE > 0 THEN there are free rooms (D or T) between those occupied in that period.
    Now If the room (bl_in,fl_in,rm_in) is free I can reserve inserting it in the table RMPCT:
    INSERT INTO rmpct (bl_id, fl_id, rm_id,em_id,cod_stud,date_start, date_end)
    values(bl_in,fl_in,rm_in,stud_name,cod_stud,date_start_in,date_end_in);
    If I haven't rm_in (can be null) I must reserve the first free room (random).
    after these controls: I update table of the students:
    UPDATE em
    Set bl_id = BL_IN,fl_id= FL_IN,rm_id=rm_in
         where em_id=stud_name
         and cod_stud=cod_stud;
    Finally I must make a control on the sex of the room, because there are rooms that have sex=0
    if RM.SEX <> 0 then
         null
    else
    if rm_cat = 'ROOM' then
    UPDATE rm
    set sex = sex_in
    where bl_id = in
    and fl_id = in
    and rm_id = in;
    if rm_cat = 'APARTMENT' then (update on all rooms)
    UPDATE rm
    set sex = sex_in
    where bl_id = in
    and fl_id = in;
    IF v_appo > 0 then
         Same controls except:      insert into em (em_id,cod_sud,sex)
                   values (stud_name,cod_stud,sex_in);
    How I can insert in one stored procedure (or package) all these instructions and controls?
    Thanks in advance!

    In the following demonstation, I have changed the names of some of your variables, in order to standardize them. I have prefaced input parameters with p_ and local variables with v_ and followed them with the name of the column that they are associated with when appropriate. This avoids conflicts with any column names and makes the code easier to read and follow. I have also used table_name.column_name%type to specify the data type associated with the variables instead of using varchar2. That way, if the data type of the columns changes, the code does not have to be updated. This is standard practice.
    In your first insert statement, you have attempted to insert sex into the em table, but there is no sex column in the em table data that you displayed, so I removed the sex.
    Instead of using a complicated mess of views and such to check whether there is a room available and then assign it, I have used just one select statement to select an available room and used an exception clause that handles a no_data_found exception to deal with when there is no room available.
    I have greatly simplified your checking of dates within that select statement.
    You were on the right track with the outer joins and grouping and checking for single, double, or triple rooms. Instead of count, I have used sum and nvl2, so that only the occupied rooms are counted and the rows generated by the outer join are zeroes.
    I have used the nvl function to allow for null values in the input parameters, so that any room can be selected. I used dbms_random.random to ensure that the rows are ordered randomly, but you can leave that out if it is really not that critical that the result be truly random and any row will do. I have used rownum=1 in an outer query to select just one row.
    When you select from a table in pl/sql, you have to select into something. You cannot just issue a select statement, then use an if statement to compare some value in the select statement. For example, you cannot use "if rm.sex ..." you have to select rm.sex into a variable, like v_sex, then use "if v_sex ...". So, I have selected the result of the select statement into local variables, then used those variables for comparisons. I have also used those variables for inserting and updating the appropriate tables, rather than just using the original input parameters, since some of them may have been null.
    In the example below, I have demonstrated how the procedure rejects an unavailable room, accepts a specific available room, and randomly assigns a room.
    -- procedure:
    scott@ORA92> CREATE OR REPLACE PROCEDURE reserve_rooms
      2    -- input parameters:
      3    (p_em_id      IN em.em_id%TYPE,
      4       p_cod_stud   IN em.cod_stud%TYPE,
      5       p_bl_id      IN rm.bl_id%TYPE,
      6       p_fl_id      IN rm.fl_id%TYPE,
      7       p_rm_id      IN rm.rm_id%TYPE,
      8       p_sex          IN rm.sex%TYPE,
      9       p_date_start IN VARCHAR2,
    10       p_date_end   IN VARCHAR2)
    11  AS
    12    -- local variables:
    13    v_appo          INTEGER;
    14    v_bl_id          rm.bl_id%TYPE;
    15    v_fl_id          rm.fl_id%TYPE;
    16    v_rm_id          rm.rm_id%TYPE;
    17    v_rm_cat      rm.rm_cat%TYPE;
    18    v_sex          rm.sex%TYPE;
    19  BEGIN
    20    -- verify if the student is in table em:
    21    SELECT COUNT (*)
    22    INTO   v_appo
    23    FROM   em
    24    WHERE  em_id = p_em_id
    25    AND    cod_stud = p_cod_stud;
    26    -- if the student is not in table em, then insert new student:
    27    IF v_appo = 0 THEN
    28        INSERT INTO em (em_id, cod_stud)
    29        VALUES (p_em_id, p_cod_stud);
    30    END IF;
    31    BEGIN
    32        -- find available room:
    33        SELECT bl_id, fl_id, rm_id, sex, rm_cat
    34        INTO     v_bl_id, v_fl_id, v_rm_id, v_sex, v_rm_cat
    35        FROM     (SELECT rm.bl_id, rm.fl_id, rm.rm_id, rm.sex, rm.rm_cat
    36             FROM     rmpct, rm
    37             WHERE     rm.bl_id = rmpct.bl_id (+)
    38             AND     rm.fl_id = rmpct.fl_id (+)
    39             AND     rm.rm_id = rmpct.rm_id (+)
    40             AND     rm.bl_id = NVL (p_bl_id, rm.bl_id)
    41             AND     rm.fl_id = NVL (p_fl_id, rm.fl_id)
    42             AND     rm.rm_id = NVL (p_rm_id, rm.rm_id)
    43             AND     (rm.sex   = p_sex OR rm.sex = 0)
    44             AND     rmpct.date_start (+) <= TO_DATE (p_date_end, 'DD-MM-YYYY')
    45             AND     rmpct.date_end (+) >= TO_DATE (p_date_start, 'DD-MM-YYYY')
    46             GROUP     BY rm.bl_id, rm.fl_id, rm.rm_id, rm.sex, rm.rm_cat, rm.rm_std
    47             HAVING SUM (NVL2 (rmpct.rm_id (+), 1, 0))
    48                 < DECODE (rm_std, 'S', 1, 'D', 2, 'T', 3)
    49             ORDER     BY DBMS_RANDOM.RANDOM)
    50        WHERE ROWNUM = 1;
    51        -- reserve room:
    52        INSERT INTO rmpct (bl_id, fl_id, rm_id, em_id, cod_stud, date_start, date_end)
    53        VALUES (v_bl_id, v_fl_id, v_rm_id, p_em_id, p_cod_stud,
    54             TO_DATE (p_date_start, 'DD-MM-YYYY'),
    55             TO_DATE (p_date_end, 'DD-MM-YYYY'));
    56        -- update students:
    57        UPDATE em
    58        SET     bl_id = v_bl_id, fl_id = v_fl_id, rm_id = v_rm_id
    59        WHERE     em_id = p_em_id
    60        AND     cod_stud = p_cod_stud;
    61        -- update sex of room or apartment floor:
    62        IF v_sex = 0 THEN
    63          IF v_rm_cat = 'ROOM' THEN
    64            UPDATE rm
    65            SET    sex = p_sex
    66            WHERE  bl_id = v_bl_id
    67            AND    fl_id = v_fl_id
    68            AND    rm_id = v_rm_id;
    69          ELSIF v_rm_cat = 'APARTMENT' THEN
    70            UPDATE rm
    71            SET    sex = p_sex
    72            WHERE  bl_id = v_bl_id
    73            AND    fl_id = v_fl_id;
    74          END IF;
    75        END IF;
    76    EXCEPTION
    77        -- if no room is available:
    78        WHEN NO_DATA_FOUND THEN
    79          RAISE_APPLICATION_ERROR (-20001, 'Sorry, there is no such room available.');
    80    END;
    81  END reserve_rooms;
    82  /
    Procedure created.
    scott@ORA92> SHOW ERRORS
    No errors.
    -- rejects unavailable room of wrong sex:
    scott@ORA92> EXECUTE reserve_rooms ('BARBARA', 654321, 'BL1', 1, 101, 2, '04-02-2005', '10-02-2005')
    BEGIN reserve_rooms ('BARBARA', 654321, 'BL1', 1, 101, 2, '04-02-2005', '10-02-2005'); END;
    ERROR at line 1:
    ORA-20001: Sorry, there is no such room available.
    ORA-06512: at "SCOTT.RESERVE_ROOMS", line 79
    ORA-06512: at line 1
    -- accepts available room of same sex:
    scott@ORA92> EXECUTE reserve_rooms ('BARBARA', 654321, 'BL1', 1, 103, 2, '04-02-2005', '10-02-2005')
    PL/SQL procedure successfully completed.
    -- assigns random available room of same or no sex:
    scott@ORA92> EXECUTE reserve_rooms ('BARBARA', 654321, NULL, NULL, NULL, 2, '11-02-2005', '23-02-2005')
    PL/SQL procedure successfully completed.
    -- results:
    scott@ORA92> -- one and only one row added to em table:
    scott@ORA92> SELECT * FROM em WHERE em_id = 'BARBARA'
      2  /
    EM_ID           BL_I      FL_ID      RM_ID   COD_STUD
    BARBARA         BL1           1        102     654321
    scott@ORA92> -- rooms reserved and other people who have reserved same room
    scott@ORA92> -- (there are 3 who reserved a double room, but only 2 at a time):
    scott@ORA92> SELECT *
      2  FROM   rmpct
      3  WHERE  (bl_id, fl_id, rm_id) IN
      4           (SELECT bl_id, fl_id, rm_id
      5            FROM   rmpct
      6            where  em_id = 'BARBARA')
      7  /
    EM_ID           BL_      FL_ID      RM_ID DATE_STAR DATE_END    COD_STUD
    BARBARA         BL1          1        102 11-FEB-05 23-FEB-05     654321
    SERAFINO        BL1          1        102 12-FEB-04 19-FEB-04     589920
    VIDAL           BL1          1        102 16-FEB-04 01-MAR-04     602877
    SERAFINO        BL1          1        103 01-FEB-04 15-FEB-04     589920
    TAKEM           BL1          1        103 04-FEB-05 10-FEB-05     569673
    BARBARA         BL1          1        103 04-FEB-05 10-FEB-05     654321
    6 rows selected.
    scott@ORA92> -- rooms reserved are all correct sex
    scott@ORA92> -- (note that room 102 was updated from 0 to 2):
    scott@ORA92> SELECT *
      2  FROM   rm
      3  WHERE  (bl_id, fl_id, rm_id) IN
      4           (SELECT bl_id, fl_id, rm_id
      5            FROM   rmpct
      6            where  em_id = 'BARBARA')
      7  /
    BL_      FL_ID      RM_ID        SEX R RM_CAT
    BL1          1        102          2 D ROOM
    BL1          1        103          2 T ROOM
    scott@ORA92>

  • Is it possible to trigger an error so that the running stored procedure is stopped?

    Hello all,
    I want to run an existing stored procedure and then I want to manually trigger an error/abort/interruption so see what happens and do some testing with that.
    Is it possible to manually trigger an error/abort/interruption on a running stored procedure so that it is stopped?
    If yes, how can I do that?
    I hope someone has an idea. For me it sounds not really difficult, but I just do not get the idea how to do it.
    Kind regards
    Peter

    Hello Visakh,
    I dont want to modify the existing procedure. I just want to run it and than stop it, but not with the button to stop it, but "kill" it somehow with an error (with not destroying the database).
    Nope you cant simulate an intermediate failure inside procedure code from outside. For that you have to modify the actual sp code itself
    Another way is by doing data manipulation in such a way which causes a error in procedure but for that you need to revisit the logic to ensure you do changes in such way as to cause an error
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Crystal Reports can't add stored procedure using Oracle Provider for OLE DB

    Hello,
    I am trying to bind an oracle stored procedure to a crystal report through Visual Studio 2008.
    This oracle stored procedure returns a ref cursor.
    I am using an oracle 11g database (11.2.0.2.0) .
    When I use the Oracle Provider For OLE DB driver to bind the store procedure with the report, I get the following error message:
    Description : ORA -06550 Line 1 Column 7
    PLS 00306 wrong number of types or arguments to the "Strored Procedure Name"
    But When I use the Microsoft OLE DB provider for oracle driver, I can bind the stored procedure to the report successfully .
    I cannot use the Microsoft OLE DB provider for oracle driver because it does not support the CLOB data type which I plan on having the stored procedure return once I can get everything working.
    I have tried setting PLSQLRSET = 1 IN "HKEY_LOCAL_MACHINE\SOFTWARE\KEY_OraDb11g_home1\OLEDB", but that does not seem to work either
    Any assistance would be greatly Appreciated
    My Stored procedure is very simple as the moment (I just need to get it working then I'll add more stuff). Here's what it looks like:
    CREATE OR REPLACE PACKAGE PROMO.PKG_REPORT as
    TYPE OUT_Type IS REF CURSOR;
    procedure Report_ThisReport (
    p_ThisIdField IN number,
    IO_CURSOR IN OUT OUT_Type
    end PKG_REPORT;
    CREATE OR REPLACE PACKAGE BODY PROMO.PKG_REPORT as
    procedure REPORT_ThisReport (
    p_ThisIdField IN number,
    IO_CURSOR IN OUT OUT_Type
    IS
    BEGIN
    OPEN IO_CURSOR FOR
    SELECT ThisField
    FROM ThisTable
    WHERE ThisIdField = p_ThisIdField ;
    END REPORT_ThisReport;
    end PKG_REPORT;
    Edited by: 894988 on Nov 3, 2011 2:45 PM
    Edited by: 894988 on Nov 3, 2011 2:46 PM
    Edited by: 894988 on Nov 3, 2011 2:47 PM

    It seems that some questions posted here on the XE forum are really questions about other Oracle technologies.
    Concretely, for you there is an Oracle Provider for OLE DB Forum that is active and a terrific resource for you to use.
    Oracle Provider for OLE DB
    Cheers!

  • Administering Stored Procedures and Packages

    I've read about WRAP utility but I don't know exactly what's it about. Here you are what ýI've read:ý
    The code used to create the procedure ,package ,or function is available in the dictionary ýviews DBA_Source ,All_Source,and user_source except when you create them with the ýWRAP utility .the WRAP utility generates encrypted code, which only the Oracle server ýcan interpret .ý
    does any one have any idea .
    Thanks in advance

    Generally, one uses the WRAP utility when
    - You are delivering code to a third party
    - You want to ensure that the third party isn't able to decompile your code.
    If you built a CRM application with stored procedures and packages and you started selling that commercially, for example, you would use the WRAP utility to ensure that competitors couldn't reverse engineer your code and see how you did things.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Flags needs to set to run stored procedure fast

    Hi,
    I need to understand what all flags that we need to set run stored procedure fast.
    e.g. set no count on command is one option, please redirect me to other command so that I can use those for each stored procedure.

    That is the only general option, however, no relationship to performance.  Other options may be appropriate depending on the program statements.
    To achieve good performance, optimize the stored procedure:
    http://www.sqlusa.com/articles/query-optimization/
    The underlying principles of stored procedure optimization:
    1. Each statement must be optimized
    2. Avoid unnecessary statements & excessive looping
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • Running stored procedures from HTML DB

    Hello.
    Is it possible to run stored procedures/functions from HTML DB? If yes, how to do it?
    Davide

    If the variable v_return_amount is a number, how can you assign a boolean to it? Are you sure your function is valid? I would write it slightly different:
    CREATE OR REPLACE FUNCTION verify_amount (
    v_invoices_pk IN NUMBER,
    v_new_amount IN NUMBER
    RETURN BOOLEAN
    IS
    CURSOR c_amount
    IS
    SELECT amount
    FROM invoices
    WHERE invoices.invoices_pk = v_invoices_pk;
    CURSOR c_dist_amount
    IS
    SELECT SUM (cost_distribution.amount)
    FROM cost_distribution
    WHERE cost_distribution.invoices_pk = v_invoices_pk;
    v_sum_amount NUMBER;
    v_invoices_amount NUMBER;
    BEGIN
    OPEN c_dist_amount;
    FETCH c_dist_amount
    INTO v_sum_amount;
    CLOSE c_dist_amount;
    OPEN c_amount;
    FETCH c_amount
    INTO v_invoices_amount;
    CLOSE c_amount;
    IF (v_invoices_amount <= v_sum_amount + v_new_amount)
    THEN
    RETURN TRUE;
    ELSE
    RETURN FALSE;
    END IF;
    RETURN v_return_amount;
    EXCEPTION
    WHEN OTHERS
    THEN
    RETURN FALSE;
    END;
    Other than that, I am not sure about your cursors but I can't judge from here. The other thing is how you use the function in the validation process. Can you try to correct and tell if it worked out?
    Denes Kubicek

  • How run stored procedure in Crystal report?

    I have table from query in report, but first I need to run stored procedure in report.
    How I need to do it?

    previous post not correct
      this is correct
    When I need to run my report
    1) I need to run storeed procedure ( the stored procedure will update some tables)
    I just used Add Command and added stored procedure in Database Fields, but I think the procedure doesn't work in report. Maybe I need add new commant and write there:
    exec ProcedureName par1 par2
    or
    exec ProcedureName (par1={?parameter1} par2={?parameter2})
    It's doesn't work. What I need to do?
    2) I use some query in report
    ex.
    select t1.col1, t2.col2, t6.col3 t1.col7 t4.col1
    from t1, t2, t6, t4, r4, ju, hh
    where hh.col11={?parameter1}
    and ju.col3=6
    and r4.col3={?parameter2}
    group by .....
    order by ......
    How I need to create me report? What I need to do first?
    If parameter in stored procedure par1={?parameter1} in query
    and par2={?parameter2}

  • Calling of stored procedure in package

    Hi,
    I have one stored procedure A. And one package of name P1.
    I have execute previlage of package but not having any previlge of stored procedure.
    and In package P1 stored procedure A is called. then this packege is work or it will genrate an Error?

    Oracle users - userA, userB
    Stored procedure - procedure1
    Package - package1
    Who is owner of procedure1 and package1?
    Which privileges of userA/userB on procedure1 and package1?

  • Stored procedure in  package return multiple columns from multiple tables

    Hi ,
    Can a single stored procedure return multiple column values from different tables.
    example:
    tabA: col2, tabB:col3,tabC:col4 etc.
    one more question:
    if a stored procedure like to return 10 columns for a particular record from a single table do i need to define a TYPE statement for each colum like
    TYPE col1 is TABLE of varchar
    TYPE col2 is TABLE of varchar
    here i want to return only one row, not many rows.
    thanks

    You can try one procedure with OUT or IN/OUT parameters that collect the values from one or more sql statements.
    CREATE OR REPLACE PROCEDURE P1
    (P_COD IN TABLE.COD%TYPE,
    P_DESC1 OUT TABLE1.DESC1%TYPE,
    P_DESC2 OUT TABLE2.DESC2%TYPE)
    IS
    BEGIN
    SELECT table1.DESC1, table2.DESC2
    INTO P_DESC1, P_DESC2
    FROM TABLE1, table2 WHERE
    table1.COD = P_COD and
    table1.cod = table2.cod ;
    END P1;
    JP

  • Is there a way I can see the status of a running stored procedure?

    I have a stored procedure that takes quite a bit of time and I was wondering if there is a way I can monitor it's status?
    Thanks!

    One thing you can do is add some calls to dbms_application_info to your procedure.
    Then you can monitor the progress by querying v$session.
    More info here:
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_appinf.htm

  • Can't run stored proc after migration to Active Directory

    I just moved our company's SQL server 2000 server from our
    old NT domain to our new Active Directory. After makign this
    switch, i noticed one thing that won't work right.
    it is a coldfusion page that calls a stored procedure on the
    SQL server using the followign code:L
    <cfstoredproc procedure="dbo.erehabDTS_import"
    datasource="#Application.DSN#"
    returncode="yes">
    the stored procedure then calls a DTS package which imports
    data from a text file (uploaded by the CF page) into a SQL server
    table. It all worked before moving to active directory, but now
    when i run the CF page, i get the following error:
    Error Executing Database Query.
    [Macromedia][SQLServer JDBC Driver][SQLServer]xpsql.cpp:
    Error 1788 from LogonUserW on line 620
    Error Code: HY000
    NativeErrorCode: 50001
    can someone please help?

    If you are not already using the latest JDBC drivers (ver
    3.5), upgrade to them. The new microsoft sql driver has updated
    code for doing NTAuthentication logins. Test with it.
    Get the
    Technote
    and download the zip. Apply both files as indicated. There are
    instructions for using NTAuth in the technote. Make sure to follow
    those. If you are using ntauth., make sure the ColdFusionMX
    application service is running as that user in the services
    applet.

Maybe you are looking for

  • Problem in displaying Total No.of Lines in ALV report header.

    Hi guys, my field symbol internal table is having records in which "Compliance" field is having YES or NO values. now requirement is to display Total No. of Compliances which are having YES. lets say, internal table is having 10 lines. in which compl

  • Opens Raw by Default

    Hi all, I have Bridge CS3 version 2.1.1.9. I want to open my JPG files so it opens using Photoshop CS3, by double clicking on the image. But when I double click on the JPG or TIFF files, Camera RAW 4.5 opens automatically. I have right clicked on the

  • Acrobat 9 PRO Installation Error

    Receive error message when I try to install Acrobat 9 Pro - once it reaches 99.96% of the installation, a Window's popup box opens with the following: "Setup.exe has stopped working.  A problem caused the program to stop working correctly.  Windows w

  • Motion Menus *Multiple menus problem(

    Hi all! Yesterday I created a motion menu according to another post here. The main issue I was trying to solve was this: I want the viewer (ie the person watching it) to see a short animation when they navigate around in the menu. By that I mean that

  • Reverse +/- Signs

    hello, can anybody help me please? i marked a node in a hierarchy as "reverse +/- sign", but it had no effect on the query i executed in bex-analyzer with this hierarchy! does anyone know this issue? thanks, florian