How to pass array of Object in A Procedure using OCCI.......

I m also trying for How to pass Object to a procedureb using OCCI...
Steps....
1. I created A type.....
2. Then I created a VARRAY using that Type.
3.After that I have written An Procedure with object as a parameter..
now using OCCI how do u bind the parameter with this . plz note that using OTT
i have already created the class representation of above object type i.e class
four Files Created 1> demo.h 2>registermapping.h
3> demo.cpp 2>registermapping.cpp
After I want to Pass the Values in A Vector...
vctor<full_name *> vect;
stmt=con->createStatement("BEGIN Add_Object(:1); END;");
full_name *name1 = new full_name; //Giving the Error here Given below....
name1->
name1->
Through name1 Which Function I will call in which I will Pass a String....
like
name1->readSQL("Sanjay"); Or I have to add a function......
vect.push_back(name1);
setVector(stmt,1,vect,"FULL_NAME");
error C2259: 'FullName' : cannot instantiate abstract class
can u plz suggest me Why this Error is Giving......?
How to pass the data?
setFirst_name() and setLast_name() this two function I will add in Demo.cpp which one created automativcally by Using OTT command.....or other way plz tell me Boss ....
Can u lz Suggest me ASAP....

hi Nishant ,
What u have done Now I mm trying ....
can u Plz Suggest me......
How to pass and Array of Object in Procedure using OCCI... Doing....
90% finished Two Error's Are Coming...
1> If I create the Class then Data Not Inserting table......
2> If I will create the Class through OTT command.......
then U can't Instantiate Object It is DIsplying ,this is Abstract Class(PObject)...
Beco'z the below Method is Not adding Automatically by OTT command which is Pure Virtual Function.....
But I added this Function Still SAme Error Giving..
getSQLTypeName(oracle::occi::Environment env, void *schName,
unsigned int &schNameLen, void **typeName,
     unsigned int &typeNameLen) const
Plz Suggest me....
regard's
sanjay

