How to call a PL/SQL Procedure from a Report Column Hyperlink

Hallo!
Normally a link on a column value in a report leads you to a page in your application or to another URL.
And you can send the value of this cell to the calling page.
I want, that oracle executes a procedure with the values as in-Parameters if I click on this hyperlink.
Must I call a dummy page and define this procedure in the header of this page or exit there other ways?
Can you give ma an example?
Thanks a lot!
Gerhard

Paul - When a column link is used to invoke a On Demand Process in that way, wouldn't that result in a blank page (unless of course the ODP emits a well-formed HTML document)? You could set the link target to a no-op like *#* and use a onclick handler in the Link Attributes to call a Javascript that uses the htmldb_get object to call the ODP. In fact, I don't think I have ever seen a ODP used in any other context.

Similar Messages

  • How to call a PL/SQL procedure from a Java class?

    Hi,
    I am new to the E-BusinessSuite and I want to develop a Portal with Java Portlets which display and write data from some E-Business databases (e.g. Customer Relationship Management or Human Resource). These data have been defined in the TCA (Trading Community Architecture) data model. I can access this data with PL/SQL API's. The next problem is how to get the data in the Java class. So, how do you call a PL/SQL procedure from a Java program?
    Can anyone let me know how to solve that problem?
    Thanks in advance,
    Chang Si Chou

    Have a look at this example:
    final ApplicationModule am = panelBinding.getApplicationModule();
    try
         final CallableStatement stmt = ((DBTransaction)am.getTransaction()).
                                                                                         createCallableStatement("{? = call some_pck.some_function(?, ?)}", 10);
         stmt.registerOutParameter(1, OracleTypes.VARCHAR);
         stmt.setInt(2, ((oracle.jbo.domain.Number)key.getAttribute(0)).intValue());
         stmt.setString(3, "Test");
         stmt.execute();
         stmt.close();
         return stmt.getString(1);
    catch (Exception ex)
         panelBinding.reportException(ex);
         return null;
    }Hope This Helps

  • How to call a PL/SQL procedure from Portal

    Env.Info: Windows NT Server 4 (Service Pack 3) / Oracle 8i R3 EE / Oracle Portal 3.0 Production.
    I created a new schema "BISAPPS" and created a user with the same name. Ran provsyns.sql script to grant Portal API access. Created a new package under this new schema and compiled it against the database. After that I registered the schema as a portal provider. There were no errors.
    Now I logged into Portal using the account PORTAL30. Refreshed the portlet repository and the new portlets appeared. I added the new portlet to the page. It is displayed successfully.
    New portlet allows the user to enter a bug-number and lets the user to either view or edit. If the user clicks on the button "Edit", it opens a new window and displays the contents from BugDB application. But if the user clicks on "Show", it should display the output generated by a PL/SQL procedure (Owned by the above New Schema - BISAPPS) in a separate window. But instead it is displaying the following error in the separate window:
    bisapps_pkg.buginfo: PROCEDURE DOESN'T EXIST.
    DAD name: PORTAL30
    PROCEDURE : bisapps_pkg.buginfo
    URL : http://host_name:80/pls/portal30/bisapps_pkg.buginfo
    And list of environment variables ....
    Can anyone help me? How can I call a PL/SQL procedure when the button is clicked? Thanks in advance.

    You must grant EXECUTE privilege on your procedure to the PORTAL30_PUBLIC user. If the error still persists, create a PUBLIC synonym for your procedure.

  • How to call a PL/SQL procedure from a xml Data Template

    We have a requirement in which we need to call a pl/sql package.(dot)procedure from a Data Template of XML Publisher.
    we have registered a Data Template & a RTF Template in the XML Publisher Responsibility in the Oracle 11.5.10 instance(Front End).
    In the Data Query part of the Data Template , we have to get the data from a Custom View.
    This view needs to be populated by a PL/SQL procedure.And this procedure needs to be called from this Data Template only.
    Can anybody suggest the solution.
    Thanks,
    Sachin

    Call the procecure in the After Parameter Form trigger, which can be scripted in the Data Template.
    BTW, there is a specialized XML Publisher forum:
    BI Publisher

  • Error when try to call a pl/sql procedure from the .xsql file

    I tried to call a pl/sql procedure like this:
    <?xml version="1.0"?>
    <page connection="omtest5" xmlns:xsql="urn:oracle-xsql">
    <xsql:include-owa>
    sampleowaxml.testone
    </xsql:include-owa>
    </page>
    but I got the following error message:
    <?xml version="1.0" ?>
    - <page>
    - <xsql-error action="xsql:include-owa">
    <statement>declare buf htp.htbuf_arr; param_names owa.vc_arr; param_values owa.vc_arr; rows integer := 32767; outclob CLOB;begin param_names(1) := 'HTTP_COOKIE'; param_values(1) := ''; param_names(2) := 'SERVER_NAME'; param_values(2) := 'mxfang-nt.us.oracle.com'; param_names(3) := 'SERVER_PORT'; param_values(3) := '80'; param_names(4) := 'SCRIPT_NAME'; param_values(4) := '/servlets/oracle.xml.xsql.XSQLServlet'; param_names(5) := 'PATH_INFO'; param_values(5) := '/xsql/test/myproject.xsql'; param_names(6) := 'HTTP_USER_AGENT'; param_values(6) := 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)'; owa.init_cgi_env(6,param_names,param_values); sampleowaxml.testone owa.get_page(buf,rows); dbms_lob.createtemporary(outclob,true,dbms_lob.session); for i in 1..rows loop dbms_lob.writeappend(outclob,length(buf(i)),buf(i)); end loop; ? := outclob; ? := DBMS_LOB.INSTR(outclob,CHR(10)&#0124; &#0124;CHR(10));end;</statement>
    <message>ORA-06550: line 3, column 3: PLS-00103: Encountered the symbol "OWA" when expecting one of the following: := . ( @ % ; The symbol ":=" was substituted for "OWA" to continue.</message>
    </xsql-error>
    - <xsql-error action="xsql:include-owa">
    <message />
    </xsql-error>
    </page>
    This error message is very similiar to the message that Shanthir posted on Jan, 21. I did run the dbmslob.sql, but it doesn't help. Anybody has ideas how to solve it?
    I used the PL/SQL web toolkit provided by OAS4.0.8.1. I believe oracle web agent is replaced by this toolkit.
    Thanks,
    Min
    null

    Hi,
    Glad that somebody else too got this problem. Well, as I had mentioned in my previous posting too, I think there are some procedures in the package, dbms_lob, like the writeappend, createtemporary etc.. which is not found in my dbms_lob.sql file, I am using 8.0.5, but I found these procedures in the 8i, I think it is becos of that.
    By the way if anybody got this solution and got any workaround, please help me too.
    I am still waiting for the solution to that.
    Shanthi

  • How to call a Oracle Stored Procedure from Excel?

    Hi,
    I am new to Oracle database programming.I have an application in excel which has to update info in every row to the database.I am calling a stored procedure in excel for this.The stored procedure is as follows which is executing without a hitch in Oracle:
    CREATE OR REPLACE PROCEDURE APD_MASS_UPLOAD_UNITS
    (PRODUCT_ID VARCHAR2,Product_Code VARCHAR2, str_Adpt_Grp VARCHAR2,str_Adpt_Type VARCHAR2,
    str_PDC VARCHAR2,str_Release_ID VARCHAR2,str_Created_by VARCHAR2,
    str_Last_Updated_By VARCHAR2, dt_created_Date VARCHAR2,dt_Last_Updated_Date VARCHAR2,
    StrMonth1 VARCHAR2,strMth2 VARCHAR2,StrMth3 VARCHAR2,StrMth4 VARCHAR2,
    StrMth5 VARCHAR2,StrMth6 VARCHAR2,Sample Varchar2,str_message OUT Varchar2)
    AS
    type Month_type is table of VARCHAR2(10) index by binary_integer;
    str_month Month_Type;
    Fac_ID VARCHAR2(20);
    Org_ID VARCHAR2(20);
    Cnt_Units NUMBER;
    i_POS NUMBER;
    i_Month NUMBER;
    i_UNITS NUMBER;
    CURSOR C1 IS
    SELECT * FROM TBLLINE_ADOPT_PLAN WHERE SPEC_ID = Product_ID AND
    ADOPT_GROUP = str_Adpt_Grp AND ADOPT_TYPE = str_Adpt_Type
    AND RELEASE_ID = APD_Get_Release_ID(str_PDC,str_Release_Id);
    CURSOR C2 IS
    SELECT FACILITY_ID FROM TBLADOPT_GROUP_CSC WHERE ADOPT_GROUP = str_Adpt_Grp;
    CURSOR C3 IS
    SELECT ORG_ID FROM APD_DV_PRODUCT_V WHERE SPEC_ID = Product_ID;
    CURSOR C4 IS
    SELECT * FROM TBLPROD_CSC WHERE PROD_SPEC_ID = Product_ID;
    Adopt_Rec C1%ROWTYPE;
    Fac_Rec C2%ROWTYPE;
    PMORG_REC C3%ROWTYPE;
    CSC_Rec C4%ROWTYPE;
    i_Count NUMBER;
    Message VARCHAR2(20);
    BEGIN
    Message := APD_SPECID_VALIDATE(Product_ID,Product_code,Str_PDC, str_Release_ID);
    IF TRIM(Message) is null then
    OPEN C1;
    FETCH C1 INTO Adopt_Rec;
    IF C1%NOTFOUND THEN
    INSERT INTO TBLLINE_ADOPT_PLAN (SPEC_ID,ADOPT_GROUP, ADOPT_TYPE,RELEASE_ID, SAMPLES,CREATED_BY,CREATED_DATE, LAST_UPDATED_BY,LAST_UPDATED_DATE,SAMPLE_ONLY_IND, GRID_TYPE_CD) VALUES
    (Product_ID,str_Adpt_Grp ,str_Adpt_Type,
    APD_Get_Release_ID(str_PDC,str_Release_Id), 0,str_Created_By,
    TO_DATE(dt_Created_Date,'DD/MM/YYYY'),str_Last_Updated_By,
    TO_DATE(dt_Last_Updated_Date,'DD/MM/YYYY'),'N','C');
    END IF;
    CLOSE C1;
    str_Month(1) := strMonth1;
    str_Month(2) := strMth2;
    str_Month(3) := strMth3;
    str_Month(4) := strMth4;
    str_Month(5) := strMth5;
    str_Month(6) := strMth6;
    OPEN C2;
    FETCH C2 INTO Fac_REC;
    Fac_ID := Fac_Rec.FACILITY_ID;
    CLOSE C2;
    OPEN C3;
    FETCH C3 INTO PMORG_Rec;
    Org_ID := PMORG_Rec.Org_ID;
    CLOSE C3;
    OPEN C4;
    FETCH C4 INTO CSC_Rec;
    IF C4%NOTFOUND THEN
    INSERT INTO TBLPROD_CSC(PROD_SPEC_ID,CSC_FACILITY_ID, PROFIT_CENTER_CD,DEFAULT_IND, CREATED_BY, CREATED_DATE, LAST_UPDATED_BY, LAST_UPDATED_DATE) VALUES
    (Product_ID , Fac_ID,Org_id, 'N', str_Created_by ,
    To_date ( dt_Created_Date,'DD/MM/YYYY') ,str_Last_updated_by ,
    To_Date (dt_Last_Updated_Date ,'DD/MM/YYYY'));
    END IF;
    CLOSE C4;
    IF Sample > 0 Then
    UPDATE TBLLINE_ADOPT_PLAN
    SET SAMPLES = Sample
    WHERE SPEC_ID = Product_ID AND
    ADOPT_GROUP = str_adpt_grp AND
    ADOPT_TYPE = str_Adpt_Type AND
    RELEASE_ID = APD_Get_Release_ID(str_PDC,str_Release_Id);
    END IF;
    str_Message := 'Updated';
    END IF;
    END;
    The code to call the stored procedure in Excel is as follows:
    Dim Conn As New ADODB.Connection
    Dim InputParam1 As New ADODB.Parameter
    Dim InputParam2 As New ADODB.Parameter
    Dim InputParam3 As New ADODB.Parameter
    Dim InputParam4 As New ADODB.Parameter
    Dim InputParam5 As New ADODB.Parameter
    Dim InputParam6 As New ADODB.Parameter
    Dim InputParam7 As New ADODB.Parameter
    Dim InputParam8 As New ADODB.Parameter
    Dim InputParam9 As New ADODB.Parameter
    Dim InputParam10 As New ADODB.Parameter
    Dim InputParam11 As New ADODB.Parameter
    Dim InputParam12 As New ADODB.Parameter
    Dim InputParam13 As New ADODB.Parameter
    Dim InputParam14 As New ADODB.Parameter
    Dim InputParam15 As New ADODB.Parameter
    Dim InputParam16 As New ADODB.Parameter
    Dim InputParam17 As New ADODB.Parameter
    Dim InputParam18 As New ADODB.Parameter
    Dim OutputParam As New ADODB.Parameter
    Dim Mth1, Mth2, Mth3, Mth4, Mth5, Mth6 As String
    Dim Rs_data As New ADODB.Recordset
    Conn.ConnectionString = ("Provider=MSDAORA.1;User ID=" & "cnbg" & ";PASSWORD=" & "cnbg" & ";Data Source=" & "DAQ01" & ";Persist Security Info=False")
    Conn.Open
    OraCmd.ActiveConnection = Conn
    OraCmd.CommandText = "APD_MASS_UPLOAD_UNITS"
    OraCmd.CommandType = adCmdStoredProc
    Conn.CursorLocation = adUseClient
    OraCmd.Parameters.Refresh
    Set InputParam1 = OraCmd.CreateParameter("Product_ID", adVarChar, adParamInput, 20)
    InputParam1.Value = spec_id
    Set InputParam2 = OraCmd.CreateParameter("Product_code", adVarChar, adParamInput, 20)
    InputParam2.Value = str_product_code
    Set InputParam3 = OraCmd.CreateParameter("str_Adpt_Type", adVarChar, adParamInput, 10)
    InputParam3.Value = Adopt_Group
    Set InputParam4 = OraCmd.CreateParameter("str_Adpt_Type", adVarChar, adParamInput, 10)
    InputParam4.Value = Adopt_Type
    Set InputParam5 = OraCmd.CreateParameter("str_pdc", adVarChar, adParamInput, 10)
    InputParam5.Value = ThisWorkbook.strDbPDC
    Set InputParam6 = OraCmd.CreateParameter("str_Release_ID", adVarChar, adParamInput, 10)
    InputParam6.Value = str_Release_Id
    Set InputParam7 = OraCmd.CreateParameter("str_created_by", adVarChar, adParamInput, 10)
    InputParam7.Value = ThisWorkbook.User_Name
    Set InputParam8 = OraCmd.CreateParameter("str_last_updated_by", adVarChar, adParamInput, 10)
    InputParam8.Value = ThisWorkbook.User_Name
    Set InputParam9 = OraCmd.CreateParameter("dt_created_date", adVarChar, adParamInput, 10)
    InputParam9.Value = Sheet1.Cells(8, 2)
    Set InputParam10 = OraCmd.CreateParameter("dt_Last_Updated_Date", adVarChar, adParamInput, 10)
    InputParam10.Value = Sheet1.Cells(8, 2)
    Set InputParam11 = OraCmd.CreateParameter("strMonth1", adVarChar, adParamInput, 10)
    InputParam11.Value = Mth1
    Set InputParam12 = OraCmd.CreateParameter("strMth2", adVarChar, adParamInput, 10)
    InputParam12.Value = Mth2
    Set InputParam13 = OraCmd.CreateParameter("strMth3", adVarChar, adParamInput, 10)
    InputParam13.Value = Mth3
    Set InputParam14 = OraCmd.CreateParameter("strMth4", adVarChar, adParamInput, 10)
    InputParam14.Value = Mth4
    Set InputParam15 = OraCmd.CreateParameter("strMth5", adVarChar, adParamInput, 10)
    InputParam15.Value = Mth5
    Set InputParam16 = OraCmd.CreateParameter("strMth6", adVarChar, adParamInput, 10)
    InputParam16.Value = Mth6
    Set InputParam17 = OraCmd.CreateParameter("Sample", adInteger, adParamInput, 10)
    InputParam17.Value = 0
    Set InputParam18 = OraCmd.CreateParameter("str_message", adVarChar, adParamOutput, 10)
    OraCmd.Parameters.Append InputParam1
    OraCmd.Parameters.Append InputParam2
    OraCmd.Parameters.Append InputParam3
    OraCmd.Parameters.Append InputParam4
    OraCmd.Parameters.Append InputParam5
    OraCmd.Parameters.Append InputParam6
    OraCmd.Parameters.Append InputParam7
    OraCmd.Parameters.Append InputParam8
    OraCmd.Parameters.Append InputParam9
    OraCmd.Parameters.Append InputParam10
    OraCmd.Parameters.Append InputParam11
    OraCmd.Parameters.Append InputParam12
    OraCmd.Parameters.Append InputParam13
    OraCmd.Parameters.Append InputParam14
    OraCmd.Parameters.Append InputParam15
    OraCmd.Parameters.Append InputParam16
    OraCmd.Parameters.Append InputParam17
    OraCmd.Parameters.Append InputParam18
    Set Rs_data = New ADODB.Recordset
    Set Rs_data = OraCmd.Execute
    I am getting an error at this point which
    ORA-06550:line 1,column 54:
    PLS-00103:Encountered the symbol ">" when expecting one of the following:
    . ( ) * @ % & = - + < / > at in is mod not rem
    <an exponent(**)> <> or != or ~= or >= <= <> and or like
    between ||
    Can anyone pls help me?Thanks.

    You do not need to code an explicit cursor for a single fetch. An implicit cursor is less code to write, read, maintain and execute.
    E.g. Instead of all this:
    CURSOR C2 IS
    SELECT FACILITY_ID FROM TBLADOPT_GROUP_CSC WHERE ADOPT_GROUP = str_Adpt_Grp;
    OPEN C2;
    FETCH C2 INTO Fac_REC;
    Fac_ID := Fac_Rec.FACILITY_ID;
    CLOSE C2;
    Simply code this:SELECT
    Fac_Rec.FACILITY_ID INTO Fac_ID
    FROM BLADOPT_GROUP_CSC
    WHERE ADOPT_GROUP = str_Adpt_Grp;PL/SQL procedure calls have to be made (to Oracle) as anonymous PL/SQL blocks. This means that you need to wrap the procedure call into BEGIN..END tags.
    So instead of coding this:
    OraCmd.CommandText = "APD_MASS_UPLOAD_UNITS"
    You need to code something like:
    OraCmd.CommandText = "BEGIN APD_MASS_UPLOAD_UNITS; END;"
    However, this will not work as APD_MASS_UPLOAD_UNITS expects a bunch of input parameters. And you're on the right track about attempting to bind your Excel variables' values to the PL/SQL procedure's parameters.
    Unsure how ADO works, but typically you can bind by name or by position. Let's assume bind by position (typically in PHP):
    OraCmd.CommandText = "BEGIN APD_MASS_UPLOAD_UNITS( ?, ?, ?, ?, ?. ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); END;"
    Then you will bind values to positions 1 to 18 (did I count the number of params right?). Something like:
    OraCmd.CreateParameterByPosition( 1, adVarChar, adParamInput, 20)
    Or you can bind by name. E.g.
    OraCmd.CommandText = "BEGIN APD_MASS_UPLOAD_UNITS( :pid, :pcode, ..etc.. ); END;"
    And:
    OraCmd.CreateParameterByName( 'pid', adVarChar, adParamInput, 20)
    Read up on your OraCmd.CreateParameter() to see how to correctly use it.
    A few more comments. 18 parameters in a call is something I would seriously reconsider. It is quite easy to get it wrong - transpose two parameters. It is very difficult to read and check. Very difficult to maintain. It is much safer to rather define a %ROWTYPE structure to pass, or a PL/SQL record structure.
    You are passing date values as VARCHAR2. Rather pass the parameter as the correct data type. E.g.
    create or replace procedure foo( custID number, invoiceDate date )...
    And then when you call it (in your client code), you specify the date string and date format and make it into a date. E.g.
    OraCmd.CommandText = "begin foo( :myCust, TO_DATE(:myDateString,:myDateFormat) ); end;"

  • Calling a PL/SQL Procedure from button and then return to same page

    I have a button called "Process" that I want to call the database stored procedure "BUILD_WORKDAYS" with parameters P14_PROCESS_YEAR as an input parameter. I have the button on the page but is this a PL/SQL Page Process or a PL/SQL Branch? I have tried a number of combination but don't seem to be able to get the database procedure to execute. What should the syntax be?
    Thanks

    "I have a button called "Process" that I want to call the database stored procedure "BUILD_WORKDAYS" with parameters P14_PROCESS_YEAR as an input parameter"
    Assuming you are starting with an empty Apex page:
    1) Create a region of some type or other, say HTML.
    2) Create a button of type "Create a button in region position" in this region. Sounds like you've already done this and called it PROCESS.
    3) Create a process of type PL/SQL, On Submit After Computations and Validations.
    4) Call it "Execute BUILD_WORKDAYS" (or whatever you like)
    5) The PL/SQL for the process is:
    BUILD_WORKDAYS(:P14_PROCESS_YEAR);
    6) Specify a success and failure message.
    7) In the final step of the Create Page Process wizard, select your button from the "When button pressed" select list.
    8) Then create an unconditional branch branching to the same page.
    That should be it.
    Andy

  • How do I debug pl/sql procedures from a bc4j application

    Hi,
    I would like to use jdevelopers pl/sql debugging capabilities to debug some code that is executed by triggers in the database, when inserting records through my bc4j client application.
    I already found the remote debugging feature of jdeveloper, but that requires setting up a separate debugger listener, and it also requires me to put the following statement in the session:
    DBMS_DEBUG_JDWP.CONNECT_TCP ('hostname_or_ip', port_number)
    Where and how can I put this line of pl/sql code to make it execute each time I launch the bc4j application?
    Or is it possible to use one debugger process (the one that's also using the java breakpoints) to debug both pl/sql and java code?
    Greetings,
    Ivo

    I have the same problem.
    I have a PL/SQL function that returns a number. This function receives 2 parameters. I use StoredProcedureCall plus ValueReadQuery.
    Session aSession = SessionManager.getManager().getDefaultSession();
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("CIO_UTILS.COUNT_USER_ROLES_IN_MODULE");
    call.addNamedArgument("p_persid");
    call.addNamedArgument("p_module");
    call.addUnamedOutputArgument("rolesnum", Integer.class);
    ValueReadQuery query = new ValueReadQuery();
    //query.bindAllParameters();
    query.setCall(call);
    query.addArgument("p_persid");
    query.addArgument("p_module");
    Vector parameters = new Vector();
    parameters.addElement(persid);
    parameters.addElement(theModule);
    Integer rolesnum = (Integer) aSession.executeQuery(query,parameters);
    aSession.release();
    if(rolesnum.intValue()<=0)return false; else return true;
    However, I receive the following error:
    Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 96:
    PLS-00312: a positional parameter association may not follow a named association
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Error Code: 6550
    Call:BEGIN CIO_UTILS.COUNT_USER_ROLES_IN_MODULE(p_persid=>'SANCRA2791', p_module=>'PSL_MONITORING', ?); END;
         bind => [=> rolesnum]
    If comment the line
    "call.addUnamedOutputArgument("rolesnum", Integer.class);"
    Toplink is trating it as a procedure, and I also receive an error from PL/SQL.
    There should have to be a way of make it to receive the resoult somehow, but I do not know what.
    Thanks in advance.

  • Unable to call a pl/sql procedure from java

    Software : Oracle 9i & Red hat linux 9
    Code:
    import java.io.*;
    import java.sql.*;
    public class test
    public static void main(String args[])
    try
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.0.221:1521:elearn","gowri","gowri");
    CallableStatement call=con.prepareCall("{call ins(?,?,?,?)}");
    call.setInt(1,5);
    call.setString(2,"hari");
    call.setString(3,"m");
    call.setString(4,"1976-12-26");
    if ( call.execute() )
    System.out.println("Success");
    else
    System.out.println("fails");
    call.close();
    con.close();
    catch(Exception ex)
    System.out.println("Error :"+ex);
    ~
    ~
    ~
    Stored Procedure:
    create or replace procedure ins(no in number,name in varchar,sex in varchar,dob in varchar)is
    con_day date;
    begin
    con_day=to_date(dob,'yyyy-mm-dd');
    insert into person values(no,name,sex,con_day);
    end;
    Run Time Error:
    Exception in thread "main" java.lang.IncompatibleClassChangeError: oracle.jdbc.driver.OraclePreparedStatement
    at 0x40268e17: java.lang.Throwable.Throwable(java.lang.String) (/usr/lib/./libgcj.so.3)
    at 0x4025bc8e: java.lang.Error.Error(java.lang.String) (/usr/lib/./libgcj.so.3)
    at 0x4025d6b6: java.lang.LinkageError.LinkageError(java.lang.String) (/usr/lib/./libgcj.so.3)
    at 0x4025c7aa: java.lang.IncompatibleClassChangeError.IncompatibleClassChangeError(java.lang.String) (/usr/lib/./libgcj.so.3)
    at 0x40229eed: JvPrepareClass(java.lang.Class) (/usr/lib/./libgcj.so.3)
    at 0x40248028: java.lang.ClassLoader.linkClass0(java.lang.Class) (/usr/lib/./libgcj.so.3)
    at 0x4025acb3: java.lang.ClassLoader.resolveClass0(java.lang.Class) (/usr/lib/./libgcj.so.3)
    at 0x402299cb: JvPrepareClass(java.lang.Class) (/usr/lib/./libgcj.so.3)
    at 0x40248028: java.lang.ClassLoader.linkClass0(java.lang.Class) (/usr/lib/./libgcj.so.3)
    at 0x4025acb3: java.lang.ClassLoader.resolveClass0(java.lang.Class) (/usr/lib/./libgcj.so.3)
    at 0x4024646c: java.lang.Class.initializeClass() (/usr/lib/./libgcj.so.3)
    at 0x40230912: JvInterpMethod.continue1(_Jv_InterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x40230ff4: JvInterpMethod.run(ffi_cif, void, ffi_raw, JvInterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x4022e504: JvInterpMethod.run_normal(ffi_cif, void, ffi_raw, void) (/usr/lib/./libgcj.so.3)
    at 0x4038305c: ?? (??:0)
    at 0x403831e7: ffi_call_SYSV (/usr/lib/./libgcj.so.3)
    at 0x403831a7: ffi_raw_call (/usr/lib/./libgcj.so.3)
    at 0x402306e8: JvInterpMethod.continue1(_Jv_InterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x40230ff4: JvInterpMethod.run(ffi_cif, void, ffi_raw, JvInterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x4022e58a: JvInterpMethod.run_synch_object(ffi_cif, void, ffi_raw, void) (/usr/lib/./libgcj.so.3)
    at 0x4038305c: ?? (??:0)
    at 0x403831e7: ffi_call_SYSV (/usr/lib/./libgcj.so.3)
    at 0x403831a7: ffi_raw_call (/usr/lib/./libgcj.so.3)
    at 0x402306e8: JvInterpMethod.continue1(_Jv_InterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x40230ff4: JvInterpMethod.run(ffi_cif, void, ffi_raw, JvInterpMethodInvocation) (/usr/lib/./libgcj.so.3)
    at 0x4022e504: JvInterpMethod.run_normal(ffi_cif, void, ffi_raw, void) (/usr/lib/./libgcj.so.3)
    at 0x4038305c: ?? (??:0)
    at 0x40242dd8: gnu.gcj.runtime.FirstThread.call_main() (/usr/lib/./libgcj.so.3)
    at 0x402ad02d: gnu.gcj.runtime.FirstThread.run() (/usr/lib/./libgcj.so.3)
    at 0x4024fc4c: JvThreadRun(java.lang.Thread) (/usr/lib/./libgcj.so.3)
    at 0x4021c8ac: JvRunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/./libgcj.so.3)
    at 0x08048910: ?? (??:0)
    at 0x42015574: __libc_start_main (/lib/tls/libc.so.6)
    at 0x080486c1: ?? (??:0)

    Hi Gowrishankar,
    This is just a suggestion (based on a guess). Try changing this line of your code:
    call.setInt(1,5);with this line:
    call.setBigDecimal(1,5);Good Luck,
    Avi.

  • Calling pl/sql procedure from jsp

    Hi:
    Could anyone tell me how to call a pl/sql procedure from a jsp page by passing args or without . Is there any specific method to use.
    Thanks.

    Like from any other java code
    <%
    Connection conn = DriverManager.getConnection(...);
    CallableStatement cs = conn.prepareCall("BEGIN myprocedure(); END;");
    cs.execute();
    %>
    With params:
    <%
    Connection conn = DriverManager.getConnection(...);
    CallableStatement cs = conn.prepareCall("BEGIN myprocedure(?, ?); END;");
    cs.setInt(1, 10);
    cs.setString(2,"aaaa");
    cs.execute();
    %>
    to return some value as out param
    Connection conn = DriverManager.getConnection(...);
    CallableStatement cs = conn.prepareCall("BEGIN myprocedure(?, ?, 3); END;");
    cs.setInt(1, 10);
    cs.setString(2,"aaaa");
    cs.registerOutParameter(3, Types.VARCHAR);
    cs.execute();
    out.println("Returned value: " + cs.getString(3));
    %>
    Of course after all close statement and connection to free resources.

  • 403 Forbidden error calling PL/SQL Procedure from URL

    I am getting a 403 Forbidden browser error when calling a PL/SQL procedure from the URL, as in this:
    http://<server.port>/apex/SCHEMA.procedure_name/f?p_param1=394&p_param2=2, etc
    We are upgrading from HTMLDB 2.0 to APEX 4.0.2. I do not believe the upgrade has anything to do with it, c/o the upgraded app works fine in another APE 4.0.2 environment.
    The upgrade is to new machines, new DB and new app server, Oracle Web Tier, Oracle HTTP server deployment.
    The dads.conf entries are fine, all standard:
    Alias /i/ "/apexd01/app/oracle/product/http/Oracle_WT1/ohs/images/"
    Alias /c/ "/apexd01/app/oracle/product/http/Oracle_WT1/ohs/custom_htmldb/"
    <Location /pls/apexd>
    Order deny,allow
    PlsqlDocumentPath docs
    AllowOverride None
    PlsqlDocumentProcedure wwv_flow_file_mgr.process_download
    PlsqlDatabaseConnectString dbserver.us.com:1521:SERVER.US.COM ServiceNameFormat
    PlsqlNLSLanguage AMERICAN_AMERICA.AL32UTF8
    PlsqlAuthenticationMode Basic
    SetHandler pls_handler
    PlsqlDocumentTablename wwv_flow_file_objects$
    PlsqlDatabaseUsername APEX_PUBLIC_USER
    PlsqlDefaultPage apex
    PlsqlDatabasePassword apexpwd
    PlsqlRequestValidationFunction wwv_flow_epg_include_modules.authorize
    Allow from all
    </Location>
    The GRANT EXECUTE ON procedure TO PUBLIC is there.
    A call to the same procedure via a process in an APEX page works fine - the procedure is OK.
    The call from javascript, which sets up the call from the URL, is the one that fails with the 403 Forbidden error.
    The same app works fine in another APEX 4.0.2 environment, so I know it is not the JS; It has to be some configuration setting in this environment.
    I do NOT have access to the app server.
    I have asked that they compare the httpd.conf, and all underlying conf files, to check for differences.
    In order for me to be more specific, and hopefully speed up the troubleshooting process, can anyone suggest what other settings to look at?
    Thank you - Karen

    Hello,
    Good catch, but the difference in URL is in fact the difference in my env to theirs. My typo in not correcting my example to match the dads.conf entry of /pls/apexd. My env uses /apex/. Just saves on my typing.
    As an update, I asked the DBA to double-check, and yes, the www_flow_epg_include_mod_local function IS there.
    www_flow_epg_include_mod_local is an APEX function.
    So now we are trying adding procedures to it. I'll let you know if it works.
    My previous question remains - why would I need to do this in one env, and not another,
    given that the DB GRANTs are there.
    Is there a particular app server setting that wil block execution of PL/SL procedures from the URL?
    My guess is, there is some difference in configuration settings for the app server, somewhere in the httpd.conf chain.
    Since I do not have access to those files, I cannot do a diff myself, as I would have if I the issue was on my machine.
    I am in a situation where I can suggest what to do, but that's it. I agree, it's hard to troubleshoot in this situation.
    I am being asked "what setting do I need to change?" without the benefit of access to what is there,so I am doing the best I can, without diverting from my work for a deep-dive refresher session on httpd.conf settings.
    So, if anyone is aware of some setting that would block execution of a PL/SQL proc from the URL, please let me know,
    and of course, if adding a proc to www_flow_epg_include_mod_local works, I'll be happy. Just still curious.
    Thank you - K

  • Problem calling PL/SQL procedure from Workflow function activity.

    Hi,
    I am trying to call a PL/SQL procedure from within my workflow activity.
    While I am able to execute the procedure through SQLDeveloper, the workflow function does not seem to call it.
    It seems that custom PL/SQL procedures have to conform to certain standards to be called within workflow applications. I have written my procedure to conform to those standards (referred to the example workflows).
    Could someone please help me with it?
    Thanks and regards.

    Hi,
    When I've received enough alpha reviews of the first few chapters of my book, I'll make chapter five available, which deals with writing functions for Workflows.
    Matt
    Alpha review chapters from my book "Developing With Oracle Workflow" are available on my website:
    http://www.workflowfaq.com
    http://forum.workflowfaq.com

  • Calling a PL/SQL Package from a controller

    Hi ,
    I have to add some busines funtionality to the standard existing oco page .
    i have extened the standard controller and add the validation logic there , now if the validation is true i have to call a pl/sql package to do some functions . now i am facing few issues here
    a) can i call a pl/sql package from a controller ?
    b) should i extend the standard AM and call the pl/sql package from the extended am . is extending am allowed ?
    please let me know the best sol to achieve this

    a) can i call a pl/sql package from a controller ?<b>Yes</b> you can call a pl/sql procedure from controller through <b>OracleCallableStatement</b> object.
    <br>
    b) should i extend the standard AM and call the pl/sql package from the extended am . is extending am allowed ?Extending AM is <b>allowed</b>, but as can achieve your goal through the CO extension, why bother to touch AM :)
    --saroj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to call at PL/SQL package?

    Hi,
    How to call a PL/SQL package from withing a VORowImpl?
    Also what packages need to be imported for this?
    Thanks,
    AD

    Hi,
    Thanks for the replies friends.
    I understand this is not a good practice to call a pl/sql package. I tried as per the OAF standards.
    My requirement is to display the GL String in a region of type table. This is in iExpense and the region is (ReviewBusinessCCardTblRN.xml) i.e. the Review page in the Expense report creation steps.
    The data in this region is not coming directly from one VO. There are two VOs involved in it.
    1> BusinessCCardLinesForReviewVO
    2> ReceiptBasedLinesVO (This is the actual source of data and it contains a SQL statement)
    The "BusinessCCardLinesForReviewVORowImpl" calls methods in "ReceiptBasedLinesVORowImpl" to get all the data.
    So, my approach was to
    1> Extend "ReceiptBasedLinesVO" and add an attribute for the GL String in the SQL statement.
    2> Write a method in the "ReceiptBasedLinesVOExRowImpl" to fetch the GL String.
    3> Extend BusinessCCardLinesForReviewVO and add an attribute for the GL String.
    4> In the extended VO's (BusinessCCardLinesForReviewVOExRowImpl) row impl, call "ReceiptBasedLinesVOExRowImpl" GL String method.
    5> Then use "BusinessCCardLinesForReviewVO" GL string attribute to display in the region.
    Is there anything wrong with this approach?
    But, this does not seem to be working.
    Steps 3, 4, 5 are working as I tested with hard coded values in "BusinessCCardLinesForReviewVOExRowImpl".
    But when I call method in "ReceiptBasedLinesVOExRowImpl" to get the GL String, it does not working. No error returned. The page displays all the values as it was displaying in the standard functionality.
    As this is an urgent requirement, I thought of writting a PL/SQL function which would take CCID from "BusinessCCardLinesForReviewVO" and return the GL String.
    And call this PL/SQL funtion in "BusinessCCardLinesForReviewVOExRowImpl".
    Please help me on this.
    Srini: Could you please give the exact syntax for calling the PL/SQL stored function in VORowImpl.
    Thanks,
    AD

  • Call a PL/SQL procedure or function from applet

    Could anyone please let me know how I could call a PL/SQL procedure
    or function from a JDBC method from applet with Internet Explorer?

    It depends from where you are calling your PLSQL routine. If it is SQL*Plus then you can use & (ampersand) with the variable to be input at run time.
    If you are executing the PLSQL routine from another application (some front end application) then it's not possible. Because when a procedure is executing at server side, the front end application does not have control, and the control is only transfered back to front end application when the PLSQL routine either completes successfully or throws an exception.
    In either case, you can not go back to the PLSQL routine.
    In this case, what you can do is, write code in your front end application to get that variable value from user and then pass that value to PLSQL routine.

Maybe you are looking for