Create a Java Object with Dynamic Variables

Hi ,
I am constructing a web based system which stores personal information on people. I have created a Person class with all the obvoius variables, forename, surname, address etc.. My problem is that some clients wish to make use of some of the variables, some want other variables and as i meet others they wish to add in some new variables eg
Client 1 wishes to store; Forename, Surname and Address
Client 2 wishes to store Forename, AltForename, Surname, AltSurname and Address ( AltForename - this is an alternative Forename in this case the Irish translation of their English name)
Client 3 wishes to store Forename, Surname, Title, Address, Height, Weight, DOB, School, Occcupation.
Each of the clients above need to submit these in an online form with each form looking different due to the fields they have to enter and also with different validation rules.
At present i have a Person object handling all fields i can think of and different validation methods depending on the client, but there must be a better way of doing this as each time a new field is added by a new or existing client, i not only have to update the java and jsp but also the DB.
This is all web based and i wish to use the same code base and data source for all clients. I also wish it to be all web based. So in theory if a client asked to add in a "middle name" field to their form and make it mandatory, i could go to an admin page which lists all the possible input element types and select the "field type" then set validation rules on it.
All the web based and DB parts can be ignored - the main issue here is creating a Person class which can have any number of variables of varying types ( String, Int, etc)
Regards,
Cormac
Edited by: cormacodonnell on Jun 27, 2008 6:33 AM

cormacodonnell wrote:
Hi ,
I am constructing a web based system which stores personal information on people. I have created a Person class with all the obvoius variables, forename, surname, address etc.. My problem is that some clients wish to make use of some of the variables, some want other variables and as i meet others they wish to add in some new variables eg
Client 1 wishes to store; Forename, Surname and Address
Client 2 wishes to store Forename, AltForename, Surname, AltSurname and Address ( AltForename - this is an alternative Forename in this case the Irish translation of their English name)
Client 3 wishes to store Forename, Surname, Title, Address, Height, Weight, DOB, School, Occcupation.You could extend the Person class with 3 sub classes, but that might be overkill just to store personal info.
Each of the clients above need to submit these in an online form with each form looking different due to the fields they have to enter and also with different validation rules.
At present i have a Person object handling all fields i can think of and different validation methods depending on the client, That's probably how I'd do it if it's not too much trouble. But to be OO you should probably go the inheritence route.
but there must be a better way of doing this as each time a new field is added by a new or existing client, i not only have to update the java and jsp but also the DB. Welcome to software development. It's called "feature creep" or "scope creep". As soon as you get your code working right and deploy it and get ready to go on vacation, the customer always comes back with something else they "need" or "forgot". The app I'm building right now I've rewritten or changed 7 times in 3 months because nobody has a clue what they really need.

