How to call stored procedure in hibernate

hi ,
can any one help me how to call stored procedure in hibernate.Given code in hbm.xml
and also plz tell me what is the use of <return-property/>in given hbm.xml file.
<sql-query name="selectEmployees_SP" callable="true">
     <return alias="emp" class="com.centris.Employee">
<return-property name="eno" column="eno"/>
<return-property name="ename" column="ename"/>
<return-property name="address" column="address"/>
<return-property name="salary" column="salary"/>
{ ? = call p_retrieve_employees() }
</return>
</sql-query>

Hi,
Your question isn't related to Java Programming and should be asked in a [Hibernate forum|http://forum.hibernate.org/]
Kaj

Similar Messages

  • How to call stored procedure from Pro*C

    How to call stored procedure from Pro*C ?
    my system spec is SuSE Linux 9.1, gcc version : 3.3.3, oracle : 10g
    my Pro*C code is the following..
    EXEC SQL EXECUTE
    begin
    test_procedure();
    end;
    END-EXEC;
    the test_procedure() has a simple update statement. and it works well in SQL Plus consol. but in Pro*C, there is a precompile error.
    will anybody help me what is the problem ??

    I'm in the process of moving C files (with embedded SQL, .PC files) from Unix to Linux. One program I was trying to compile had this piece of code that called an Oracle function (a standalone), which compiled on Unix, but gives errors on Linux:
    EXEC SQL EXECUTE
    BEGIN
    :r_stat := TESTSPEC.WEATHER_CHECK();
    END;
    END-EXEC;
    A call similar to this is in another .PC file which compiled on Linux with no problem. Here is what the ".lis" file had:
    Pro*C/C++: Release 10.2.0.1.0 - Production on Mon Jun 12 09:26:08 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Error at line 193, column 5 in file weather_check.pc
    193 BEGIN
    193 ....1
    193 PCC-S-02346, PL/SQL found semantic errors
    Error at line 194, column 8 in file weather_check.pc
    194 :r_stat := TESTSPEC.WEATHER_CHECK();
    194 .......1
    194 PLS-S-00000, Statement ignored
    Error at line 194, column 18 in file weather_check.pc
    194 :r_stat := TESTSPEC.WEATHER_CHECK();
    194 .................1
    194 PLS-S-00201, identifier 'TESTSPEC.WEATHER_CHECK' must be declared
    Pro*C/C++: Release 10.2.0.1.0 - Production on Mon Jun 12 09:26:08 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    System default option values taken from: /oracle_client/product/v10r2/precomp/ad
    min/pcscfg.cfg
    Error at line 194, column 18 in file weather_check.pc
    :r_stat := TESTSPEC.WEATHER_CHECK();
    .................1
    PLS-S-00201, identifier 'TESTSPEC.WEATHER_CHECK' must be declared
    Error at line 194, column 8 in file weather_check.pc
    :r_stat := TESTSPEC.WEATHER_CHECK();
    .......1
    PLS-S-00000, Statement ignored
    Semantic error at line 193, column 5, file weather_check.pc:
    BEGIN
    ....1
    PCC-S-02346, PL/SQL found semantic errors

  • How to call stored procedures from EF 6.1.3

    Hi
    I need to create many reports and I wanna use SPs, with parameters, the question is how to use it from ntity Framework CodeFirst ? I am using EF 6.1.3
    I 've found examples using EF but not EF CF, any sample please ?
    thanks in advance
    Salu2 Sergio T

    You create a type to return and pass it as a type...
    Like this:
    http://stackoverflow.com/questions/20901419/how-to-call-stored-procedure-in-entity-framework-6-code-first
    context.Database.SqlQuery<YourEntityType>("storedProcedureName",params);
    ps
    That was pretty easy to google, by the way.
    And... it's not really wpf.
    Shrug.
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • How to call Stored Procedure in OWB?

    Hi,
    I'm not able to call stored procedures in the OWB. There are transformations available to call the functions namely Mapping Transformation, but i didnt find any such transformation for stored procedures.
    I was able to validate, generate ad deploy the stored procedure, but coudn't find any trasnformation which calls the stored procedure.
    And my source and the target are in the same schema, hence a connector module is also not needed.
    Can anyone help me in this regard and explain how to call a stored procedure in the Oracle Warehouse Builder?

    Hi Patrick,
    Thanks a lot for your reply.
    Hey Patric, sorry to bug you again.
    Regarding calling the Stored procedure, mine is a very simple scenario.
    I have created a table with two fields say A and B. My stored proc takes an input A1. The stored proc then selects the B field from that table when A1 has the same value as A.
    Then i check the condition, if the selected value is null then set the output variable to 'N'. Else to 'Y'.
    The logic that i'm following in OWB is:
    1.) create a mapping which contains the source as a table.
    2.) Give the field A in that table as an input to the Stored procedure which i can have it my Mapping Trasformation.
    3.) Then i need to specify the condition that the field A in the table should be equal to A1. And if equal, then fetch the value from the table and display either 'Y' or 'N' based on the condition that is checked in the Procedure.
    But the problem here i'm facing is that,i'm not able to store the output into a file, since the procedure doesnot return a value. And my target is a file.
    should i need to change my logic.
    Regards,
    Abhinav.

  • How to call Stored procedure in SMP 2.3 ?

    HI Experts,
    I have stored procedure in SQL Server, in that i have Select query with WHERE Condition, how to call that procedure in SMP Application .

    Do you want to create mbo from that stored procedure?  Not sure if this document helps you Example: Parameters and Stored Procedures

  • How to call stored procedures from java program?

    I have tried to run a program that calls a stored procedure on MySQL
    server version 5.0.17 by using connector/j 5.0, but it always fails on the
    statement: con.preparecall() ,
    have looked on the internet and found out that people can all mysql
    stored procedure all right in their programs, really dont know what's
    wrong with this small peiece of code:
    import java.sql.*;
    public class TestDB {
          // procedure being called is:
         CREATE PROCEDURE `dbsaystorm`.`getsite` ()
         BEGIN
            select  name  from tblsite;
         END
         public static void main(String[] args) {
              try  {
                  //Class.forName("org.gjt.mm.mysql.Driver");
                  Class.forName("com.mysql.jdbc.Driver");
                  Connection con = DriverManager.getConnection("jdbc:mysql://localhost/dbname",
                            "user", "pwd");
           * executing SQL statement here gives perfect correct results:
            // PreparedStatement ps = con.prepareStatement("select name from tblsite");      
            // ResultSet rs =ps.executeQuery();
                  // but in stored procedure way...
                  //it fails here on this prepare call statement:             
                  CallableStatement proc = con.prepareCall("call getsite()");
                  ResultSet rs =proc.executeQuery();                      
                  if (rs == null) return;                                      
                  while (rs.next()){                 
                      System.out.println("site name is: "+ rs.getString(1));                                
                  rs.close();
              } catch (SQLException e) {e.printStackTrace();}
               catch (Exception e) {e.printStackTrace();}         
    }it always gives this exception:
    java.lang.NullPointerException
         at com.mysql.jdbc.StringUtils.indexOfIgnoreCaseRespectQuotes(StringUtils.java:959)
         at com.mysql.jdbc.DatabaseMetaData.getCallStmtParameterTypes(DatabaseMetaData.java:1280)
         at com.mysql.jdbc.DatabaseMetaData.getProcedureColumns(DatabaseMetaData.java:3668)
         at com.mysql.jdbc.CallableStatement.determineParameterTypes(CallableStatement.java:638)
         at com.mysql.jdbc.CallableStatement.<init>(CallableStatement.java:453)
         at com.mysql.jdbc.Connection.parseCallableStatement(Connection.java:4365)
         at com.mysql.jdbc.Connection.prepareCall(Connection.java:4439)
         at com.mysql.jdbc.Connection.prepareCall(Connection.java:4413)
         at saystorm.server.data.database.TestDB.main(TestDB.java:29)
    where have I gone wrong?
    when I commented out the statement that makes the procedure call and call preparedstatement to execute SQL select statement, it gave perfectly correct result.
    it looks like there is no problem with java prog accessing MYSQL server database, but the it seems that it's just java can't call stored procedure stored on the mysql server version 5.
    can it or can't it? if it can, how is that accomplished?

    It is a bug in the driver because it shouldn't be
    returning that exception (null pointer) even if you
    are doing something wrong.
    Are you using the latest version of the driver?
    The stored procedure runs when you run it from the
    gui/command line using a MySQL tool - correct?
    As suggested you should be using the brackets. What
    is the data type of the 'name' field?
    You could try returning another value like one of the
    following
    select 1, name from tblsite;
    select name, 1 from tblsite;
    That might get around the bug
    Additionally try just the following...
    select 'test' from tblsite;yes, the driver used is in connector/j 5.0--the lastest one, and the
    procedure can run correctedly at either command line or GUI mode
    with no problem whatsoever, the returned data type is string type,
    I have not got the chance to test it again with those values you
    suggested, as I have abandoned the laptop I used to write that code
    initately. There have been some other really weird cases happened on
    that computer. I guess that must be something wrong with the JVM
    installed on it, it was upgraded from jre5.0.04 to 06, and to 09.
    something within hte JVM must have been messed up(the only reasonable
    explanation). Because the same code runs correctly on my new laptop,
    using the same environment: jvm 5.0_09, mysql 5.0.18, connector/J 5.0.
    that old laptop really was a nightmare.

  • How to call stored procedure with multiple parameters in an HTML expression

    Hi, Guys:
    Can you show me an example to call stored procedure with multiple parameters in an HTML expression? I need to rewrite a procedure to display multiple pictures of one person stored in database by clicking button.
    The orginal HTML expression is :
    <img src="#OWNER#.dl_sor_image?p_offender_id=#OFFENDER_ID#" width="75" height="75">which calls a procedure as:
    procedure dl_sor_image (p_offender_id IN NUMBER)now I rewrite it as:
    PROCEDURE Sor_Display_Current_Image(p_n_Offender_id IN NUMBER, p_n_image_Count in number)could anyone tell me the format for the html expression to pass multiple parameters?
    Thanks a lot.
    Sam

    Hi:
    Thanks for your help! Your question is what I am trying hard now. Current procedure can only display one picture per person, however, I am supposed to write a new procedure which displays multiple pictures for one person. When user click a button on report, APEX should call this procedure and returns next picture of the same person. The table is SOR_image. However, I rewrite the HTML expression as follows to test to display the second image.
    <img src="#OWNER#.Sor_Display_Current_Image?p_n_Offender_id=#OFFENDER_ID#&p_n_image_Count=2" width="75" height="75"> The procedure code is complied OK as follows:
    create or replace
    PROCEDURE Sor_Display_Current_Image(p_n_Offender_id IN NUMBER, p_n_image_Count in number) AS
        v_mime_type VARCHAR2(48);
        v_length NUMBER;
        v_name VARCHAR2(2000);
        v_image BLOB;
        v_counter number:=0;
        cursor cur_All_Images_of_Offender is
          SELECT 'IMAGE/JPEG' mime_type, dbms_lob.getlength(image) as image_length, image
          FROM sor_image
          WHERE offender_id = p_n_Offender_id;
        rec_Image_of_Offender cur_All_Images_of_Offender%ROWTYPE;
    BEGIN
        open cur_All_Images_of_Offender;
        loop
          fetch cur_All_Images_of_Offender into rec_Image_of_Offender;
          v_counter:=v_counter+1;
          if (v_counter=p_n_image_Count) then
            owa_util.mime_header(nvl(rec_Image_of_Offender.mime_type, 'application/octet'), FALSE);
            htp.p('Content-length: '||rec_Image_of_Offender.image_length);
            owa_util.http_header_close;
            wpg_docload.download_file (rec_Image_of_Offender.image);
          end if;
          exit when ((cur_All_Images_of_Offender%NOTFOUND) or (v_counter>=p_n_image_Count));
        end loop;
        close cur_All_Images_of_Offender;
    END Sor_Display_Current_Image; The procedure just open a cursor to fetch the images belong to the same person, and use wpg_docload.download_file function to display the image specified. But it never works. It is strange because even I use exactly same code as before but change procedure name, Oracle APEX cannot display an image. Is this due to anything such as make file configuration in APEX?
    Thanks
    Sam

  • How to call stored procedure in data services?

    Hi, all,
    I'm a newbie and am trying to evaluate Flex for our
    development environment. We use a lot of Oracle stored packages in
    the database to process the business logic. However, I can't seem
    to find a good example to call a stored procedure in flex data
    services.
    Here is a part of my data-management-config.xml:
    <destination id="oracle2">
    <adapter ref="java-dao" />
    <properties>
    <use-transactions>true</use-transactions>
    <source>flex.data.assemblers.SQLAssembler</source>
    <scope>application</scope>
    <metadata>
    <identity property="GKEY"/>
    </metadata>
    <network>
    <session-timeout>20</session-timeout>
    <paging enabled="false" pageSize="10" />
    <throttle-inbound policy="ERROR" max-frequency="500"/>
    <throttle-outbound policy="REPLACE"
    max-frequency="500"/>
    </network>
    <server>
    <database>
    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
    <url>jdbc:oracle:thin:xxxxxxxxxxx:1521/racdev</url>
    <login-timeout>15</login-timeout>
    </database>
    <actionscript-class>History</actionscript-class>
    <fill>
    <name>by_nbr</name>
    <sql>select to_char(POSTED,'dd-Mon-yyyy hh:mi:ssAM')
    POSTED, GKEY, EQUSE_GKEY,WTASK_ID,VSL_ID,VOY_NBR,STATUS from
    equipment_history where eq_nbr = #sNbr# order by posted
    desc</sql>
    </fill></server>
    </properties>
    </destination>
    How do I call a stored procedure named
    pk_equipment_history.get(eq_nbr varchar2, o_resultset out
    sys_refcursor) in place of the sql select in the above file? The
    o_resultset output parameter will return exactly the same result as
    the sql. How do I bind the output parameter?
    TIA

    Hi,
    Your question isn't related to Java Programming and should be asked in a [Hibernate forum|http://forum.hibernate.org/]
    Kaj

  • HOW TO CALL STORED PROCEDURES IN JSP

    CAN ANY ONE SEND A SAMPLE CODE , HOW A STORED PROCEDURE CAN BE CALLED IN JSP
    THANKS
    SPUTNIK

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by any:
    Oreilly jdbc and java explain well.
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection con = DriverManager.getConnection(url, "scott", "tiger");
    CallableStatement cs = con.prepareCall("EXECUTE storedprocedurename(?,?)");
    cs.setInt(1, cid);
    cs.registerOutParameter(2, java.sql.Types.VARCHAR);
    ResultSet rs = cs.executeQuery();
    while (rs.next())
    { %>
    <tr>
    <td> <%= rs.getString(2) %> </td> //<%= rs.getString("country_name") %>
    </tr><HR></BLOCKQUOTE>
    Hi ,i am not very sure whether the call execute in the prepare call statement works please try for CALL in the following way:
    con.prepareCall("{call storedProcedurename(?,?)}");

  • How to call stored procedure having parameter as oracle type from java???

    Hello,
    I have created following type & stored procedure in oracle. How can i call this stored procedure from my java class?
    I want to pass 2d array to this procedure.
    CREATE OR REPLACE TYPE type_survey AS OBJECT ( emp_id number,emp_name varchar(100));
    CREATE OR REPLACE TYPE tbl_survey AS VARRAY(100) OF type_survey;
    CREATE OR REPLACE PROCEDURE INSERTEMP (pp in tbl_survey)
    IS
    BEGIN
    FOR I IN pp.FIRST .. pp.LAST
    LOOP
    INSERT INTO SURVEY (id) VALUES (pp(I).emp_id);
    END LOOP;
    END;
    /

    CREATE OR REPLACE TYPE type_survey AS OBJECT ( emp_id number,emp_name varchar(100));
    CREATE OR REPLACE TYPE tbl_survey AS VARRAY(100) OF type_survey;
    CREATE OR REPLACE PROCEDURE APP_DATA.INSERTEMP (pp in tbl_survey,result out varchar)
    IS
    BEGIN
    FOR I IN pp.FIRST .. pp.LAST
    LOOP
    INSERT INTO SURVEY (id) VALUES (pp(I).emp_id);
    END LOOP;
    result:='done';
    END;
    public static void passArray() throws SQLException
         Connection conn=null;
         try{
              conn=getOracleConnection();//this method returns connection object
         catch (Exception e)      
              e.printStackTrace();
         String[][] val=new String[2][2];
    *     val[0][0]="1";*
    *     val[0][1]="aaa";*
    *     val[1][0]="2";*
    *     val[1][0]="bbb";*
    StructDescriptor desc1=StructDescriptor.createDescriptor("TYPE_SURVEY",conn);
    STRUCT p1struct1 = new STRUCT(desc1,conn,_val_); *//showing error at this line*
    ArrayDescriptor arraydesc = ArrayDescriptor.createDescriptor("TBL_SURVEY",conn);
    ARRAY array = new ARRAY(arraydesc,conn,*p1struct1*);
    CallableStatement cstmt = conn.prepareCall("{ call INSERTEMP(?,?)}");
    cstmt.setObject(1,array);
    cstmt.registerOutParameter(2, OracleTypes.VARCHAR);
    cstmt.execute();
    String res=cstmt.getString(2);
    System.out.println(res);
    in the above java code, I have passed 2d array of string to STRUCT constructor and passed STRUCT object i.e. p1struct1  to ARRAY constructor. is it correct? that means @bottom line, I want to pass val array to my stored porcedure. How can i do this? above code is showing following error......
    Exception in thread "main" java.sql.SQLException: Fail to convert to internal representation: [Ljava.lang.String;@146c1d4
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
         at oracle.jdbc.oracore.OracleTypeNUMBER.toNUMBER(OracleTypeNUMBER.java:540)
         at oracle.jdbc.oracore.OracleTypeNUMBER.toDatum(OracleTypeNUMBER.java:54)
         at oracle.sql.StructDescriptor.toOracleArray(StructDescriptor.java:717)
         at oracle.sql.StructDescriptor.toArray(StructDescriptor.java:1375)
         at oracle.sql.STRUCT.<init>(STRUCT.java:159)
         at com.flologic.ArrayDemo.passArray(ArrayDemo.java:29)
         at com.flologic.ArrayDemo.main(ArrayDemo.java:57)

  • How to call stored procedure with parameters?

    I created a stored procedure in db like:
    CREATE PROCEDURE dbo.MySP
    @name varchar(50),
    @access_date datetime
    AS
    BEGIN
    --insert data into a table
    End
    Then I create pb function to call this sp like( I use pb 11.5)
    datetime ll_date
    ll_date =datetime(today(), now())
    DECLARE mytest PROCEDURE FOR MySP @objname = :is_name, @access_date = :ll_date USING is_tran;
    IF is_tran.SQLCode <> 0 THEN
          MessageBox ( "Error", "DECLARE failed" )
          RETURN
    END IF
    EXECUTE mytest;
    IF ( is_tran.SQLCode <> 0 ) and ( is_tran.SQLCode <> 100 ) THEN
          MessageBox ( "Error", "EXECUTE failed" )
          RETURN
    END IF
    Then I run the app, first time to call this function without any error, but no data inserted, no thing happen.
    keep in the app and call the function again, give me error declare error.
    debug give me SQLCode = 100.
    SP is fine, I can insert data with isql like:
    exec MySP 'name', '2014-06-18'
    How to figure out the problem and fix it?

    You didn't mention the database in question, but the first thing I would recommend is making the call via and RPCFUNC declaration on a user object to type transaction rather than embedded SQL.  Embedded SQL (IMHO) should be a last resort.
    See:  Using Transaction Objects to call Stored Procedures

  • How to call stored procedure from javascript? (about Google Suggest, AJAX)

    Hi I want to implement a text field so that it behaves like [Google Suggest|http://www.google.com/webhp?complete=1&hl=en] .
    I read this post .
    Now I've setup everything according to that document. But it just doesn't work. And I don't know why.
    I think problems may fall into the following three categories:
    1. Does the text field and the page invoke the proper javascript?
    2. Does the javascript successfully call the stored procedure?
    3. Can the stored procedure correctly return the formatted result?
    I am affirmative for 1 and 3, but I'm not sure about 2. Because I don't know how to tell if a stored procedure has been called? Is there a PL/SQL statement that I can query in SQL*Plus?
    Also, I would to know how to debug AJAX in APEX. It involves many things.
    Last, I used APEX 3.2 and Oracle XE. I cannot find either dads.conf or marvel.conf file. Is "/apex/" the virtual directory for APEX?
    Thanks a lot!

    Hello,
    I recently also ran into problems with this and I will post my solution here:
    1) if you need to pass parameters to your procedure, create it using "Flexible Parameter Passing". Then parse the parameters out of the array and put them in local variables inside your PL/SQL procedure.
    Example:
    CREATE OR REPLACE PROCEDURE MATTHIASH.incsearch(name_array IN owa.vc_arr,
         value_array IN owa.vc_arr) as
      l_List1 varchar2(4000);
      l_List2 varchar2(4000);
      l_query varchar2(255);
      l_separator varchar2(10) default '';
      qu varchar2(4000) default '';
      hl varchar2(4000) default '';
    BEGIN
      FOR i IN 1 .. name_array.COUNT 
      LOOP
           IF name_array(i) = 'qu' THEN
                qu := value_array(i);
           ELSIF name_array(i) = 'hl' THEN
                hl := value_array(i);
           END IF;
      END LOOP;
      l_query := qu||'%';
      FOR x IN (
      select object_name, object_id from user_objects
      where upper(object_name) like upper(l_query) and upper(object_type) = upper(hl) order by 1 asc)
      LOOP
        l_list1 := l_List1 || l_separator || '"' || x.object_name || '"';
        l_list2 := l_List2 || l_separator || '"' || x.object_id || '"';
        l_separator := ',';
      END LOOP;
      owa_util.mime_header('text/html', false);
      owa_util.http_header_close;
      --htp.p('sendRPCDone(frameElement, "'|| qu ||'", new Array(' || l_List1 || '), new Array(' || l_List2 || '), new Array(""));');
      htp.p('sendRPCDone(frameElement, "' || qu || '", new Array(' || l_List1 || '), new Array(' || l_List2 || '), new Array(""));');
    END;
    /2) grant EXECUTE rights to APEX_PUBLIC_USER (the user APEX uses to connect to the database) on the procedure
    grant execute on incsearch to apex_public_user;3) upload the ac.js file as static file to your application
    4) put the following javascript code in the HTML Header of your APEX page:
    <script src="#WORKSPACE_IMAGES#ac.js" type="text/javascript"></script>
    <script language="JavaScript" type="text/javascript">
    function iac()
    InstallAC(document.wwv_flow,document.getElementById('P1_X'),"","!MATTHIASH.incsearch","&P1_OBJECT_TYPE.");
    </script>In my example, P1_X is a text field and P1_OBJECT_TYPE is a dropdown list with all user object types.
    Good luck,
    Matthias Hoys

  • How to call Stored Procedure

    Hi Experts,
       Request you kindly let me know step by step procedure on implementing a scenario for SOAP (WebServices) to Database Stored Procedure in synchronous mode. And also let me know how to call a stored procedure in UDF by using JDBC Adapter/SAP API.

    hi  Archana,
    Moderator request:
    Please mark you post as a question if you expect any answers
    thank you,
    Regards,
    Michal Krawczyk

  • How to call stored procedure from postgresql to jsp

    i'm using a jdeveloper.. and i'm a newbie of jsp.. i just wanna know how to call a stored procedure in jsp?... This is my function in postgres and i don't know how to call it in jsp...
    SELECT * from SP_1('2006-01-11') as ( company_code char(5), branch_category char(5), branch_code char(15), day_sales numeric(19,2), month_to_date numeric(19,2), no_of_transaction int8, month_to_date_py numeric(19,2), year_to_date numeric(19,2), year_to_date_py numeric(19,2), remarks text, time_reported text );

    hi again.. i'm using jsp in jdeveloper, i just wanna know how to declare double in jsp because my module is report and i need to get the average daily sales = 4500/ no. of transaction = 3. This is my code.. Where will i put the code in declaring the double and the average daily sales? Thanks in advance..
    <%@ page contentType="text/html;charset=windows-1252" import="java.sql.*,Connect.CRMCon"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>untitled</title>
    </head>
    <body>
    <%
    String ave = request.getParameter("ave_daily_sales");
    double cashsales = Double.parseDouble(ave);
    %>
    <%
    logparameters data = new logparameters();
    data.txtbox = request.getParameter("txtbox");
    %>
    <table cellspacing="3" cellpadding="2" border="1" width="100%">
    <tr>
    <td width="5%" bgcolor="#cccccc" height="29">
    <DIV align="center">Company Code</DIV>
    </td>
    <td width="4%" bgcolor="#cccccc" height="29">
    <DIV align="center">Branch Category</DIV>
    </td>
    <td width="6%" bgcolor="#cccccc" height="29">
    <DIV align="center">Branch Code</DIV>
    </td>
    <td width="8%" bgcolor="#cccccc" height="29">
    <DIV align="center">Day Sales</DIV>
    </td>
    <td width="9%" bgcolor="#cccccc" height="29">
    <DIV align="center">Month to Date</DIV>
    </td>
    <td width="5%" bgcolor="#cccccc" height="29">
    <DIV align="center">No.of Transaction</DIV>
    </td>
    <td width="9%" bgcolor="#cccccc" height="29">
    <DIV align="center">Month to Date(PY)</DIV>
    </td>
    <td width="9%" bgcolor="#cccccc" height="29">
    <DIV align="center">Ave.Daily Sales to Date</DIV>
    </td>
    <td width="9%" bgcolor="#cccccc" height="29">
    <DIV align="center">Year to Date</DIV>
    </td>
    <td width="9%" bgcolor="#cccccc" height="29">
    <DIV align="center">Year to Date(PY)</DIV>
    </td>
    <td width="9%" bgcolor="#cccccc" height="29">
    <DIV align="center">Remarks</DIV>
    </td>
    <td width="5%" bgcolor="#cccccc" height="29">
    <DIV align="center">Time Reported</DIV>
    </td>
    </tr>
    <%
    try
    CRMCon ccon = new CRMCon();
    Connection con = ccon.getConnection();
    String sql = "select * from sp_1('"+data.txtbox+"')";
    // String sql = "SELECT * from SP_1('"+ request.getParameter("data.txtbox")+"')" ;
    sql += " as (company_code char(5), branch_category char(5) ," ;
    sql += "branch_code char(15) , day_sales numeric(19,2)," ;
    sql += "month_to_date numeric(19,2), no_of_transaction int8," ;
    sql += "month_to_date_py numeric(19,2), year_to_date numeric(19,2)," ;
    sql += "year_to_date_py numeric(19,2), remarks text, time_reported text) " ;
    //out.println(sql);
    Statement st = con.createStatement();
    ResultSet rs = st.executeQuery(sql);
    while (rs.next())
    %>
    <tr>
    <td width="13%"> <%= rs.getString("company_code") %> </td>
    <td width="63%"> <%= rs.getString("branch_category") %> </td>
    <td width="24%"> <%= rs.getString("branch_code") %> </td>
    <td width="24%"> <%= rs.getString("day_sales") %> </td>
    <td width="24%"> <%= rs.getString("month_to_date") %> </td>
    <td width="24%"> <%= rs.getString("no_of_transaction") %> </td>
    <td width="24%"> <%= rs.getString("month_to_date_py") %> </td>
    <td width="24%"> <%= rs.getString("year_to_date") %> </td>
    <td width="24%"> <%= rs.getString("year_to_date_py") %> </td>
    <td width="24%"> <%= rs.getString("remarks") %> </td>
    <td width="24%"> <%= rs.getString("time_reported") %> </td>
    </tr>
    <%
    catch (Exception ex)
    out.println("Error:"+ex.getMessage());
    %>
    </table>
    </body>
    </html>
    <%!
    class logparameters
    public String txtbox;
    %>

  • JDBC - how to call Stored Procedure

    Hi! My problem is that I can't call a procedure created at my DB through JDBD. I have a similar stored function working fine (code->
    String query = "begin :1 := funcStored; end;";
    CallableStatement cstmt = connection.prepareCall(query);
    cstmt.registerOutParameter(1,OracleTypes.CURSOR);
    cstmt.execute();
    ResultSet rset = (ResultSet)cstmt.getObject(1);
    But I don't want a Stored Function, I want a Stored Procedure that is getting hard making it to work (to call more precisely).
    Here is the wrong code where I need help ->
    String query = "{call ? := procedureStored(P_CURSOR)}";
    That gives a error saying P_CURSOR is not declared but how I declare through Java and call the SP??
    Thanks a lot for helping!
    //The code of SP
    create or replace package types
    as
    type cursorType is ref cursor;
    end;
    create or replace procedure procedureStored( p_cursor out types.cursorType )
    as
    begin
    open p_cursor for SELECT ..........
    end;
    //------------- END

    Problem solved !!
    String query = "{call procedureStored(?)}"; !!!
    and not what i was doing...
    String query = "{call ? := procedureStored(P_CURSOR)}";

Maybe you are looking for

  • My iWeb page is not displaying correctly?

    hi I created a site in iWeb 08 (version 2.0.4. - 830A43), exported to a folder, and then uploaded to the web via ClassicFTP (Mac). Does not display correctly, but not sure why. temp URL is http://223.130.24.65/~vstacoma/Site/home.html The font appear

  • BAPI/ FM in CRM to create a sales order with variant configurble material

    Hi All, I need to create a sales order using variant configurable material in CRM not manually through GUI. I need to develop a function module that will create sales order using variant configurable material in CRM . Can some one tell me if there is

  • Jstl function tags question

    I'm trying to output the size of a Vector in jstl 1.1 like <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%@ taglib uri="/tags/struts-html" prefix="html" %> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib ur

  • .mac website question

    I know this is off topic, but I want to build a website in iweb. I know you have to use .mac to publish it very easy. IS there a way to do it with out it? Also do you have to publish it to the .mac site, or can you publish it to your own domain? Ya k

  • Framework Class CL_RSRD_PRODUCER_PRECALC type PROD delivers no document

    Hi Im working in Query Designer and go to option Publish - BEx Broadcaster I create a new timing of an e-mail transmission with PDF, If I will carry out, then I get the message  "framework Class CL_RSRD_PRODUCER_PRECALC type PROD delivers no document