ORA-01001 in Form Based on Stored Proc.

I'm getting ORA-01001 when the form passes parameters
to the stored procedure:
Error Executing Cursor
SQL:
begin
"ABSUSR"."P_PORTAL_RPTS1" ( P_RPT_NAME => 'Print1',
P_ST_DATE => '01-OCT-01', P_EN_DATE => '04-JUN-02',
P_FORMAT => 'HTML', P_ROWS => '250');
end;
ORA-01001: invalid cursor
I can't see anything wrong with the parameters, and
the procedure works fine by itself. I also get a
script error when running the form as a portlet,
by itself, or in a page: "A runtime error has
occured: do you wish to debug? Line 2 Expected "("
But there is nothing obviously wrong with the
html that's presented for debugging. I have
searched for 1001 at Metalink and Portal Studio,
and found note 1007395.6 Common Causes of 1001.
I don't see that error checking is an issue,
and my OPEN_CURSORS is set to 300.
any thoughts or experience?
thanks and best wishes, Jon Angel HHS/PSC

Hi Jon ,
Can you explain your requirement in more detail as I'm not getting what may be wrong by your query.Please let me know what type of procedure is it.
and also please tell in what circumstances are u getting error when you make a portlet.
It will be nice if you can make a full test case of your requirement.
Hope to get details from you.
rahul