Similar Messages

  • How to bind arrays to PL/SQL stored procedure using OCI?

    Hi,
    We are having problems trying to bind arrays to PL/SQL stored procedure using OCI. Here is the situation:
    - We have a stored procedure called "GetVEPFindTasks" with the following interface:
    PROCEDURE GetVEPFindTasks (
    p_ErrorCode OUT NUMBER,
    p_ErrorMsg OUT VARCHAR2,
    p_RowCount OUT NUMBER,
    p_VEPFindTasks OUT t_VEPFindTaskRecordTable,
    p_MaxTask IN NUMBER);
    t_VEPFindTaskRecordTable is a record with the following entries:
    TYPE t_VEPFindTaskRecord IS RECORD (
    RTCID NUMBER,
    TransNum NUMBER,
    TransTimestamp VARCHAR2(20),
    Pathname1 image_data.pathname%TYPE,
    Pathname2 image_data.pathname%TYPE,
    Pathname3 image_data.pathname%TYPE,
    OperatorID operator.id%TYPE);
    - Now, we are trying to call the stored procedure from C++ using OCI (in UNIX). The call that we use are: OCIBindByName and OCIBindArrayOfStruct to bind the parameters to the corresponding buffers. We bind all parameters in the interface by name. Now, we do bind the record's individual item by name (RTCID, TransNum, etc.), and not as a record. I don't know if this is going to work. Then, we use the bind handles of the binded record items (only record items such as RTCID, TransNum, and NOT error_code which is not part of the record) to bind the arrays (using OCIBindArrayOfStruct).
    All of the parameters that are binded as arrays are OUTPUT parameters. The rest are either INPUT or INPUT/OUTPUT parameters. Now, when we try to execute, OCI returns with an error "Invalid number or types of arguments" (or something to that sort... the number was something like ORA-06550). Please help...
    Is there any sample on how to use the OCIBindArrayOfStruct with PL/SQL stored procedures? The sample provided from Oracle is only for a straight SQL statement.
    Thank's for all your help.
    ** Dannil Chan **

    As you said:
    You have to pass in an array for every field and deconstruct/construct the record in the procedure. There is no support for record type or an array of records. Can you give me a example? I'am very urgently need it.
    thanks
    email: [email protected]

  • How to pass a array of object to oracle procedure using callable

    Hi,
    I am calling a oracle stored procedure using callable statement which has IN and OUT parameter of same type.
    IN and OUT are array of objects. (ie) IN parameter as Array of Objects and OUT parameter as Array of Objects
    here are the steps i have done as advised from oracle forum. correct me if i am in wrong direction
    ORACLE types and Stored Procedure
    CREATE OR REPLACE
    TYPE APPS.DEPARTMENT_TYPE AS OBJECT (
    DNO NUMBER (10),
    NAME VARCHAR2 (50),
    LOCATION VARCHAR2 (50)
    CREATE OR REPLACE
    TYPE APPS.DEPT_ARRAY AS TABLE OF department_type;
    CREATE OR REPLACE package body APPS.insert_object
    IS
    PROCEDURE insert_object_prc (d IN dept_array, d2 OUT dept_array)
    IS
    BEGIN
    d2 := dept_array ();
    FOR j IN 1 .. d.COUNT
    LOOP
    d2.EXTEND;
    d2 (j) := department_type (d (j).dno, d (j).name, d(j).location);
    END LOOP;
    END insert_object_prc;
    END insert_object;
    JAVA CODE
    Value Object
    package com.custom.vo;
    public class Dep {
    public int empNo;
    public String depName;
    public String location;
    public int getEmpNo() {
    return empNo;
    public void setEmpNo(int empNo) {
    this.empNo = empNo;
    public String getDepName() {
    return depName;
    public void setDepName(String depName) {
    this.depName = depName;
    public String getLocation() {
    return location;
    public void setLocation(String location) {
    this.location = location;
    to call stored procedure
    package com.custom.callable;
    import com.custom.vo.Dep;
    import oracle.jdbc.OracleCallableStatement;
    import oracle.jdbc.OracleConnection;
    import oracle.jdbc.OracleTypes;
    import oracle.jdbc.pool.OracleDataSource;
    import oracle.sql.ARRAY;
    import oracle.sql.ArrayDescriptor;
    import oracle.sql.Datum;
    import oracle.sql.STRUCT;
    import oracle.sql.StructDescriptor;
    public class CallableArrayTryOut {
    private static OracleDataSource odcDataSource = null;
    public static void main(String[] args) {
    OracleCallableStatement callStatement = null;
    OracleConnection connection = null;
    try {
    odcDataSource = new OracleDataSource();
    odcDataSource
    .setURL("......");
    odcDataSource.setUser("....");
    odcDataSource.setPassword("....");
    connection = (OracleConnection) odcDataSource.getConnection();
    } catch (Exception e) {
    System.out.println("DB connection Exception");
    e.printStackTrace();
    Dep[] dep = new Dep[2];
    dep[0] = new Dep();
    dep[0].setEmpNo(100);
    dep[0].setDepName("aaa");
    dep[0].setLocation("xxx");
    dep[1] = new Dep();
    dep[1].setEmpNo(200);
    dep[1].setDepName("bbb");
    dep[1].setLocation("yyy");
    try {
    StructDescriptor structDescriptor = new StructDescriptor(
    "APPS.DEPARTMENT_TYPE", connection);
    STRUCT priceStruct = new STRUCT(structDescriptor, connection, dep);
    STRUCT[] priceArray = { priceStruct };
    ArrayDescriptor arrayDescriptor = ArrayDescriptor.createDescriptor(
    "APPS.DEPT_ARRAY", connection);
    ARRAY array = new ARRAY(arrayDescriptor, connection, priceArray);
    callStatement = (OracleCallableStatement) connection
    .prepareCall("{call insert_object.insert_object_prc(?,?)}");
    ((OracleCallableStatement) callStatement).setArray(1, array);
    callStatement.registerOutParameter(2, OracleTypes.ARRAY,
    "APPS.DEPT_ARRAY");
    callStatement.execute();
    ARRAY outArray = callStatement.getARRAY(2);
    Datum[] datum = outArray.getOracleArray();
    for (int i = 0; i < datum.length; i++) {
    oracle.sql.STRUCT os = (oracle.sql.STRUCT) datum[0];
    Object[] a = os.getAttributes();
    for (int j = 0; j < a.length; j++) {
    System.out.print("Java Data Type :"
    + a[j].getClass().getName() + "Value :" + a[j]
    + "\n");
    connection.commit();
    callStatement.close();
    } catch (Exception e) {
    System.out.println("Mapping Error");
    e.printStackTrace();
    THE ERROR
    Mapping Errorjava.sql.SQLException: Inconsistent java and sql object types
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1130)
    at oracle.sql.StructDescriptor.toOracleArray(StructDescriptor.java:823)
    at oracle.sql.StructDescriptor.toArray(StructDescriptor.java:1735)
    at oracle.sql.STRUCT.<init>(STRUCT.java:136)
    at com.custom.callable.CallableArrayTryOut.main(CallableArrayTryOut.java:48)

    You posted this question in the wrong forum section. There is one dedicated to Java that was more appropriate.
    Anyway here is a link that describes what you should do.
    http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/oraarr.htm#i1049179
    Bye Alessandro

  • Passing array of objects to the procedure

    Hi I have written a procedure to accept array of objects as input . it worked fine.
    this is the only input parameter in my procedure.
    But now I tried to add an out put parameter of type varchar2 to my procedure to send some return value but it gives me an error
    PLS-00410: duplicate fields in RECORD,TABLE or argument list are not permitted.
    please suggest cant i pass any other arguments when using a record or object array as parameter?
    this is my code
    CREATE OR REPLACE TYPE PREF_OBJ_TYPE as object (
    PREF_CD  varchar2(20),
    USR_ID   VARCHAR2(20),
    PROD_CD  VARCHAR2(50),
    DFLT_PREF_VAL_TX VARCHAR2(250),
    USR_PREF_VAL_TX VARCHAR2(250),
    CRE_USR_ID VARCHAR2(20),
    UPDT_USR_ID VARCHAR2(20) );
    CREATE OR REPLACE TYPE PREF_ARRAY is table of PREF_OBJ_TYPE;
    CREATE OR REPLACE procedure MMM(in_pref PREF_ARRAY,v_err out varchar2 )
    is
    v_prod_dim_nb NUMBER;
    v_usr_dim_nb  NUMBER;
    v_count NUMBER;
    v_err varchar2(50);
    begin
    for i in  in_pref.first.. in_pref.last
    LOOP
    /* Derive the product and user dim numbers */
    select prod_dim_nb into  v_prod_dim_nb from prod_dim where prod_cd=in_pref(i).prod_cd ;
    select usr_dim_nb into v_usr_dim_nb from usr_xref where usr_id=in_pref(i).usr_id and sys_id='ACCESS';
    /* check if the record already exist in usr_prod_pref corresponding to that  user,prod,pref */
    select count(1) into v_count from usr_prod_pref_test where prod_dim_nb=v_prod_dim_nb and usr_dim_nb=v_usr_dim_nb and pref_cd=in_pref(i).pref_cd;
    if v_count=0 then
    BEGIN
    INSERT INTO USR_PROD_PREF_TEST values(v_usr_dim_nb,in_pref(i).pref_cd,v_prod_dim_nb,in_pref(i).DFLT_PREF_VAL_TX,in_pref(i).usr_PREF_VAL_TX,'Active',NULL,
    in_pref(i).cre_usr_id,sysdate,in_pref(i).updt_usr_id,NULL);
    END;
    else
    update USR_PROD_PREF_TEST set USR_PREF_VAL_TX=in_pref(i).USR_PREF_VAL_TX,DFLT_PREF_VAL_TX=in_pref(i).DFLT_PREF_VAL_TX,UPDT_USR_ID=in_pref(i).updt_usr_id,updt_dt=sysdate,cre_usr_id=in_pref(i).cre_usr_id where
    prod_dim_nb=v_prod_dim_nb and usr_dim_nb=v_usr_dim_nb and pref_cd=in_pref(i).pref_cd;
    end if;
    end loop;
    commit;
    v_err:='abc';
    end;
    /Edited by: raj_fresher on Oct 9, 2009 6:56 AM

    okay i was wondering.... if he knew the error code in advance i thought user defined messages have numbers like -20000 to 209999 or something like that..
    neverthless one final question ....
    Now that my procedure is ready .. i have 2 final questions for this thread
    1) is my usage of errorcode and error message to return to the calling application correct?
    2) how to test this procedure in sql plus (or) toad?
    i mean how to call?
    exec modify_user_preferences(value, ?????(what should  i write here for output variable ) ) ?? i want to check what value is it returning?
    CREATE OR REPLACE procedure MODIFY_USER_PREFERENCES2(in_pref PREF_ARRAY,v_status_message out varchar2  )
    is
    v_prod_dim_nb NUMBER;
    v_usr_dim_nb  NUMBER;
    v_count NUMBER;
    v_product_exception EXCEPTION;
    v_user_exception EXCEPTION;
    p_error_code varchar2(50);
    p_error_msg varchar2(50);
    begin
    for i in  in_pref.first.. in_pref.last
    LOOP
    /* Derive the product and user dim numbers */
    begin
    select prod_dim_nb into  v_prod_dim_nb from prod_dim where prod_cd=in_pref(i).prod_cd ;
    EXCEPTION
        WHEN NO_DATA_FOUND THEN
            p_error_code := sqlcode;
            p_error_msg := SQLERRM;
            raise v_product_exception;
    end;
    BEGIN
    select usr_dim_nb into v_usr_dim_nb from usr_xref where usr_id=in_pref(i).usr_id and sys_id='ACCESS';
    EXCEPTION
        WHEN NO_DATA_FOUND THEN
            p_error_code := sqlcode;
            p_error_msg := SQLERRM ;
            raise v_product_exception;
          raise v_user_exception;
    END;
    /* check if the record already exist in usr_prod_pref corresponding to that  user,prod,pref */
    select count(1) into v_count from usr_prod_pref_test where prod_dim_nb=v_prod_dim_nb and usr_dim_nb=v_usr_dim_nb and pref_cd=in_pref(i).pref_cd;
    if v_count=0 then
    BEGIN
    INSERT INTO USR_PROD_PREF_TEST values(v_usr_dim_nb,in_pref(i).pref_cd,v_prod_dim_nb,in_pref(i).DFLT_PREF_VAL_TX,in_pref(i).usr_PREF_VAL_TX,'Active',NULL,
    in_pref(i).cre_usr_id,sysdate,in_pref(i).updt_usr_id,NULL);
    END;
    else
    update USR_PROD_PREF_TEST set USR_PREF_VAL_TX=in_pref(i).USR_PREF_VAL_TX,DFLT_PREF_VAL_TX=in_pref(i).DFLT_PREF_VAL_TX,UPDT_USR_ID=in_pref(i).updt_usr_id,updt_dt=sysdate,cre_usr_id=in_pref(i).cre_usr_id where
    prod_dim_nb=v_prod_dim_nb and usr_dim_nb=v_usr_dim_nb and pref_cd=in_pref(i).pref_cd;
    end if;
    end loop;
    commit;
    v_status_message:='SUCCESS';
    exception
    when v_product_exception then
    v_status_message:= 'invalid product code  '||p_error_code||p_error_msg;
    when v_user_exception then
    v_status_message:= 'invalid user'||p_error_code||p_error_msg;
    end;
    /Edited by: raj_fresher on Oct 9, 2009 7:33 AM

  • Can we pass the HashMap object to Stored procedure using toplink

    Can we send the java.util.Map object as input to the stored procedures.
    Can any one please tell how we can do this using toplink.
    I tried to do that by doing following steps
    1. Crated the
    -- Column Name - Value Pair
    CREATE TYPE col_data_pair IS OBJECT (column_name varchar2(50), data VARCHAR2(32767))
    2. create or replace PROCEDURE XL_MAP_TEST (poData In COL_DATA_PAIR) as
    v_timestamp TIMESTAMP;
    BEGIN
    INSERT INTO RECON_ATTR_UD_TFCHILD(RECON_TABLE_KEY, RE_KEY, RECON_UD_TESTFORM_KEY,RECON_UD_TFCHILD_GROUP)
    values (RECON_TABLE_KEY_SEQ.NEXTVAL,15, 25 ,'Persistentss23');
    END XL_MAP_TEST;
    3. .
    [junit] Exception [TOPLINK-4002] (Oracle TopLink - 11g Release 1 (11.1.1.0.0) (Build 080121)): oracle.toplink.exceptions.DatabaseException
    [junit] Internal Exception: java.sql.SQLException: Invalid column type
    [junit] Error Code: 17004
    [junit] Call: BEGIN XL_MAP_TEST(?); END;
    [junit] bind => [null => poData]
    [junit] Query: ValueReadQuery()
    [junit] at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:304)
    [junit] at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:613)
    [junit] at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:467)
    [junit] at oracle.toplink.threetier.ServerSession.executeCall(ServerSession.java:447)
    [junit] at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
    [junit] at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:179)
    [junit] at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:250)
    [junit] at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeSelect(DatasourceCallQueryMechanism.java:232)
    [junit] at oracle.toplink.queryframework.DirectReadQuery.executeNonCursor(DirectReadQuery.java:92)
    [junit] at oracle.toplink.queryframework.DataReadQuery.executeDatabaseQuery(DataReadQuery.java:118)
    [junit] at oracle.toplink.queryframework.ValueReadQuery.executeDatabaseQuery(ValueReadQuery.java:55)
    [junit] at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:671)
    [junit] at oracle.toplink.queryframework.DataReadQuery.execute(DataReadQuery.java:104)
    [junit] at oracle.toplink.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:2260)
    [junit] at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java
    [junit] Caused by: java.sql.SQLException: Invalid column type
    [junit] at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
    [junit] at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:110)
    [junit] at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:171)
    [junit] at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:
    4. StoredProcedureCall spc = new StoredProcedureCall();
    HashMap poData = new HashMap();
    poData.put("d", "s");
    poData.put("s", "s");
    spc.setProcedureName(procedureName);
    spc.addUnamedInOutputArgument("poData", "poData", Types.OTHER,
    "COL_DATA_PAIR",HashMap.class);
    ValueReadQuery query = new ValueReadQuery();
    query.setCall(spc);
    query.addArgument("poData");
    Vector args = new Vector();
    args.add(poData);
    session.executeQuery(query, args);

    Hi
    Thanks for your inputs. Can you please send me the code stuff how we can use ObjectRelationalDescriptor. I tried to do that by doing following steps
    1. Crated one class
    oracle.InputOfTypeMap poData =
                        new oracle.InputOfTypeMap();
    poData.setKay("ddd");
    poData.setValue("ddd");
    2. oracle.toplink.objectrelational.ObjectRelationalDescriptor descriptor =
         new oracle.toplink.objectrelational.ObjectRelationalDescriptor();          descriptor.setJavaClass(oracle.iam.reconciliation.vo.InputOfTypeMap.class);      
              descriptor.setStructureName("COL_DATA_PAIR");      
              descriptor.addFieldOrdering("column_name");
              descriptor.addFieldOrdering("data");      
              descriptor.addDirectMapping("key", "column_name");
              descriptor.addDirectMapping("value", "data");
    3. I was not sure how to use this further StoredProcedureCall
    Can you plese help me, how we can do that?

  • XSLT - How to pass a Java object to the xslt file ?

    Hi ,
    I need help in , How to pass a java object to xslt file.
    I am using javax.xml.transform.Tranformer class to for the xsl tranformation. I need to pass a java object eg
    Class Employee {
    private String name;
    private int empId;
    public String getName() {
    return this.name;
    public String getEmpId() {
    return this.empId;
    public String setName(String name) {
    this.name = name;
    public String setEmpId(int empId){
    this.empId = empId;
    How can i access this complete object in the xsl file ? is there any way i can pass custom objects to xsl using Transformer class ?

    This is elementary. Did you ask google ? http://www.google.com/search?q=calling+java+from+xsl
    ram.

  • How to return array of object

    public class A{
    public class B{
    publc C[] sample()
    int i=0;
    ResultSet rset = s.executeQuery("select name, id  from emp ");
    while(rs.next()){
    name = rset.getString("nam");
    id = rset.getInt("id");
    c.setName(name )
    c[i].setId(id)
    return c[]
    public class C{
    // here i have getter and setter metod for name & id
    When I try to return the object c[]..i am getting "cannot conver from C to C[]".
    Can u pls help me, how to return array of object and how to get name and id values in other class using this array object
    Thanks for ur help

    public class Starting{
    public long empID;
    Data data = new Data();
    Value[] value;
    int count = 0;
         public static void executeDe(){
              value = new Value[100]
              try{
                     data.getDetails()
                     processDetails(value);
                   }catch(Exception e){e.printStackTrace();}
         public static void processDetails(Value[] value){
         count = data.i;
              int i;
              for(i=0;i<count;i++){
                  empID=value.getempID(); \\ here i am not getting all values..... am getting only last value of the array
    public class Data{
    public long empID;
    public int i=0;
    static Value[] value = new Value[100];
    public static Value[] getDetails(){
    Connection con=null;
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    con=DriverManager.getConnection("jdbc:oracle:thin:@" + hostname + ":1521:" + sid, user, password);
    System.out.println(" conn " + con);
    System.out.println("");
    Statement s=con.createStatement();
    try{
         ResultSet rset = s.executeQuery("select EMPID from Employee ");
         while(rset.next()){
    empID = rset.getLong("EMPID");
    value[i].setCycleID(cy_i);
    i++;
         rset.close();
         con.close();
    }catch (SQLException sqle){sqle.printStackTrace();}
         finally{
              try{
              s.close();
         con.close();
              }catch(SQLException e){e.printStackTrace();}
    catch(Exception e){e.printStackTrace();}
    return value;
         public class Value {
         public static long cycleID;
              public static void setempID(long empID) {
                   Value.empID = empID;
              public static long getempID() {
                   return empID;
    This is my actual code..... I am able to set the values in Value class from Data class using getDetails() method, which is returning array of value object.
    In Starting class, I am trying to get values using value[i].. i am getting last value of the array. This is my actual problem... here i want to get all values.
    Please help me how to resolve this.

  • How to pass a single quote in a URL using Javascript

    Can someone tell me how to pass a single quote in a URL using Javascript. I have created a Javascript funciton in which I pass several column values from an APEX report.
    The URL for the report link I am using is "JAVASCRIPT:passBack('#EMP_ID#','#Name#','#e-mail#')"
    The problem occurs with the Name and e-mail columns contain a single quote (i.e. James O'Brien)

    Thank you Saad, that worked.
    Since I built the report using type 'SQL Query (PL/SQL function fody returning SQL query)' I had to add some additional quotes to get it to work.
    i.e.
    replace(EMP_EMAIL_NAME,'''''''',''\'''''')
    or
    replace(EMP_EMAIL_NAME,chr(39),''\'''''')
    Thanks for the help,
    Jason

  • How to pass the parameter of a stored procedure to iReport

    Hi... i don't know how to pass the parameter of the stored procedure to the iReport.
    In the Report Query, i tried
    1. sp_storedprocedure ' value'
    2. sp_storedprocedure +''''+$P{parameter}+''''+
    3. sp_storedprocedure +$V+$P{parameter}++$F($F is a variable having a value of ' (a single quote))may you enlighten us please? thank you

    For M$ SQL server I find that it only works when U use the fully qualified name...
    e.g. catalod.dbo.my_procedure_name 'variable'
    My full query in the Report Query window is something like this:
    EXEC arc.dbo.jasper_Invoice 1000
    Note that you may find that selecting from VIEWS / TABLES fails for no apparent reason and iReport will prompt you with the usual very unhelpful (we have what we "pay" for) prompt, stating that "The document is empty".
    To work around this issue, where a statement like "SELECT * FROM arc.dbo.acc_invoices WHERE Invoice_id=1000" does not work, simply create a PROC, something like:
    CREATE PROC jasper_MyProc (@my_rec_id integer) AS
    SELECT * FROM arc.dbo.acc_invoices WHERE Invoice_id= @my_rec_id integer
    ...to wrap your SELECT statement, then call the PROC
    Edited by: Sylinsr on Apr 22, 2008 4:23 PM

  • How to Pass multiple parameter into single store procedure

    How to Pass multiple parameter into single store procedure
    like a one to many relationship.
    it is possible then reply me immediatly

    you mean like this .....
    CREATE OR REPLACE procedure display_me(in_param in varchar2,in_default in varchar2 := 'Default') is
    BEGIN
    DBMS_OUTPUT.put_line ('Values is .....'||in_param || '....'||in_default);
    END display_me;
    CREATE OR REPLACE procedure display_me_2 as
    cnt integer :=0;
    BEGIN
    For c1_rec In (SELECT empno,deptno FROM test_emp) Loop
         display_me(in_param => c1_rec.empno);
         cnt := cnt+1;
         end loop;
         DBMS_OUTPUT.put_line('Total record count is ....'||cnt);
    END display_me_2;
    SQL > exec display_me_2
    Values is .....9999....Default
    Values is .....4567....Default
    Values is .....2345....Default
    Values is .....7369....Default
    Values is .....7499....Default
    Values is .....7521....Default
    Values is .....7566....Default
    Values is .....7654....Default
    Values is .....7698....Default
    Values is .....7782....Default
    Values is .....7788....Default
    Values is .....7839....Default
    Values is .....7844....Default
    Values is .....7876....Default
    Values is .....7900....Default
    Values is .....7902....Default
    Values is .....7934....Default
    Values is .....1234....Default
    Total record count is ....18

  • How to pass Array of Java objects to Callable statement

    Hi ,
    I need to know how can I pass an array of objects to PL/SQL stored procedure using callable statement.
    So I am having and array list of some object say xyz which has two attributes string and double type.
    Now I need to pass this to a PL/SQL Procedure as IN parameter.
    Now I have gone through some documentation for the same and found that we can use ArrayDescriptor tp create array (java.sql.ARRAY).
    And we will use a record type from SQL to map this to our array of java objects.
    So my question is how this mapping of java object's two attribute will be done to the TYPE in SQL? can we also pass this array as a package Table?
    Please help
    Thanks

    I seem to remember that that is in one of Oracle's online sample programs.
    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/index.html

  • Passing an array of objects to stored procedure(oracle)

    I have to pass an array of objects to a pl/sql stored proc.
    Its prototype is,
    proc_orderins(ordernum varchar2(14), ct newTask)
    where newTask is an array of objects:
    type task as object ( name varchar2(20),odd varchar2(8),sdd varchar2(8));
    create or replace type newTask as VARRAY(25) OF Task;
    will the following work from the java code :
    public class CriticalTask
    String name,odd,sdd;
    public CrticalTask(String name,String odd,String sdd)
    this.name=name;
    this.odd=odd;
    this.sdd=sdd;
    Object [] ctasks =new Object[7];
    for(i=0;i<7;i++)
    Object=new CrtitcalTask("x","x","x");
    String query="{call proc_orderins(?,?)}";
    CallableStatement cstmt=con.prepareCall(query);
    cstmt.setInt(123);
    cstmt.setObject(ctasks);
    cstmt.execute();
    will the above code work, when I am passing an array?

    Use code tags when you post code.
    I am rather certain that the code you posted will not work.
    Technically you should be able to use the java.sql.Array interface.
    The newest Oracle drivers might support that (you would have to investigate how to use it.)
    It is however possible that it isn't supported. If not then you will have to use one of the Oracle specific classes that is documented in the Oracle jdbc documentation.

  • How to pass arrays to plsql from OAF

    Hi guys ,
    I need to call the following package.procedure from OAF
    create or replace package CIE_ONT_Lines_Pkg
    as
    type linesTab is table of number;
    procedure process_Lines(p_lines_tab linesTab);
    end;
    how do i pass a int array to the above package procedure ?
    Thanks
    Tom.

    Tom,
    Follow the code below as a sample:
    I wrote it once for a friend, but didn't had a chance to test it :). It should be on an old thread also. look for that thread for more explanation otherwise let me know.
    public oracle.sql.ARRAY getVoArray()
    Connection conn = this.tx.getJdbcConnection();
    OAViewObject vo = (OAViewObject)this.appModule.findViewObject("TestVO");
    try
    ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor
    ("TABLE_OF_BELOW_ROW_TYPE"
    ,conn
    StructDescriptor voRowStructDesc = StructDescriptor.createDescriptor
    ("XXX_TO_BE_SEND_ROW_TYPE"
    ,conn
    TestVORowImpl row = null;
    String name;
    String desc;
    int fetchedRowCount = vo.getFetchedRowCount();
    STRUCT [] finalStruct = new STRUCT[fetchedRowCount];
    Object[] attrField = new Object[1];
    RowSetIterator entityIdIter1 = vo.createRowSetIterator("entityIdIter1");
    if (fetchedRowCount > 0)
    entityIdIter1.setRangeStart(0);
    entityIdIter1.setRangeSize(fetchedRowCount);
    for (int i = 0; i < fetchedRowCount; i++)
    row = (TestVORowImpl )entityIdIter1.getRowAtRangeIndex(i);
    name = (String)row.getName();
    desc = (String)row.getDesc();
    attrField[0] = (String)name;
    finalStruct[i] = new STRUCT(voRowStructDesc, conn, attrField);
    entityIdIter1.closeRowSetIterator();
    oracle.sql.ARRAY yourArray = new oracle.sql.ARRAY(descriptor, conn, finalStruct);
    return yourArray;
    return null;
    catch(java.sql.SQLException ex)
    throw OAException.wrapperException(ex);
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to pass a locale object into another function?

    Greetings,
    i like to pass a locale object into another function. These are my code below
    import java.util.*;
    public class Locales{
         public static void main(String[] args){
              Locale locale= new Locale("EN", "US");
              convert(locale);
    public void convert(Locale convert)
         String language = convert.getDisplayLanguage();
         System.out.println(language);          
    }I got this error:
    Locales.java:6: non-static method convert(java.util.Locale) cannot be referenced from a static content
                    convert(locale);
                    ^How do i correct it?
    Thanks

    Did you bother to do a search?
    Did you bother to read any of the material that the search would have linked you to?
    If you had then you would be able to understand where you are going wrong and how to fix it yourself. Instead of being spoonfed by us.

  • How to pass the java object into the spring controller

    Hi Friends
    When I hit the url at the first time my call goes to the spring controller and sets the userDetails objects in the modelAndView.addObject("userDetails", userDetails.getUserDetails()) and returns the userDetails.html page. if I click any link in the same page i want to pass same (userDetails) object thru javascript or jquery and calls the another(controller) method and returns the same (userDetails.html) page.
    It means how can i pass the java object thru javascript or jquery and calls the controller. if i get the same object in my controller i can avoid calling the db again. please help me out to resolve this issue. i am tired of fixing this issue.
    Regards
    Sherin Pooja

    If you want to avoid calling the database again then cache the data.
    However before you do that make sure that calling the database, in the context of YOUR system, is going to be an actual problem.
    For example there is absolutely no point in caching a  User object when only one user an hour is actually using the system.

Maybe you are looking for

  • LORD: ERP Quotation passing custom fields to ERP system

    Hi Gurus I extended the ERP quotation screen with custom fields which are same like ERP fields using AET and generated the setter and getter and methods for those fields in CRM system , but after entering the values into the custom fields and pressin

  • Page displays only part of ivew.

    Hi Gurus We had created an iview which is displaying an Abap form, from R/3 . we can  see the same in preview of ivew. But , as we add iview to page ,in preview(of page) we see only part of ivew i.e form.But we need to display in full page. We had ch

  • I have an Intel-based iMac G5, running OS 10.6.8. Can I upgrade to Mountain Lion?

    I just upgraded from 2GB RAM to 4GB, thinking this was all I needed to do. But now it's telling me that Mountain Lion won't run on my machine. So am I stuck in the pre-iCloud world?

  • Unconvertable PR through MRP

    Hi...       How to Create Unconvertable Purchase Requisition Through MRP. Means System should generted PR in MRP but it should not be converted to Purchase Order.

  • How do i restore iPhone backup

    I sync my iPhone to a PC running Vista. I had to make some radical changes to Outlook, and when I synchronized afterwards my entire calendar AND contacts directories on my iPhone were completely empty. I recall that iTunes makes a back-up of the iPho