Similar Messages

  • How to create a Type Object with Dynamic select query columns in a Function

    Hi Every One,
    I'm trying to figure out how to write a piplined function that executes a dynamic select query and construct a Type Object in order to assigned it to the pipe row.
    I have tried by
    SELECT a.DB_QUERY INTO actual_query FROM mytable a WHERE a.country_code = 'US';
    c :=DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE(c,actual_query,DBMS_SQL.NATIVE);
    l_status := DBMS_SQL.EXECUTE(c);
    DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
    FOR j in 1..col_cnt LOOP
    DBMS_SQL.DEFINE_COLUMN(c,j,v_val,2000);
    END LOOP;
    FOR j in 1..col_cnt LOOP
    DBMS_SQL.COLUMN_VALUE(c,j,v_val);
    END LOOP;
    But got stuck, how to iterate the values and assign to a Type Object from the cursor. Can any one guide me how to do the process.
    Thanks,
    mallikj2

    Hi Justin,
    First of thanks for your reply, and coming to my requirement, I need to report the list of items which are there in the dynamic select statement what am getting from the DB. The select statement number of columns may vary in my example for different countries the select item columns count is different. For US its '15', for UK it may be 10 ...like so, and some of the column value might be a combination or calculation part of other table columns (The select query contains more than one table in the from clause).
    In order to execute the dynamic select statement and return the result i choose to write a function which will parse the cursor for dynamic query and then iterate the values and construct a Type Object and append it to the pipe row.
    Am relatively very new for these sort of things, welcome in case of any suggestions to make it simple (Instead of the function what i thought to work with) also a sample narrating the new procedure will be appreciated.
    Thanks in Advance,
    mallikj2.

  • How to create a Java Object dynamically

    I want to convert a "DataObject (SDO) " into "Pure java object".
    For this i want to create a java object with the fields in Dataobject, and this should be in generic way.

    I want to convert a "DataObject (SDO) "What is a "DataObject (SDO)"?
    into "Pure
    java object".What is a "Pure java object"?
    For this i want to create a java object with the
    fields in Dataobject, What is stopping you? Do you not know how do define a class? Do you think you can add fields to the Object class? If that's what you mean, you're out of luck.
    and this should be in generic
    way.What do you mean "in generic way"? "Generic" is a very generic term. There are lots of contexts in which it could apply and lots of different possible meanings for "generic way."
    You'll have to explain your queston more clearly.

  • IMPORT statement with dynamic variable

    Friends, Need Help!!!!!!!
    Im trying IMPORT variable contents from a cluster table VARI. I can do a IMPORT without issues when I use exact name of the variable but I have issues with dynamic variable selection. Pls see code below.
    loop at objects.
       assign objects-name to <fs>.
       IMPORT <fs> to tmp_var from database vari(va) id st_key.
    endloop.
    I do not get any value to tmp_var.  Need help!
    thanks
    Bhaskar

    Try this.
    loop at objects.
    IMPORT (objects-name) to tmp_var from database vari(va) id st_key.
    endloop.
    Does it work?
    Regards,
    RIch Heilman

  • How to generate report with dynamic variable number of columns?

    How to generate report with dynamic variable number of columns?
    I need to generate a report with varying column names (state names) as follows:
    SELECT AK, AL, AR,... FROM States ;
    I get these column names from the result of another query.
    In order to clarify my question, Please consider following table:
    CREATE TABLE TIME_PERIODS (
    PERIOD     VARCHAR2 (50) PRIMARY KEY
    CREATE TABLE STATE_INCOME (
         NAME     VARCHAR2 (2),
         PERIOD     VARCHAR2 (50)     REFERENCES TIME_PERIODS (PERIOD) ,
         INCOME     NUMBER (12, 2)
    I like to generate a report as follows:
    AK CA DE FL ...
    PERIOD1 1222.23 2423.20 232.33 345.21
    PERIOD2
    PERIOD3
    Total 433242.23 56744.34 8872.21 2324.23 ...
    The TIME_PERIODS.Period and State.Name could change dynamically.
    So I can't specify the state name in Select query like
    SELECT AK, AL, AR,... FROM
    What is the best way to generate this report?

    SQL> -- test tables and test data:
    SQL> CREATE TABLE states
      2    (state VARCHAR2 (2))
      3  /
    Table created.
    SQL> INSERT INTO states
      2  VALUES ('AK')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('AL')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('AR')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('CA')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('DE')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('FL')
      3  /
    1 row created.
    SQL> CREATE TABLE TIME_PERIODS
      2    (PERIOD VARCHAR2 (50) PRIMARY KEY)
      3  /
    Table created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD1')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD2')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD3')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD4')
      3  /
    1 row created.
    SQL> CREATE TABLE STATE_INCOME
      2    (NAME   VARCHAR2 (2),
      3       PERIOD VARCHAR2 (50) REFERENCES TIME_PERIODS (PERIOD),
      4       INCOME NUMBER (12, 2))
      5  /
    Table created.
    SQL> INSERT INTO state_income
      2  VALUES ('AK', 'PERIOD1', 1222.23)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('CA', 'PERIOD1', 2423.20)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('DE', 'PERIOD1', 232.33)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('FL', 'PERIOD1', 345.21)
      3  /
    1 row created.
    SQL> -- the basic query:
    SQL> SELECT   SUBSTR (time_periods.period, 1, 10) period,
      2             SUM (DECODE (name, 'AK', income)) "AK",
      3             SUM (DECODE (name, 'CA', income)) "CA",
      4             SUM (DECODE (name, 'DE', income)) "DE",
      5             SUM (DECODE (name, 'FL', income)) "FL"
      6  FROM     state_income, time_periods
      7  WHERE    time_periods.period = state_income.period (+)
      8  AND      time_periods.period IN ('PERIOD1','PERIOD2','PERIOD3')
      9  GROUP BY ROLLUP (time_periods.period)
    10  /
    PERIOD             AK         CA         DE         FL                                             
    PERIOD1       1222.23     2423.2     232.33     345.21                                             
    PERIOD2                                                                                            
    PERIOD3                                                                                            
                  1222.23     2423.2     232.33     345.21                                             
    SQL> -- package that dynamically executes the query
    SQL> -- given variable numbers and values
    SQL> -- of states and periods:
    SQL> CREATE OR REPLACE PACKAGE package_name
      2  AS
      3    TYPE cursor_type IS REF CURSOR;
      4    PROCEDURE procedure_name
      5        (p_periods   IN     VARCHAR2,
      6         p_states    IN     VARCHAR2,
      7         cursor_name IN OUT cursor_type);
      8  END package_name;
      9  /
    Package created.
    SQL> CREATE OR REPLACE PACKAGE BODY package_name
      2  AS
      3    PROCEDURE procedure_name
      4        (p_periods   IN     VARCHAR2,
      5         p_states    IN     VARCHAR2,
      6         cursor_name IN OUT cursor_type)
      7    IS
      8        v_periods          VARCHAR2 (1000);
      9        v_sql               VARCHAR2 (4000);
    10        v_states          VARCHAR2 (1000) := p_states;
    11    BEGIN
    12        v_periods := REPLACE (p_periods, ',', ''',''');
    13        v_sql := 'SELECT SUBSTR(time_periods.period,1,10) period';
    14        WHILE LENGTH (v_states) > 1
    15        LOOP
    16          v_sql := v_sql
    17          || ',SUM(DECODE(name,'''
    18          || SUBSTR (v_states,1,2) || ''',income)) "' || SUBSTR (v_states,1,2)
    19          || '"';
    20          v_states := LTRIM (SUBSTR (v_states, 3), ',');
    21        END LOOP;
    22        v_sql := v_sql
    23        || 'FROM     state_income, time_periods
    24            WHERE    time_periods.period = state_income.period (+)
    25            AND      time_periods.period IN (''' || v_periods || ''')
    26            GROUP BY ROLLUP (time_periods.period)';
    27        OPEN cursor_name FOR v_sql;
    28    END procedure_name;
    29  END package_name;
    30  /
    Package body created.
    SQL> -- sample executions from SQL:
    SQL> VARIABLE g_ref REFCURSOR
    SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2,PERIOD3','AK,CA,DE,FL', :g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         CA         DE         FL                                             
    PERIOD1       1222.23     2423.2     232.33     345.21                                             
    PERIOD2                                                                                            
    PERIOD3                                                                                            
                  1222.23     2423.2     232.33     345.21                                             
    SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2','AK,AL,AR', :g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         AL         AR                                                        
    PERIOD1       1222.23                                                                              
    PERIOD2                                                                                            
                  1222.23                                                                              
    SQL> -- sample execution from PL/SQL block
    SQL> -- using parameters derived from processing
    SQL> -- cursors containing results of other queries:
    SQL> DECLARE
      2    CURSOR c_period
      3    IS
      4    SELECT period
      5    FROM   time_periods;
      6    v_periods   VARCHAR2 (1000);
      7    v_delimiter VARCHAR2 (1) := NULL;
      8    CURSOR c_states
      9    IS
    10    SELECT state
    11    FROM   states;
    12    v_states    VARCHAR2 (1000);
    13  BEGIN
    14    FOR r_period IN c_period
    15    LOOP
    16        v_periods := v_periods || v_delimiter || r_period.period;
    17        v_delimiter := ',';
    18    END LOOP;
    19    v_delimiter := NULL;
    20    FOR r_states IN c_states
    21    LOOP
    22        v_states := v_states || v_delimiter || r_states.state;
    23        v_delimiter := ',';
    24    END LOOP;
    25    package_name.procedure_name (v_periods, v_states, :g_ref);
    26  END;
    27  /
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         AL         AR         CA         DE         FL                       
    PERIOD1       1222.23                           2423.2     232.33     345.21                       
    PERIOD2                                                                                            
    PERIOD3                                                                                            
    PERIOD4                                                                                            
                  1222.23                           2423.2     232.33     345.21                       

  • Set Java Object with Java Long Object from JNI

    Hi,
    i am getting crazy with the jni...
    in Java i have the follwoing:
    public class blabla{
    Object myObject;
    i chose Object cause the return value from native is not known
    in case for a long value i handle it like this :
    //get the Long class
    jclass LongCls = env->FindClass("Ljava/lang/Long;");
    jmethodID jmid = env->GetMethodID(LongCls, "<init>","(J)V");
    //create an Long Object with the long return value
    jobject LongObj = env->NewObject(LongCls,jmid,longreturnvalue);
    //set Long Objekt - doesnt work!(jclazz is the class of the return Object of the blabla class)
    jfid = env->GetFieldID(jclazz, "myObject", "Ljava/lang/Object;");
    env->SetObjectField( returnobjectofblabla,jfid,LongObj );
    the long value is set fine in the Long Object but i cant set the Long Object with the SetObjectField method into the Object myObject.
    Java is shown that the myObject contains a Long Object but the long value of the Long Object is totally wrong and doesnt equal to the long value which has been set.But setting the value works fine- any ideas or solutions?
    Thank you!

    charliess wrote:
    sometimes i really wonder about the answers in this forum - until now i got not one answer that helps me, even i tried to write down the problem very detailed...
    Sometimes I wonder about people who jump onto a site and immediately assume that
    1. They are the most important person in the world
    2. That they deserved the absolute undivided attention of absolute everyone.
    3. That everyone should be absolutely polite to them and provide them with perfect answers.
    4. Feel free to denigrate and posit their own opinion on everything while ignoring anything else that anyone else says.
    5. Expect that everyone else should understand their poorly worded questions.
    Myself I find such individuals extremely amusing. Although they seldom stick around long here. At least not under their original alias.
    plaz tel me how to realise your error checking?example plz
    You start by having at least a basic understanding of C/C++ and java.
    Then you read the JNI documents, all of them, for each method that you are using.
    Then you write code such that it actually reflects the documents. For example you check return types. And probably deal with the possibility that JNI methods might throw exceptions.
    as far as i know the jni methods like getfieldids and so on throw exceptions other like stObject dont do that the just return nothing
    i can see all exceptions in my Java console thats not the Problem, setting the Long Object does not throwing a exception btw->
    Myself I wouldn't expect that a JNI exception would show in the java console. Could I suppose though.
    However nothing so far would suggest that an exception is being thrown. That however doesn't alter the fact that you must still write the code such that it could happen.
    is it possible in general to set an java Long Object created in C(native) into a Object type (Object) overgiven as parameter in my JNI function with the setObject method?
    Is it possible that you could actually follow my previous request and create some code that actually runs instead of cut and pasting whatever you feel like?
    plz answer also with code and examples i did the same for you...No you didn't. You posted something which would not compile and quite possibly doesn't represent your actual code at all.
    And please note that we do not get paid to do this. If you want to pay someone to solve your problem then there are sites for that.
    Paying someone allows you to make all sorts of demands. The more you pay the more people will put up with.
    If you don't want to pay and do in fact want free answers then it will probably be in your interest to
    1. Be polite
    2. Answer the questions that have been asked of you.

  • Accessing Java Object with out any application servers

    Hi,
    I would be much thankful if any one guide/suggest me how to
    access an java object with out using any application servers.I am
    having an java object which holds dummy data and an mxml file which
    contains some text fields. My plan was to access the java object
    and put the dummy data in the text fields. I am using RemoteObject
    for this. I am not able to proceed further. Please help me.
    Thanks in advance
    Regards
    Karun Kumar

    You can check The Merapi Project it's still in the
    development phase but it'll allow to an AIR app invoke a java class
    and run it as it were inside your app. But that's something you
    can't take into production yet, why don't u wanna use a server
    backend?

  • Java object with ArrayList of custom objects not working

    I have a custom java object that has an ArrayList of another set of custom objects (code listed below). I can pull back a Customer object (to flex client) and it's recognized as a Customer action script object, but the ArrayList in the Customer object is not recognized as an ArrayCollection of Accounts. Instead it is an ArrayCollection of Action Script Objects.
    At first I thought something was wrong with my action script Account class, but then I tried to pull back just an Account and it was recognized as an action script Account. It's just when I have my Customer object with an ArrayList of Accounts that it isn't getting converted.
    Is there something else I need to do to have that ArrayList be recognized as an ArrayCollection of Accounts on the Flex Client side? Is there some way of specifying what type an ArrayCollection is mapped to?
    Thanks in advance for the help!
    public class Customer {
         private String name;
         private String address;
         private ArrayList<Account> accounts;
         public Customer(){
         public String getName(){
              return name;
         public void setName(String str){
              name = str;
         public String getAddress(){
              return address;
         public void setAddress(String str){
              address = str;
         public ArrayList<Account> getAccounts(){
              return accounts;
         public void setAccounts(ArrayList<Account> list){
              accounts = list;
    public class Account {
         private long accountNumber;
         private String type;
         private double balance;
         public Account(){
         public long getName(){
              return accountNumber;
         public void setName(long l){
              accountNumber= l;

    I accidently found how to make this work. I may have missed something while reading about blazeDS reflection, but I thought I'd pass this along anyway.
    What I have is I have an class A. In class A I have an arraycollection of Class B. If I want that arraycollection to return to the server with the correct class, then I need to include Class B in the compiled swf. How I have done that is to create a dummy variable of type B. Importing B will not work you actually need to have a member variable of type B even if you don't need it.
    Example
    import dataobjects.B;
    [RemoteClass(alias="dataobjects.A")]
    public class A {
       private var _b:B; //This is never used, but needed to include B object in swf to be reflected.
       private var_ bList:ArrayCollection = new ArrayCollection();
      public function A(){
      public function set bList(list:ArrayCollection):void{
         _bList = list;
      public function get bList():ArrayCollection{
        return _bList;

  • View object with bind variables in subqueries

    Hi,
    i create view object with this query:
    Select /*+ use_nl(p p2) */
    'F' tipo_persona,
    p.ID_PERSONA, p.TDOC, p.NDOC, p.DENO
    From SINT_PERSONA p,
    ( Select /*+ index(a SINT_PERSONA_IX2) */
    a.ID_PERSONA
    From SINT_PERSONA_DOCUMENTO a
    where ( NDOC = :p_cuit
    and :p_cuit is not null )
    ) p2
    Where p.id_persona = p2.id_persona
    AND (deno = upper(:p_deno) or
    :p_deno is null)
    AND (NDOC = :p_ndoc or
    :p_ndoc is null)
    and grado_confiab > 0
    My binding style is oracle named.
    Then I add the bind variables:
    p_cuit this is the only required
    p_ndoc
    p_deno
    but when i run the app module with p_cuit = 20123456780 i get this error:
    (oracle.jbo.SQLStmtException) JBO-27122: Error SQL durante la preparación de la sentencia. Sentencia: Select /*+ use_nl(p p2) */
    'F' tipo_persona,
    p.ID_PERSONA, p.TDOC, p.NDOC, p.DENO
    From SINT_PERSONA p,
    ( Select /*+ index(a SINT_PERSONA_IX2) */
    a.ID_PERSONA
    From SINT_PERSONA_DOCUMENTO a
    where ( NDOC = :p_cuit
    and :p_cuit is not null )
    ) p2
    Where p.id_persona = p2.id_persona
    AND (deno = upper(:p_deno) or
    :p_deno is null)
    AND (NDOC = :p_ndoc or
    :p_ndoc is null)
    and grado_confiab > 0
    ----- Nivel 1: Detalle 0 -----
    (java.sql.SQLException) Falta el parámetro IN o OUT en el índice:: 3
    How can i do this ?
    thanks.

    Thanks! that's right the bind variables when i use it on where clause must be required, so i change my sql to:
    Select /*+ use_nl(p p2) */
    'F' tipo_persona,
    p.ID_PERSONA, p.TDOC, p.NDOC, p.DENO
    From SINT_PERSONA p,
    ( Select /*+ index(a SINT_PERSONA_IX2) */
    a.ID_PERSONA
    From SINT_PERSONA_DOCUMENTO a
    where ( NDOC = :p_cuit
    and :p_cuit <> 0 )
    ) p2
    Where p.id_persona = p2.id_persona
    AND (deno = decode(:p_deno,'null',null,upper(:p_deno)) or
    :p_deno = 'null')
    AND (NDOC = decode(:p_ndoc,0,null,:p_ndoc) or
    :p_ndoc = 0)
    and grado_confiab > 0
    and my bind variables:
    p_ndoc required default value 0
    p_cuit required default value 0
    p_deno required default value null
    and works ok!
    thanks a lot !!!!

  • How to create new java objects in native methods?

    Hello,
    Is it possible to create java objects and return the same to the java code from a native method?
    Also is it possible to pass java objects other than String objects (for example, Vector objects) as parameters to native methods and is it possible to return such objects back to the java code?
    If so how can I access those objects (say for example, accessing Vector elements) inside the native code?
    What should I do in order to achieve them?
    Regards,
    Satish

    bschauwe is correct in that constructing Java objects and calling methods on Java objects from native code is tough and takes some study. While you're at it, you might want to check out Jace, http://jace.reyelts.com/jace. It's a free open-source toolkit that really takes the nastiness out of doing this sort of stuff. For example,/**
    * A C++ function that takes a java.util.Vector and plays around with it.
    public void useVector( java::util::Vector& vector ) {
      // Print out all the contents of the vector
      for ( Iterator it = vector.iterator(); it.hasNext(); ) {
        cout << it.next();
      // Add some new elements to the vector
      vector.addElement( "Hello" );
      vector.addElement( "world" );
    } All this code just results in calls to standard JNI functions like FindClass, NewObject, GetMethodID, NewStringUTF, CallObjectMethod, etc...
    God bless,
    -Toby Reyelts

  • Java mail with Dynamic attachment?

    Hi :-)
    How to send the mails with dynamically created attachements..
    The attachments may be a Excel file created dynamically according to the user inputs on the webpage. Is there any way to send those attachments to the receipients with out storing those attachements anywhere(server)?
    Give me some tips to take my next step...
    Thanx in advance
    Krishnakumar S
    (+919847706611)

    You should take a look at Sun's JavaMail site. It has quite a bit of info on JavaMail, located here: http://java.sun.com/products/javamail/.
    See the FAQ here: http://java.sun.com/products/javamail/FAQ.html, it has questions dealing with attachments.
    There is a tutorial here that covers sending and receiving attachments: http://java.sun.com/developer/onlineTraining/JavaMail/index.html. Specific section on attachments is located here: http://java.sun.com/developer/onlineTraining/JavaMail/contents.html#JavaMailAttachments

  • How to create custom BOL object for dynamic query in CRM 7.0

    Hi,
    Could anyone please explain me with steps that how to create the custom BOL object for dynamic query in CRM 7.0, I did it in previous version but its throwing exception when i try to create the object of my dynamic query class. I just defined the entry of my in crmv_obj_btil to create the dynamic query BOL object. do i need to do any other thing also to make it work?
    Regards,
    Kamesh Bathla
    Edited by: Kamesh Bathla on Jul 6, 2009 5:12 PM

    Hi Justin,
    First of thanks for your reply, and coming to my requirement, I need to report the list of items which are there in the dynamic select statement what am getting from the DB. The select statement number of columns may vary in my example for different countries the select item columns count is different. For US its '15', for UK it may be 10 ...like so, and some of the column value might be a combination or calculation part of other table columns (The select query contains more than one table in the from clause).
    In order to execute the dynamic select statement and return the result i choose to write a function which will parse the cursor for dynamic query and then iterate the values and construct a Type Object and append it to the pipe row.
    Am relatively very new for these sort of things, welcome in case of any suggestions to make it simple (Instead of the function what i thought to work with) also a sample narrating the new procedure will be appreciated.
    Thanks in Advance,
    mallikj2.

  • Is it possible to create 2 Date objects with different hashcode.

    Hi,
    I want to create 2 java.util.Date objects with different hashcodes. Is it possible??
    Regards,
    Farooq

    import java.util.Date;
    import java.util.Calendar;
    public class TwoDates {
        public static void main(String[] args) {
            Calendar oneCal = Calendar.getInstance();
            oneCal.set(Calendar.YEAR, 1903);
            Calendar anotherCal = Calendar.getInstance();
            Date oneDate = oneCal.getTime();
            Date anotherDate = anotherCal.getTime();
            System.out.println(oneDate.hashCode() + " " +
                               anotherDate.hashCode());
    -14330615 -825112150

  • Create collection from query with bind variable

    Apex 4.0.2
    Per Joel Re: Collection with bind variable the apex_collection.create_collection_from_query_b supports queries containing bind variable references (:P1_X) but I am not sure how to use this feature, the documentation doesn't have an example, just the API signature for the overloaded version has changed.
    If the query contains 2 bind variable references to session state (:P1_X and :P1_Y), can someone please show an example of what to pass in for the p_names and p_values parameters to the API?
    Thanks
    procedure create_collection_from_query_b(
        -- Create a named collection from the supplied query using bulk operations.  The query will
        -- be parsed as the application owner.  If a collection exists with the same name for the current
        -- user in the same session for the current Flow ID, an application error will be raised.
        -- This procedure uses bulk dynamic SQL to perform the fetch and insert operations into the named
        -- collection.  Two limitations are imposed by this procedure:
        --   1) The MD5 checksum for the member data will not be computed
        --   2) No column value in query p_query can exceed 2,000 bytes
        -- Arguments:
        --     p_collection_name   =  Name of collection.  Maximum length can be
        --                            255 bytes.  Note that collection_names are case-insensitive,
        --                            as the collection name will be converted to upper case
        --     p_query             =  Query to be executed which will populate the members of the
        --                            collection.  If p_query is numeric, it is assumed to be
        --                            a DBMS_SQL cursor.
        -- example(s):
        --     l_query := 'select make, model, caliber from firearms';
        --     apex_collection.create_collection_from_query_b( p_collection_name => 'Firearm', p_query => l_query );
        p_collection_name in varchar2,
        p_query           in varchar2,
        p_names           in wwv_flow_global.vc_arr2,
        p_values          in wwv_flow_global.vc_arr2,
        p_max_row_count   in number default null)
        ;

    VANJ wrote:
    Apex 4.0.2
    Per Joel Re: Collection with bind variable the apex_collection.create_collection_from_query_b supports queries containing bind variable references (:P1_X) but I am not sure how to use this feature, the documentation doesn't have an example, just the API signature for the overloaded version has changed.
    If the query contains 2 bind variable references to session state (:P1_X and :P1_Y), can someone please show an example of what to pass in for the p_names and p_values parameters to the API?Not tried it, but guessing something like
    apex_collection.create_collection_from_query_b(
        p_collection_name => 'foobar'
      , p_query => 'select f.foo_id, b.bar_id, b.baz from foo f, bar b where f.foo_id = b.foo_id and f.x = to_number(:p1_x) and b.y = :p1_y'
      , p_names => apex_util.string_to_table('p1_x:p1_y')
      , p_values => apex_util.string_to_table(v('p1_x') || ':' || v('p1_y')))

  • Creating a COM object with CF9 32-bit on Windows Server 2008 R2 64-bit machine

    I'm using a 32-bit version of CF9 and it's installed on a Windows Server 2008 R2 machine (64-bit).  The problem I'm running into is that it won't allow me to create a COM object - it gives me the error, "no ntvinv in java.library.path null" when I try to run,
    <cftry>
    <cfobject type="COM" action="CONNECT" name="Engine" class="JRO.JetEngine">
    <cfcatch type="Any">
        <cfobject type="COM" action="CREATE" name="Engine" class="JRO.JetEngine">
    </cfcatch>
    </cftry>
    Then when I run it a 2nd time, I get "An exception occurred when instantiating a COM object. The cause of this exception was that: java.lang.RuntimeException: Can not use native code: Initialisation failed."
    Can you help me?

    Replying for your patchset installation pre-req error:
    Use below command:
    ./runInstaller -ignoreSysPrereqs
    Review MOS note 763143.1 for more info.

Maybe you are looking for

  • How to creat web service for a function module?

    who can provide me some resource on the topic. thanks Johnney.

  • HELP - Erasing a USB Disk

    I have a USB 64GB Flash Drive I bought off eBay. When I run terminal with diskutil info disk2    Device Identifier:        disk2    Device Node:              /dev/disk2    Part of Whole:            disk2    Device / Media Name:      Generic Flash Dis

  • How to deal with recieved IDoc's ?

    Hello, I have the following scenario here within a workshop: We have a SAP R/3 IDES System sending IDoc for Materials and Debitors to a 3rd party system (e.g. if material is updated on r3-side). This so far works fine and the 3rd party system also re

  • Is database using File system, RAW devices or ASM?

    Hi there Is is possible to find out if the database is using File system, RAW devices or ASM for storage? I think for ASM, we can tell by querying the V$DATAFILE view if it has ' DATA ' or something like that (a name that has ' ' prefixed to it). Is

  • Back to Mac not working

    Me: Macbook Pro 10.5.4 and time machine Mom: iMac 10.5.4 with new airport express Situation: Had Back to Mac up and running fine so I could take care of her machine. Then lightning strikes and nukes my mom's DSL box and ethernet card in her imac. She