Similar Messages

  • Help: FORMS based on stored procedures

    I am working on a FORM based on stored procedures. This particular FORM performs a query and generates say,
    customer_name, item1_sale, item2_sale and sum of the item1_sale and item2_sale.
    I'd like to know if there are ways that the query procedure returns to reference cursors that one with multiple records and one with the sums? The FORM will then be able to show rows of sales and the bottom row with show the sale totals.
    Thank you in advance.
    Jimmy

    Francois,
    I just tried another way of getting the totals. I manually created a data block and add two items tot_1 and tot_2. I the item properties: I set calculation:
    calculation Mode: Summary
    Summary Function: Sum
    Sumary Block: BLOCK_A
    Summary Item: item1_sale etc.,
    I got a compile error:
    FRM-30377: Summary item must reside in single-record block or in same block as summarized item.
    Where do I catch this error?
    Thanks.
    Jimmy

  • Would like to create a file upload facility in a form based on stored procedure

    Hello,
    I would like to create a 'File Upload' in a 'form based on stored procedure'. The version of portal that I am running is 3.0.7.6.2. In this version, only 'form based on table' has the ability to upload files. Or is it that I am missing something?
    Please let me know if this is possible in higher versions of portal.
    Thank you for your help.
    Jayasree

    I have kin od fdone this by using the additem fucntion, if you look at the HTML of the add file page, you can see the parameter that are required for the form.

  • Help: FRM-40505 for a FORM based on stored procedures

    Hi,
    I am working on a FORM based on stored procedures. When it performs a query, it actually returns record, but still comes with the message FRM-40505: ORACLE error: unable to perform query. Any recommendations on the possible coding area to check?
    Thank you in advance.
    Jimmy

    Jimmy,
    To base a block on a stored procedure is not a simple task because it depends on the .....
    .... stored procedure !
    If you do not provide much information (like the famous stored procedure), we could not do anything for you.
    As much information you provide, as much chance we have to understand the problem.
    Francois

  • RAISING EXCEPTION AND SHOWING TO USERS IN FORM BASED ON STORED PROCEDURE

    I have a form based on stored procedure.
    I want to handle exceptions in the stored procedure and show it to users.
    Here is what i want to do.
    I have a sku# field in the form and i want to validate it(against the database
    table) in the procedure before inserting into the database.
    I want to give a message to users when the validation fails.
    How is this possible with the forms based on stored procedure?
    Can i use javascript to do the same?
    Thanks in Advance

    I have a form based on stored procedure.
    I want to handle exceptions in the stored procedure and show it to users.
    Here is what i want to do.
    I have a sku# field in the form and i want to validate it(against the database
    table) in the procedure before inserting into the database.
    I want to give a message to users when the validation fails.
    How is this possible with the forms based on stored procedure?
    Can i use javascript to do the same?
    Thanks in Advance

  • ORA-04020 Deadlock when trying to create form based on stored proceure

    Hi,
    I'm trying to create a form based on a stored procedure, and I'm getting " Failed to execute - Missing string(create_package_body) language(us) domain (wwv) sub_domain (wwv_builder) (WWV-04300)
    ORA-04020: deadlock detected while trying to lock object PUBLIC.WARRENP (WWV-11230)
    Failed to parse as PORTAL - (WWV-08300) " when I try to generate the form. I have created a new database provider (warrenp), and I've given it the same privs as the PORTAL_DEMO provider.
    GRANT EXECUTE ON PORTAL.WWCTX_API TO WARRENP;
    GRANT EXECUTE ON WWPRO_API_PARAMETERS TO WARRENP;
    GRANT EXECUTE ON WWPRO_API_INVALIDATION TO WARRENP;
    GRANT SELECT ON WWV_USER_CORNERS TO WARRENP;
    GRANT EXECUTE ON WWPOB_PAGE_UTIL TO WARRENP;
    I create a stored procedure
    CREATE OR REPLACE PROCEDURE sp_test (foo IN number) AS
    BEGIN
    NULL;
    END;
    GRANT EXECUTE ON sp_test TO PUBLIC;
    Then I try to create a form based on this procedure and it fails with the above error. I can create this procedure in the PORTAL_DEMO schema without problems. I can also create a form in the WARRENP provider based on PORTAL_DEMO.GIVE_RAISE and that works also.
    I'm on Portal 10G (9.0.4) on Linux, infrastructure database is 9.0.1.5.0.
    Can anyone tell me what I've missed in my setup?
    Thanks

    I've been informed that this is caused by database bug 2651669.

  • Default value type - validation option form based on stored procedure

    Please could somebody explain and provide an example of what the option :-
    default value type - in the validation options for a field in the editor for a form based on a stored procedure ?
    Thanks in anticipation.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Dmitry Nonkin([email protected]):
    Absolutely, you can use SQL query to return the value like in the example above:
    Default Value = select 5 from dual
    Default Value Type = 'SQL query returns number'
    or
    Thanks,
    Dmitry<HR></BLOCKQUOTE>
    Hi,
    and what about:
    Default Value = select max(salary) from emp_salaries
    Default Value Type = 'SQL query returns number'
    Will it work? We go some troubles with this.
    Thanx
    Marcin

  • Problem passing OUT parameters form based on stored procedure to another form?

    Hello,
    I am unable to pass parameters of type OUT from a form based on a stored procedure to another form.
    However, I am able to pass parameters of the type IN to the other form.
    This is the code that I have under the heading
    On successful submission of a form, execute this PL/SQL block or PL/SQL procedure:
    declare
    v_partno varchar2(100);
    v_partdesc varchar2(200);
    blk varchar2(10):='DEFAULT';
    v_names varchar2(1000);
    v_values varchar2(1000);
    begin
    v_partno:=p_session.get_value_as_varchar2
    (p_block_name=>blk,p_attribute_name=>'A_PART_NO');
    v_partdesc:=p_session.get_value_as_varchar2
    (p_block_name=>blk,p_attribute_name=>'A_PART_DESC');
    v_names := '_moduleid:_show_header:pnumber:pdescription';
    v_values := '1325575336:YES:' || LTRIM(TO_CHAR(v_partno)) || ':' || LTRIM(TO_CHAR(v_partdesc)) ;
    PORTAL.wwa_app_module.link (
    p_arg_names => PORTAL.wwv_standard_util.string_to_table2(v_names),
    p_arg_values => PORTAL.wwv_standard_util.string_to_table2(v_values));
    end
    Info:
    1. Passing PART_NO (IN parameter) and PART_DESC (OUT paramter) to another form.
    2. After hitting the submit button, the second form comes up, but with only the PART_NO(type IN) field completed. The PART_DESC(type OUT) field did not get passed to the second form.
    3. The corresponding fields in the second form are pnumber & pdescription.
    4. FYI - I can see all the OUT parameters correctly, if I don't try to pass control to the second form.
    5. Portal 9.0.2 ( the version that ships with IAS 9.0.2)
    Any help would be greatly appreciated. I have been stuck here for a while now!
    Dev

    Re: Error
    Passing OUT parameter to another form.
    You cannot retrieve the value of the OUT parameter from the session object because after executing your procedure,
    the value passed out using the OUT parameter is not loaded in the session object.
    But you can still achieve what you are trying in the following way.
    Let's assume that your procedure has the following str :-
    procedure proc1 (p_in in varchar2,
    p_out out varchar2)
    is
    begin
    /* your processing statements
    end;
    Say, the name of the field, in the 2nd form, where you need to pass the out parameter value is VALUE_FROM_OUT.
    1> Edit the form on procedure proc1
    2> Select the submit button in the left frame and for the PL/SQL button handler choose Submit action.
    3> In the adjacent textarea, comment out the doSubmit statement and use code given below :-
    declare
    l_p_in varchar2(32767);
    l_p_out varchar2(32767);
    l_url varchar2(2000);
    begin
    l_p_in := p_session.get_value_as_varchar2(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_P_IN');
    execute immediate
    'begin <schema>.proc1(:b_in,:b_out); end;'
    using in l_p_in, out l_p_out;
    l_url := 'http://<host>:<port>/pls/<dad>/<portal-schema>.wwa_app_module.link?p_arg_name=_moduleid&p_arg_values=<module_id>&p_arg_names=VALUE_FROM_OUT&p_arg_values='||
    <portal-schema>.wwv_standard_util.url_encode(l_p_out);
    <portal-schema>.wwa_app_module.set_target(l_url,'CALL');
    end;
    NOTE :
    ======
    In the code given above, replace
    <schema> with the schema name that owns the procedure proc1
    <host> with webserver host
    <port> with the port of your webserver
    <dad> with the portal dad
    <portal-schema> with the name of the portal-schema
    <module_id> with the module of the 2nd form i.e. where you need to pass the value of the out variable.
    You will have to grant execute privilege on procedure proc1 to your application schema,
    if the procedure proc1 lies in a schema other than the application schema.
    4> Finish editing the form.

  • Form Based on Stored Procedure

    I have an application (STAR_PORTAL) that is owned by the 'STARS3' schema. I want to create a form based on a stored procedure. The procedure ('select_empname') is stored in a package ('star_portal') that is owned by the portal30 user. When I get to the point where I link the form to the procedure, it does not see it. I have tried granting execute on star_portal to public and stars3.

    We will checkup this issue why you do not see the procedure (most probably because it is a packaged procedure).
    Meanwhile, you can continue creating the form by typing in:-
    portal30.star_portal.select_empname
    where you need to specify the procedure name.

  • Creating a BC4J EO Based on Stored Proc w/DB assigned PK using Seq/Trigge

    BC4J Code-o-philes;
    Using Steven Muench article "Creating a BC4J Entity Object Based on Stored Procedures" (HOWTO: Basing BC4J Entity on Stored Procedure as a starting point, I would like to modify that example to use a Stored Procedure where the Primary Keys of the Department Table are assigned by a DB Sequence/Before trigger. I already have the stored procedure and sequence/trigger working fine in SQL*Plus.
    The assumption I have is that code below needs to be modified, but I'm not sure exactly what need to be done to retreive the DB assigned PK.
    Lastly, I think that JDeveloper should be doing this automatically, maybe next release?
    Bill G...
    void handleStoredProcInsert() {
    CallableStatement st = null;
    try {
    String stmt = "BEGIN hr.do_insert(?,?,?); END;";
    DBTransaction tr = getDBTransaction();
    st = tr.createCallableStatement(stmt,1);
    /* st.setLong(1,getDepartmentId().longValue()); */
    st.registerOutParameter(3,Types.NUMERIC);
    if (getDepartmentName() != null) {
    st.setString(1,getDepartmentName());
    else {
    st.setNull(1,Types.VARCHAR);
    if (getLocationId() != null) {
    st.setLong(2,getLocationId().longValue());
    else {
    st.setNull(2,Types.VARCHAR);
    int rows = st.executeUpdate();
    Long newId = new Long(st.getLong(3));
    populateAttributeAsChanged(DEPARTMENTID, new DBSequence(newId));
    catch (SQLException s) {
    throw new JboException(s);
    finally {
    try {
    if (st != null) st.close();
    catch (SQLException s) { /* ignore */}

    ARGHHHHHHHHHHHHHH!
    I've change the line
    st.setLong(1,getDepartmentId().longValue());
    to
    st.setLong(1,getSequenceNumber().longValue());
    And I'm still getting Error(303,20): method getSequenceNumber not found in class stproc.DepartmentsImpl.
    even though i've imported "oracle.jbo.domain.DBSequence;"
    The code below is taken from the BC4J StoredProc sample and is what I want to modify to get it working with DB/Triggers.
    BG...
    package stproc;
    import java.math.BigDecimal;
    import java.lang.Math;
    import java.sql.CallableStatement;
    import java.sql.SQLException;
    import java.sql.Types;
    import oracle.jbo.JboException;
    import oracle.jbo.Key;
    import oracle.jbo.RowInconsistentException;
    import oracle.jbo.RowIterator;
    import oracle.jbo.domain.Number;
    import oracle.jbo.server.AttributeDefImpl;
    import oracle.jbo.server.DBTransaction;
    import oracle.jbo.server.EntityDefImpl;
    import oracle.jbo.server.EntityImpl;
    import oracle.jbo.server.TransactionEvent;
    import oracle.jbo.AlreadyLockedException;
    import oracle.jbo.domain.DBSequence;
    // --- File generated by Oracle Business Components for Java.
    public class DepartmentsImpl extends EntityImpl
    protected static final int DEPARTMENTID = 0;
    protected static final int DEPARTMENTNAME = 1;
    protected static final int LOCATIONID = 2;
    private static EntityDefImpl mDefinitionObject;
    * This is the default constructor (do not remove)
    public DepartmentsImpl()
    * Retrieves the definition object for this instance class.
    public static synchronized EntityDefImpl getDefinitionObject()
    if (mDefinitionObject == null)
    mDefinitionObject = (EntityDefImpl)EntityDefImpl.findDefObject("stproc.Departments");
    return mDefinitionObject;
    * Gets the attribute value for DepartmentId, using the alias name DepartmentId
    public DBSequence getDepartmentId()
    return (DBSequence)getAttributeInternal(DEPARTMENTID);
    * Sets <code>value</code> as the attribute value for DepartmentId
    public void setDepartmentId(DBSequence value)
    setAttributeInternal(DEPARTMENTID, value);
    * Gets the attribute value for DepartmentName, using the alias name DepartmentName
    public String getDepartmentName()
    return (String)getAttributeInternal(DEPARTMENTNAME);
    * Sets <code>value</code> as the attribute value for DepartmentName
    public void setDepartmentName(String value)
    setAttributeInternal(DEPARTMENTNAME, value);
    * Gets the attribute value for LocationId, using the alias name LocationId
    public Number getLocationId()
    return (Number)getAttributeInternal(LOCATIONID);
    * Sets <code>value</code> as the attribute value for LocationId
    public void setLocationId(Number value)
    setAttributeInternal(LOCATIONID, value);
    // Generated method. Do not modify.
    protected Object getAttrInvokeAccessor(int index, AttributeDefImpl attrDef) throws Exception
    switch (index)
    case DEPARTMENTID:
    return getDepartmentId();
    case DEPARTMENTNAME:
    return getDepartmentName();
    case LOCATIONID:
    return getLocationId();
    default:
    return super.getAttrInvokeAccessor(index, attrDef);
    // Generated method. Do not modify.
    protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception
    switch (index)
    case DEPARTMENTID:
    setDepartmentId((DBSequence)value);
    return;
    case DEPARTMENTNAME:
    setDepartmentName((String)value);
    return;
    case LOCATIONID:
    setLocationId((Number)value);
    return;
    default:
    super.setAttrInvokeAccessor(index, value, attrDef);
    return;
    protected void doSelect(boolean lock) {
    if (lock) {
    this.handleStoredProcLock();
    else {
    this.handleStoredProcSelect();
    public void doDML(int operation, TransactionEvent e) {
    switch (operation) {
    case DML_INSERT: {
    handleStoredProcInsert();
    break;
    case DML_UPDATE: {
    handleStoredProcUpdate();
    break;
    case DML_DELETE: {
    handleStoredProcDelete();
    break;
    void handleStoredProcSelect() {
    CallableStatement st = null;
    try {
    String stmt = "BEGIN hr.do_select(?,?,?); END;";
    DBTransaction tr = getDBTransaction();
    st = tr.createCallableStatement(stmt,1);
    /* st.setLong(1,getDepartmentId().longValue()); */
    st.registerOutParameter(2,Types.VARCHAR);
    st.registerOutParameter(3,Types.NUMERIC);
    int rows = st.executeUpdate();
    populateAttribute(DEPARTMENTNAME,st.getString(2),true,false);
    populateAttribute(LOCATIONID,st.getBigDecimal(3),true,false);
    catch (SQLException s) {
    throw new JboException(s);
    finally {
    try {
    if (st != null) st.close();
    catch (SQLException s) { /* ignore */}
    void handleStoredProcDelete() {
    CallableStatement st = null;
    try {
    String stmt = "BEGIN hr.do_delete(?); END;";
    DBTransaction tr = getDBTransaction();
    st = tr.createCallableStatement(stmt,1);
    /* st.setLong(1,getDepartmentId().longValue()); */ // bg mod
    st.registerOutParameter(1,Types.NUMERIC); // bg add
    int rows = st.executeUpdate();
    catch (SQLException s) {
    throw new JboException(s);
    finally {
    try {
    if (st != null) st.close();
    catch (SQLException s) { /* ignore */}
    void handleStoredProcInsert() {
    CallableStatement st = null;
    try {
    String stmt = "BEGIN hr.do_insert(?,?,?); END;";
    DBTransaction tr = getDBTransaction();
    st = tr.createCallableStatement(stmt,1);
    /* st.setLong(1,getDepartmentId().longValue()); */ // bg mod
    st.registerOutParameter(3,Types.NUMERIC);
    if (getDepartmentName() != null) {
    st.setString(1,getDepartmentName());
    else {
    st.setNull(1,Types.VARCHAR);
    if (getLocationId() != null) {
    st.setLong(2,getLocationId().longValue());
    else {
    st.setNull(2,Types.VARCHAR);
    int rows = st.executeUpdate();
    Long newId = new Long(st.getLong(3));
    populateAttributeAsChanged(DEPARTMENTID, new DBSequence(newId));
    catch (SQLException s) {
    throw new JboException(s);
    finally {
    try {
    if (st != null) st.close();
    catch (SQLException s) { /* ignore */}
    void handleStoredProcUpdate() {
    CallableStatement st = null;
    try {
    String stmt = "BEGIN hr.do_update(?,?,?); END;";
    DBTransaction tr = getDBTransaction();
    st = tr.createCallableStatement(stmt,1);
    /* st.setLong(1,getDepartmentId().longValue()); */ // bg mod
    /* dbSeqVal.getSequenceNumber().longValue() */
    st.setLong(1,getSequenceNumber().longValue());
    if (getDepartmentName() != null) {
    st.setString(2,getDepartmentName());
    else {
    st.setNull(2,Types.VARCHAR);
    if (getLocationId() != null) {
    st.setLong(3,getLocationId().longValue());
    else {
    st.setNull(3,Types.VARCHAR);
    int rows = st.executeUpdate();
    catch (SQLException s) {
    throw new JboException(s);
    finally {
    try {
    if (st != null) st.close();
    catch (SQLException s) { /* ignore */}
    void handleStoredProcLock() {
    CallableStatement st = null;
    try {
    String stmt = "BEGIN hr.do_lock(?,?,?); END;";
    DBTransaction tr = getDBTransaction();
    st = tr.createCallableStatement(stmt,1);
    /* st.setLong(1,getDepartmentId().longValue()); */ // bg mod
    st.registerOutParameter(2,Types.VARCHAR);
    st.registerOutParameter(3,Types.NUMERIC);
    int rows = st.executeUpdate();
    String newDname = st.getString(2);
    BigDecimal newLoc = st.getBigDecimal(3);
    // Compare the old values to the current values to
    // detect if row has changed.
    compareOldAttrTo(DEPARTMENTNAME,newDname);
    compareOldAttrTo(LOCATIONID,newLoc);
    catch (SQLException s) {
    if (Math.abs(s.getErrorCode())==54) {
    throw new AlreadyLockedException(s);
    else {
    throw new JboException(s);
    finally {
    try {
    if (st != null) st.close();
    catch (SQLException s) { /* ignore */}
    void compareOldAttrTo(int slot, Object newVal) {
    if ((getPostedAttribute(slot) == null && newVal != null) ||
    (getPostedAttribute(slot) != null && newVal == null) ||
    (getPostedAttribute(slot) != null && newVal != null &&
    !getPostedAttribute(slot).equals(newVal))) {
    throw new RowInconsistentException(createPrimaryKey(getDepartmentId()));
    * Creates a Key object based on given key constituents
    public static Key createPrimaryKey(DBSequence departmentId)
    return new Key(new Object[] {departmentId});
    }

  • Adding fields to a form based on stored procedure

    I have a store procedure and a form based on it. I'd added a new parameter to the store procedure. How can I do to add a field in the form which takes the new parameter. I'd tried adding a new field with the same name of the parameter but it didn't work.
    Thanx

    Hi,
    It should work fine. What is the problem you are facing? Are you getting any error?
    Thanks,
    Sharmila

  • Subreport based on stored proc - parameter problem

    Hello all,
    I have a problem to link formula field from main report to parameter in subreport.
    My subreport based on stored procedure with 3 parameters: month, year, typeID. I have 2 parameters in main report: month, year and they linked to subreport's ones without any problem. For third subreport parameter typeID I have formula in main report. I can link them together in Subreport Link window but when I try to run it I get error: stored procedure expects parameter typeid that's not specified.
    How to resolve this?
    Thanks!

    OK. First of all - I'm using CR XI R2.
    I have main report with like 20 subreports. Each subreport based on stored procedure with 3 parameters: month, year and repID. Based on this RepID I use different calculation for subreports.
    Main report has 2 parameters: month and year and 20 formulas for report type id: Type1, Type2 etc. Each of these formulas contain report id like 601, 602, 603 etc. I have no problem to link two main report parameters to all subreports. Then I linked all those fomulas to corresponding subreport typeID. FE: for first subreport: formula Type1 from main rep linked to parID from subreport1. Type2 linked to typeID from subreport2 etc. Reason I did it because I will have probably even more subreports and I don't want to have prompt with like 20 parameters typeID. But when I run it it looks lie subreport can't see this formula...

  • Block based on stored proc

    Can anyone help me creating a block based on stored procedure. I
    need to query the block based on some user input condition, like
    EMP_NAME LIKE 'JOHN%'.
    The demo procedure just retrieves all records and my question is
    how do we pass the WHERE condition that will be built based on
    user input, to the stored procedure.
    TIA,
    -Ebenezer
    null

    dear Ebenezer,
    Try passing it through an in parameter as a varchar2. in your
    procedure you can use dbms_sql to build your query.
    l8r
    george
    Ebenezer (guest) wrote:
    : Can anyone help me creating a block based on stored procedure.
    I
    : need to query the block based on some user input condition,
    like
    : EMP_NAME LIKE 'JOHN%'.
    : The demo procedure just retrieves all records and my question
    is
    : how do we pass the WHERE condition that will be built based on
    : user input, to the stored procedure.
    : TIA,
    : -Ebenezer
    null

  • View link between view based on entity(table) and view based on stored proc

    I've created a view based on a stored procedure. I need to link this view to a view based on an entity which is based on a table.
    I can create the view without issue, but when I attempt to run the application module that contains the relationship I get this error:
    (oracle.jbo.InvalidOperException) JBO-26016: Cannot set user query to view "SalesentityModuleApiView2" because it is a destination in a view link
    One thing that may be notable about this is that this view started out based on a database view. I later overrode the select related methods using the example here:
    http://download-east.oracle.com/docs/html/B25947_01/bcadvvo008.htm
    Any ideas? I will gladly post some code if someone will let me know what might help diagnose this.

    Hi,
    I solved my problem with adding transient field, and changing the value of it (true | false) on set method of field that can be changed so I can get which row was updated. What exactly do you mean when you say not updateable, I'm using a vo with no entity, and I can add, remove rows, in fact I think it's a good solution because I don't want to write to database immediately.

  • Help: Trying to pass a parameter to stored proc from FORMS

    I am working on a FORMS based on stored procedure with 7 parameters. All parameters work except p_sort for ORDER BY CLAUSE.
    Any suggestions?
    Thank you in advance.
    Jimmy

    pls post some more details .

Maybe you are looking for