Dynamic populating object variable

Hi Experts!
I have object type:create or replace type r_attribs_t is table of varchar2(100);
create or replace type r_relations_t is table of varchar2(40);
create or replace type r_spatial_t is table of varchar2(100);
type recfull_ot is object (
    r_type    char(2),
    r_class   varchar2(10),
    r_atype   varchar2(10),
    r_id      varchar2(30),
    r_idr     varchar2(100),
    r_status  char(2),
    r_dtu     date,
    r_dtw     date,
    attribs       r_attribs_t,
    relations     r_relations_t,
    spatial_data  r_spatial_t,
    map member function newer return date,
    member function get_ID return varchar2,
    member procedure load_record (p_type varchar2, p_id varchar2, p_idr varchar2)
);and some tables:CREATE TABLE "G5ADR" (
    "ID"     VARCHAR2(30 BYTE) NOT NULL ENABLE,
    "STATUS" NUMBER(2,0) DEFAULT 1 NOT NULL ENABLE,
    "G5TAR"  NUMBER(1,0),
    "G5NAZ"  VARCHAR2(200 BYTE),
    "G5KRJ"  VARCHAR2(200 BYTE),
    "G5WJD"  VARCHAR2(200 BYTE),
    "G5PWJ"  VARCHAR2(200 BYTE),
    "G5GMN"  VARCHAR2(200 BYTE),
    "G5ULC"  VARCHAR2(200 BYTE),
    "G5NRA"  VARCHAR2(200 BYTE),
    "G5NRL"  VARCHAR2(200 BYTE),
    "G5MSC"  VARCHAR2(200 BYTE),
    "G5KOD"  VARCHAR2(200 BYTE),
    "G5PCZ"  VARCHAR2(200 BYTE),
    "G5DTW" DATE,
    "G5DTU" DATE,
    "IDR" VARCHAR2(100 BYTE),
    CONSTRAINT "G5ADR_PK" PRIMARY KEY ("ID")
CREATE TABLE "G5DOK" (
    "ID"     VARCHAR2(30 BYTE) NOT NULL ENABLE,
    "STATUS" NUMBER(2,0) DEFAULT 1 NOT NULL ENABLE,
    "G5IDM"  VARCHAR2(200 BYTE),
    "G5KDK"  NUMBER(2,0),
    "G5DTD" DATE,
    "G5DTP" DATE,
    "G5SYG" VARCHAR2(200 BYTE),
    "G5NSR" VARCHAR2(200 BYTE),
    "G5OPD" VARCHAR2(200 BYTE),
    "G5DTW" DATE,
    "G5DTU" DATE,
    "IDR" VARCHAR2(100 BYTE),
    CONSTRAINT "G5DOK_PK" PRIMARY KEY ("ID")
-- ... and others ...I need to write member procedure load_record loading data from one of that tables into the object variable. The table to load data from depends on p_type input parameter, howerer. This makes the problem difficult for me, because I realy don't know how to deal with that. The attribs nested table shoud be populated with all the G5% columns from the table.
Any suggestions?
Help, please...
Edited by: JackK on Nov 18, 2010 9:48 AM

OK, I've been experimenting on an alternative for DBMS_SQL...
Here's a simplified test case based on the structures you gave.
It should work on release 10.2 and upwards (I've only tested it on 11.2 though).
create or replace type r_attribs_obj is object(col varchar2(30), val varchar2(100));
create or replace type r_attribs_tab is table of r_attribs_obj;
CREATE OR REPLACE TYPE recfull_ot IS OBJECT (
r_id      varchar2(30),
r_idr     varchar2(100),
attribs   r_attribs_tab,
member procedure load_record (self in out recfull_ot, p_type varchar2, p_id varchar2, p_idr varchar2)
CREATE OR REPLACE TYPE BODY recfull_ot IS
MEMBER PROCEDURE load_record (self in out recfull_ot, p_type varchar2, p_id varchar2, p_idr varchar2)
IS
ctx dbms_xmlgen.ctxHandle;
res xmltype;
attribs_tab r_attribs_tab;
BEGIN
ctx := dbms_xmlgen.newContext('SELECT * FROM '||p_type||' WHERE id = :1 AND idr = :2');
dbms_xmlgen.setBindValue(ctx,'1',p_id);
dbms_xmlgen.setBindValue(ctx,'2',p_idr);
res := dbms_xmlgen.getXMLType(ctx);
dbms_xmlgen.closeContext(ctx);
self.r_id := p_id;
self.r_idr := p_idr;
SELECT cast(
   multiset(
     select col, val
     from xmltable(
      'for $i in /ROWSET/ROW/*
       where fn:starts-with(local-name($i),"G5")
       return element r
        attribute col {local-name($i)},
        $i/text()
      passing res
      columns col varchar2(30) path '@col',
              val varchar2(100) path '.'
  as r_attribs_tab
) INTO self.attribs
FROM dual
END;
END;
CREATE TABLE "G5ADR" (
  "ID"     VARCHAR2(30 BYTE) NOT NULL ENABLE,
  "G5NAZ"  VARCHAR2(200 BYTE),
  "G5KRJ"  VARCHAR2(200 BYTE),
  "G5WJD"  VARCHAR2(200 BYTE),
  "IDR" VARCHAR2(100 BYTE),
  CONSTRAINT "G5ADR_PK" PRIMARY KEY ("ID")
insert into g5adr (ID, G5NAZ, G5KRJ, G5WJD, IDR) values ('001', 'NAZ001', 'KRJ001', 'WJD001', '1');
insert into g5adr (ID, G5NAZ, G5KRJ, G5WJD, IDR) values ('002', 'NAZ002', 'KRJ002', 'WJD002', '1');
insert into g5adr (ID, G5NAZ, G5KRJ, G5WJD, IDR) values ('003', 'NAZ003', 'KRJ003', 'WJD003', '1');Verifying the nested table is correctly loaded...
SQL> set serveroutput on
SQL> DECLARE
  2   obj recfull_ot := recfull_ot(null, null, null);
  3  BEGIN
  4   obj.load_record('G5ADR', '001', 1);
  5   for i in 1..obj.attribs.count loop
  6    dbms_output.put_line(obj.attribs(i).col||' = '||obj.attribs(i).val);
  7   end loop;
  8  END;
  9  /
G5NAZ = NAZ001
G5KRJ = KRJ001
G5WJD = WJD001
PL/SQL procedure successfully completed

Similar Messages

  • Dynamically population of variables with use of variants in I Broadcasting

    Hi all,
    In broadcasting I have to include few reports.
    Suppose one report is having variable screen where 5 mandatory variable are there. Here one variable is 0calday suppose which has to be filled dynamically.
    Is it possible by using variant.
    If yes please send step by step process and if not what could be the other method?
    Am using BW 3.5.
    Thanks,
    Uday.

    Hi Uday,
    To achieve this,you can create one more variant with the specific variable values (which ever you want) and pass it during broadcasting.
    The step by step process for Broadcasting with variant is...
    With 7.x Tools:
    1.Open a report(workbook) in a tool(Eg:BEx Analyzer) and invoke Broadcaster(Tools->BEx Broadcaster...)
    2.Click "Create New Setting"
    3.Distribution Type "Broadacast to Email" and Output Format as "MS Excel Workbook" (This depends on your own need)
    4.Update the "Recipient" and "Text" tab details
    5.Click "Workbook Precalculation" tab and Select the variant for the Variable Assignment
    6.Select the Precalculcation Server
    7.Save the Setting and Click "Execute"
    This will send a report mail to the mentioned receipient based on the selected variant through Precalculation Server
    Rgds,
    Murali

  • Dynamic view object loses bind variables after passivation

    I am creating a view object definition/view object programmatically in Jdev 11.1.1.2.0. The query requires a named bind parameter. All was working fine but now I am testing with app module pooling disabled and the bind variable is not being restored after passivation -- it's like the definition has disappeared or something.
    Here is my VO creation code:
    ViewObject vo = findViewObject("FinalistsWithEvalDataVO");
    if (vo != null){
    vo.remove();
    ViewDefImpl voDef = new ViewDefImpl("FinalistsWithEvalDataVODef");
         // I add a bunch of viewAttrs here...
    voDef.setQuery(fullQuery);
    voDef.setFullSql(true);
    voDef.setBindingStyle(SQLBuilder.BINDING_STYLE_ORACLE_NAME);
    voDef.resolveDefObject();
    voDef.registerDefObject();
    vo = createViewObject("FinalistsWithEvalDataVO", voDef);
    vo.defineNamedWhereClauseParam("Bind_SchlrAyId", null, new int[] {0});
    vo.setNamedWhereClauseParam("Bind_SchlrAyId", new Number(1)); //For testing
    vo.executeQuery();
    The query executes fine right there and then the VO seems to passivate fine. I even see the bind var in passivation:
    <exArgs count="1">
    <arg name="Bind_SchlrAyId" type="oracle.jbo.domain.Number">
    <![CDATA[1]]>
    </arg>
    </exArgs>
    But then when it reactivates prior to rendering the page, it invariably throws a missing parameter exception and this in the log:
    <ViewUsageHelper><createViewAttributeDefImpls> [7409] *** createViewAttributeDefImpls: oracle.jdbc.driver.OraclePreparedStatementWrapper@1af78e1
    <ViewUsageHelper><createViewAttributeDefImpls> [7410] Bind params for ViewObject: [FinalistsWithEvalDataVO]AwardViewingServiceAM.FinalistsWithEvalDataVO
    <ViewUsageHelper><createViewAttributeDefImpls> [7411] ViewUsageHelper.createViewAttributeDefImpls failed...
    <ViewUsageHelper><createViewAttributeDefImpls> [7412] java.sql.SQLException: Missing IN or OUT parameter at index:: 1
    I have worked on this for hours and can't see anything wrong. Like I said, it works fine when not forcing passivation...
    Any help would be appreciated.
    Thanks.
    -Ed

    @Jobinesh - Thanks for the suggestions. I have read all the documentation I can find. Everything works fine without passivation. Everything still breaks with passivation. I have given up on trying to get the bind variable to restore after passivation and am currently just building the query with all values embedded in the query rather than bind variables. This is bad practice but avoids the problem. However, now that I avoided that obstacle, I'm on to the next issue with passivation of this dynamic view object, which is that the current row primary key apparently cannot be reset after activation. I get the following error:
    <Key><parseBytes> [7244] Key(String, AttributeDef[]): Invalid Key String found. AttributeCount:1 does not match Key attributes
    <DCBindingContainer><reportException> [7254] oracle.jbo.InvalidParamException: JBO-25006: Value 00010000000A30303033383133343734 passed as parameter String to method Constructor:Key is invalid: {3}.
         at oracle.jbo.Key.parseBytes(Key.java:537)
         at oracle.jbo.Key.<init>(Key.java:179)
         at oracle.jbo.server.IteratorStateHolder.getCurrentRowKey(IteratorStateHolder.java:34)
         at oracle.jbo.server.ViewRowSetIteratorImpl.activateIteratorState(ViewRowSetIteratorImpl.java:3877)
    I've been trying various workarounds for over a day now with no luck. Very frustrating.
    Thanks for trying to help.
    -Ed

  • Get bind variables of a dynamic view object

    I seem unable to retrieve the bind variables for a dynamically created view object, even though I can do the same thing for a regular view object.
    Here is the code:
    newVO = repServ.createViewObjectFromQueryStmt("newQry",strSql);
    VariableValueManager vvm = newVO.ensureVariableManager();
    if (vvm != null)
    Variable vars[] = vvm.getVariables();
    vars will be empty, even though the sql statement in strSql has bind variables in it.
    Is there any way to determine the bind variables of a dynamic view object?
    Thanks!

    I got the same problem as yours and still could not find any way out.
    However, as I can see, you wanted to get VariableValueManager of newly created ViewObject that may be not available at this moment.
    If you find way to solve the problem, please help.
    Cheer,
    MinhTran

  • Creating and Accessing a Dynamic View Object

    Hi,
    I'm needing to create a Dynamic View Object so to have the ability to modify the FROM and WHERE clauses in an SQL statement.
    I then need to view all the columns and rows in an adf table or something similar.
    I've read up a fair bit on similar situations, however I'm struggling with the basic framework of building the View Object.
    I know I'm wanting to use ..createViewObjectFromQueryStmt..but just unsure of the syntax in using it, especially connecting the VO to an Application Module.
    This is similar to what I've got now, located in AppModuleImpl.java
        public void createDynVO(ApplicationModule appMod, String FROMclause, String WHEREclause){
        String SQL = "SELECT JOURNAL_NAME, PERIOD_NAME FROM " + FROMclause + " " + WHEREclause;
        ViewObject vo = appMod.createViewObjectFromQueryStmt("DynamicView", SQL);
        vo.executeQuery();But how does it know what the application module is?
    Any help would be greatly appreciated!
    -Chris

    Ok, I've actually modified my approach to this.
    I've created a View Object in the design view, added it to the App Module, and then created an iterator and bound an adf table to that iterator.
    The View Object which I created has the same column names as what I am going to be getting later down the track.
    Everything is working perfectly, except that I can't seem to bind variables to the WHERE clause.
    Below is what I have got running:
        public void recreateDynView(String FromClause, String whereCompany, String whereDepartment) {
             String sql_PAGE_ITEM1 = " AND PAGE_ITEM1 LIKE :P_PAGE_ITEM1";
             String sql_PAGE_ITEM2 = " AND PAGE_ITEM2 LIKE :P_PAGE_ITEM2";
             findViewObject("DynamicView1").remove();
             String SQLStmt = "SELECT PAGE_ITEM1, PAGE_ITEM2, PAGE_ITEM3, LINE_ITEM FROM " + FromClause;
             ViewObject vo = createViewObjectFromQueryStmt("DynamicView1",SQLStmt);
             vo.setWhereClause("1=1");
               if (whereCompany != null && whereCompany.length()>0){
                   vo.setWhereClause(vo.getWhereClause() + sql_PAGE_ITEM1);
                   vo.defineNamedWhereClauseParam("P_PAGE_ITEM1",null,null);
                   vo.setNamedWhereClauseParam("P_PAGE_ITEM1",whereCompany);
               if (whereDepartment != null && whereDepartment.length()>0){
                   vo.setWhereClause(vo.getWhereClause() + sql_PAGE_ITEM2);
                   vo.defineNamedWhereClauseParam("P_PAGE_ITEM2",null,null);
                   vo.setNamedWhereClauseParam("P_PAGE_ITEM2",whereDepartment);
             vo.executeQuery();
           }However whenever I input a value into one of the bound variables, I get the following error on the page.
       1. JBO-29000: Unexpected exception caught: oracle.jbo.InvalidOperException, msg=JBO-25070: Where-clause param variable P_PAGE_ITEM1 needs ordinal index array.
       2. JBO-25070: Where-clause param variable P_PAGE_ITEM1 needs ordinal index array.In the view object which i created at design stage, I've set the binding style to Oracle Named, so it should be alright. But obviously since I'm removing the view object and creating another version of it, it doesn't have the same binding style attached by default?
    Is there a work around for this? I'm so close!
    -Chris

  • Dynamically instantiating objects using string name

    Hello to all.
    This is probably an easy question, but I am wondering how I can dynamically create instances of an object in a loop using a string variable as the name.
    The idea here is this:
                   while (someBooleanVariable) {
                        int count = 1;
    String objectName = "myObject" + count;
                        myObject objectName = new myObject; // How do I pass the objectName String variable as a name?
                        count++;
                   } // End while
    Of course this doesn't work - incompatible types, but the idea is that the code would create "myObject1," "myObject2," "myObject3," "myObject4," etc as long as someBooleanVariable = true using the objectName String variable.
    I am new to this and appreciate any help and ideas.
    Thanks!

    BigDaddyLoveHandles wrote:
    There's been this outbreak of people wanting to dynamically name their variables -- is this some sort of scripting disease?It's always been around. Shoot, I remember suffering from it when I first started out, because it seems so, hm I dunno, necessary at the time. Eventually the newbie (me) realizes that the variable "name" means nothing, that reference is everything.
    ... and then I discovered maps, and names were useful again. :o)

  • Object variable or with block variable not set- while trying to submit data

    Hi Gurus,
    Could you share me the solution to resolve the issue?
    I am getting an error "object variable or with block variable not set" while trying to submit data through an Input schedule.
    I am working on SAP BPC 7.5 NW and using MS Excel 2007.
    I can log in to BPC Admin and excel with my user id and password.
    I checked my security profile and i have the submit data task in my task profile. My all other Input Schedules are working very well. Only one of the IS is causing this problem. The same input Schedule when saved as Dynamic Template it works well and data is sent successfully.
    Regards,
    KumarMG

    Hi Kumar,
    This might be incase you have some special character like & in the input schedule template. you need to remove the special character in that case.
    Hope this resolves your issue.
    Rgds,
    Poonam

  • How do I make a data connection object variable?

    This should be easy but I can' t sort it out.
    I created a database connection and cloned it so I could avoid security issues.
    The cloned connection works fine and I can query for specific records and the bound fields are populated. The problem comes when I try to advance to the next record with "clonedDB.next()" for example. The error that says "clonedDB is not defined". This code is all in Java by the way.
    So I though maybe I need to create an object variable to contain the clonedDB object; this is what I can't figure out how to do or if will solve my problem.
    Thanks in advance!
    Cheers,
    Al

    Can you send me your form so I can have a look?
    If the attachment ability is not available for you can you email it to [email protected]
    Thanks
    Paul

  • Dynamic value objects in flex and coldfusion 9

    I'm writing a program for a company that does registrations for conventions and trade-shows.  The problem I'm having is that each different client wants to store different data for each show.  Most of the data is the same (attendee's name, address, etc...), but each show has some customizations that it wants to have...  So each database for each show is going to be different...
    Right now, the only way I know how to transfer data from Flex to ColdFusion is via a Value Object.  (Well, the only good way to do it, that is.)  My problem comes when a client wants a particular database customized.  I have MANY questions about this...
    1) How do I tell my Value Object what fields we've added to or changed in the database without re-writing the entire VO (in both the .AS and .CFC files) and re-compiling my program?  In other words, I need a dynamic VO that changes automatcially with the database.
    2) If there is a way to dynamically create a VO in Flex (and from a few blog posts I've seen, it seems there is a way), how do I tell CF9 what the structure of that dynamically-created VO is?  Without re-writing a bunch of .CFC files every time I add or change a field in the database, that is...
    3) How do I reference the dynamically-created fields in my Flex program?  Right now, for example, I can define a variable called attendeeInfo as type attendeeInfoVO, and then reference things like attendeeInfo.first_name, attendeeInfo.last_name, etc...  How do I reference a field programmatcially when I don't know what it's going to be called beforehand?
    4) How do I make my program display/modify those dynamically-created fields?  Right now, using the attendeeInfo example above, I can create a TextInput with an id="firstNameInput" and just say firstNameInput.text = "{attendeeInfo.first_name}".  That won't work when I have no clue how many dynamically-created fields there are, or even what kind of data they're going to store...  How do I deal with this?
    5) Is there something other than VOs that would fit this situation better?  Am I limiting myself by using VOs in the first place?  Is it just plain impossible to do this with VOs?  And if so, what are my alternatives?  I need a structured object that can be passed around with a single reference -- I absolutely DO NOT want to pass a bunch of references to a bunch of different variables -- that's why I used VOs from the very beginning.
    6) Can I simply PAY someone at Adobe for one-on-one help here?  Do they have experts that you can "buy" for a few hours?  What's the charge for that, if such a thing is available?  Or, is this problem well-explained somewhere on the Web, and I just haven't found it yet?
    I'm very confused here, and it seems like I might have to re-write a ton of code, which I'm not looking forward to...  Ugh...  I appreciate any help you can give me...
    Thanks,
    Laurence MacNeill
    Mableton, Georgia, USA

    This blog post is pretty close to what I want:
    http://justinjmoses.wordpress.com/2008/10/10/flex-dynamic-bindable-value-objects/
    So there are the dynamic value objects I was looking for.  But the blog-poster is using LINQ and .Net 3.5.  I'm using ColdFusion9.
    So, how do I get ColdFusion9 to deal with that?  How do you get CF9 to recognize the fact that you've changed the VO, and deal with it appropriately?
    Thanks,
    L.

  • Dynamically populated parameter clears previously entered parameters

    Software: Crystal Reports XI with MS SQL Server 2008
    I've created a report that asks for three parameters, 2 dates, and a string which is dynamically populated. The report has two tables added in the database expert.
    The first table is a command object which passes the two date parameters to a stored procedure:
    exec sp_MyStoredProcedure {?startdate},{?enddate}
    The second table is a stored procedure object used to populate the string parameter {?_users}. The criteria for the string parameter are:
    Prompt with Description only: False
    Allow multiple values: True
    Allow discrete values: True
    Allow range values: False
    This stored procedure object requires no parameters, and was originally a view in the database, but it the same problem occurs whether i dynamically populate the string parameter options from either a view or a stored procedure. I'd like to go back to using a view, as i do not need to pass any kind of parameters to the stored procedure
    The string parameter is used for defining the record selection formula:
    IF {Command.user_name} in {?_users} THEN true ELSE false.
    The two tables are not linked in the database expert, but linking them does not seem to solve the problem I am having with this report, the problem being this:
    No matter which order I set the  parameters, it always first displays a form showing only the prompts for the date values. After entering these, it then shows a form prompting for the date values again (the previously selected date information now cleared), along with the list of users from which to select. On this 2nd form, the parameters are displayed in the order I set using the field explorer option presented when I right click on the Paramter Fields heading. After entering the date parameter values a 2nd time, and selecting the users from the  dynamically generated list, the report performs as intended.
    Edited by: Duraplex on Nov 12, 2010 6:26 PM
    Edited by: Duraplex on Nov 12, 2010 6:57 PM - After contacting the tech dept of my employer, they are applying a service pack update to my installation, I am hoping this resolves the issue. Will post an update as soon as I know more.
    Edited by: Duraplex on Nov 12, 2010 7:35 PM - After applying SP4 to my installation, the problem persists. I did note however that removing the string parameter and record selection formula, and then recreating them, does somewhat solve the issue temporarily - i still am presented with two forms, but the second form doesn't clear the previously entered date parameters. However,  once i save the report, and reload it, the problem manifests again and the date parameters are cleared when presented on the 2nd form. Has anyone else encountered a similar problem?
    Edited by: Duraplex on Nov 15, 2010 8:38 PM - Problem resolved by upgrading from Release 1 to Release 2.

    Hi,
    Once record status gets change for block you can not populate/repopulate the list item. Keep those list items as non-database item with different names and create different items as database orignal items. Than assign the values in WHEN-LIST-CHANGE trigger to the actual database items.
    -Ammad

  • Dynamic declaration for variable.

    Can we declare a variable dynamic with varing data type.
    My req is i have to define a variable to store output from a dynamic select statement. Now since SELECT is dynamic, its output type changes each time and for the same I need a variable defined dynamically.
    Regards,
    Arpit

    Hi Arpit Gattani,
        To store output of an dynamic Select statement you can use dynamic data objects and field symbols.
        To create a data object dynamically during a program, you need a data reference variable and the following statement:
    CREATE DATA <dref> TYPE <type>|LIKE <obj>.
    This statement creates a data object in the internal session of the current ABAP program. After the statement, the data reference in the data reference variable <dref> points to the object. The data object that you create does not have its own name. You can only address it using a data reference variable. To access the contents of the data object, you must dereference the data reference.
    You must specify the data type of the object using the TYPE or LIKE addition. In the TYPE addition, you can specify the data type dynamically as the contents of a field (this is not possible with other uses of TYPE).
    CREATE DATA <dref> TYPE (<name>).
    Here, <name> is the name of a field that contains the name of the required data type.
    <b>Example:</b>
    A specific field is read from database table X031L. Neither the field name nor the table name is known until runtime:
    Read a field from the table X031L
    PARAMETERS:
      TAB_NAME    LIKE SY-TNAME,           "Table name
      TAB_COMP    LIKE X031L-FIELDNAME,   "Field name
      ANZAHL      TYPE I DEFAULT 10.       Number of lines
    FIELD-SYMBOLS: <WA>   TYPE ANY,
                   <COMP> TYPE ANY.
      DATA: WA_REF TYPE REF TO DATA.
      CREATE DATA WA_REF TYPE (TAB_NAME). "Suitable work area
      ASSIGN WA_REF->* TO <WA>.
    SELECT * FROM (TAB_NAME) INTO <WA>
      UP TO anzahl ROWS.
      WRITE: / TAB_COMP, <COMP>.
      ENDSELECT.
    Dont Forget to give points if it helps ;>)
    Regards
    Rakesh.

  • Date parameter values cleared when dynamically populating string parameter

    Software: Crystal Reports XI Release 1 with SP4, with MS SQL Server 2008
    I've created a report that asks for three parameters, 2 dates, and a string which is dynamically populated. The report has two tables added in the database expert.
    The first table in the database expert is a command object which passes the two date parameters to a stored procedure:
    exec sp_MyStoredProcedure {?startdate},{?enddate}
    The second table in the database expert is a stored procedure object used to populate the string parameter {?_users}. The criteria for the string parameter are:
    Prompt with Description only: False
    Allow multiple values: True
    Allow discrete values: True
    Allow range values: False
    This stored procedure object requires nothing to be passed, it was originally a view in the database, but the same problem occurs whether i dynamically populate the string parameter options from either a view or a stored procedure.
    The string parameter is used for defining the record selection formula:
    IF {Command.user_name} in {?_users} THEN true ELSE false.
    The two table objects are not linked in the database expert, but linking them does not seem to solve the problem I am having with this report, the problem being this:
    No matter which order I set the parameters, it always first displays a form showing only the prompts for the date values. After entering these, it then shows a form prompting for the date values again (the previously selected date information now cleared), along with the list of users from which to select. On this 2nd form, the parameters are displayed in the order I set using the field explorer option presented when I right click on the Paramter Fields heading. After entering the date parameter values a 2nd time, and selecting the users from the dynamically generated list, the report performs as intended. After subsequently running the report  (prompting for new parameter values by pressing F5),  it does not clear the date parameters on the 2nd form's appearance.
    What I need is to be able to enter in these values the first time around, without having the date parameters cleared. Am i going about this incorrectly, or is this a bug?

    What you are experiencing is not a bug... Passing a multi-valued parameter to a Command or SP is not supported in any version of CR prior to CR 2008.
    Your options are #1) Upgrade to CR 2008 or #2) Jump through the necessary hoops to make it work in CR XI
    Check out this link...[SQL Command Parameter - Multiple Value|Re: SQL Command Parameter - Multiple Value]
    It has some good examples a good step by step.
    HTH,
    Jason

  • Dynamic Shared Object - Is This Possible?

    What I want in my app is to have 2 tilelists and an array collection of items which will populate the first tilelist and these objects can be dragged between both tilelists. Then the user can click a save button which will save the statuses of both tilelists so the items that are present/not present in each tilelist when the app is closed will still be there when the app is restarted.
    The problem is I want my array collection to be populated dynamically from mysql data on a server.
    I have no problem getting dynamic data from a mysql database into an array colllection via http request and I have no problem getting the shared object to work IF the array collection is defined within the app the usual way but I'm having trouble getting these 2 things to work together. 
    Can anybody tell me if it is indeed possible to have a dynamically populated array collection stored as a shared object on the user's system and would anyone be willing to help me out if I post my code so far? Cheers.

    Hi Greg. The way I usually post code is by clicking the small arrows above and then clicking syntax highlighting and then xml. The problem is this seems to remove all of the quotation marks ("") from my code which is what is causing the errors you mentioned. I've posted it below just by simply copying and pasting. I hope that works better. Cheers for your help:-
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication 
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="newsService.send(); initprofile1NewsAndSportSO()">
    <mx:Script><![CDATA[
     import mx.rpc.events.ResultEvent; 
    import mx.collections.*; 
    import flash.net.SharedObject; 
    public var profile1NewsAndSportSO:SharedObject; 
    Bindable] 
    private var profile1NewsAndSportaddLinksFullAC:ArrayCollection; 
    Bindable] 
    private var profile1NewsAndSportaddLinksAC:ArrayCollection; 
    private function newsResultHandler(event:ResultEvent):void{
    profile1NewsAndSportaddLinksFullAC=newsService.lastResult.newscategory.news
    as ArrayCollection;profile1NewsAndSportaddLinksAC=newsService.lastResult.newscategory.news
    as ArrayCollection;}
    // private var profile1NewsAndSportaddLinksFullAC:ArrayCollection = new ArrayCollection([
    // {label:"BBC News"},
    // {label:"ITV"},
    // {label:"Sky News"}
    // ]); // private var profile1NewsAndSportaddLinksAC:ArrayCollection = new ArrayCollection([
    // {label:"BBC News"},
    // {label:"ITV"},
    // {label:"Sky News"}
     private function profile1NewsAndSportReset():void{resetprofile1NewsAndSportAC();
    profile1NewsAndSportAddLinksTilelist.dataProvider = profile1NewsAndSportaddLinksAC;
    profile1NewsAndSportLinkChoice.dataProvider =
    new ArrayCollection([]);}
    private function resetprofile1NewsAndSportAC():void{profile1NewsAndSportaddLinksAC.removeAll();
    for each(var obj:Object in profile1NewsAndSportaddLinksFullAC){profile1NewsAndSportaddLinksAC.addItem(obj);
    private function initprofile1NewsAndSportSO():void{profile1NewsAndSportSO = SharedObject.getLocal(
    "profile1NewsAndSport"); 
    if(profile1NewsAndSportSO.size > 0){ 
    if(profile1NewsAndSportSO.data.profile1NewsAndSportaddList){ 
    if(profile1NewsAndSportSO.data.profile1NewsAndSportaddList != "empty"){ 
    var profile1NewsAndSportaddList:Array = profile1NewsAndSportSO.data.profile1NewsAndSportaddList.split(","); 
    var profile1NewsAndSporttempAC1:ArrayCollection = new ArrayCollection(); 
    for each(var str:String in profile1NewsAndSportaddList){ 
    for each(var obj1:Object in profile1NewsAndSportaddLinksAC){ 
    if(str == obj1.label){profile1NewsAndSporttempAC1.addItem(obj1);
    continue;}
    if(profile1NewsAndSporttempAC1.length > 0){profile1NewsAndSportAddLinksTilelist.dataProvider = profile1NewsAndSporttempAC1;
    if(profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList){ 
    var profile1NewsAndSportchoiceList:Array = profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList.split(","); 
    var profile1NewsAndSporttempAC2:ArrayCollection = new ArrayCollection(); 
    for each(var str2:String in profile1NewsAndSportchoiceList){ 
    for each(var obj2:Object in profile1NewsAndSportaddLinksAC){ 
    if(str2 == obj2.label){profile1NewsAndSporttempAC2.addItem(obj2);
    continue;}
    if(profile1NewsAndSporttempAC2.length > 0){profile1NewsAndSportLinkChoice.dataProvider = profile1NewsAndSporttempAC2;
    else{profile1NewsAndSportReset();
    private function saveprofile1NewsAndSport(event:MouseEvent):void{ 
    var profile1NewsAndSportaddList:String = ""; 
    if(profile1NewsAndSportAddLinksTilelist.dataProvider){ 
    if(ArrayCollection(profile1NewsAndSportAddLinksTilelist.dataProvider).length > 0){ 
    for each(var obj1:Object inprofile1NewsAndSportAddLinksTilelist.dataProvider){
    profile1NewsAndSportaddList += obj1.label +
    else{profile1NewsAndSportaddList =
    "empty";}
    profile1NewsAndSportSO.data.profile1NewsAndSportaddList = profile1NewsAndSportaddList;
    var profile1NewsAndSportchoiceList:String = ""; 
    for each(var obj2:Object inprofile1NewsAndSportLinkChoice.dataProvider){
    profile1NewsAndSportchoiceList += obj2.label +
    profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList = profile1NewsAndSportchoiceList;
    profile1NewsAndSportSO.flush();
    ]]>
    </mx:Script>
     <mx:HTTPService id="newsService" resultFormat="object" result="newsResultHandler(event)" url="http://www.coolvisiontest.com/getnews.php"/> 
    <mx:TileList id="profile1NewsAndSportLinkChoice" fontWeight="bold" dragEnabled="true" dragMoveEnabled="true" dropEnabled="true" height="166" width="650" top="5" left="521" columnCount="5" rowHeight="145" columnWidth="125" backgroundColor="#000000" color="#FFFFFF">
     <mx:itemRenderer>
     <mx:Component>
     <mx:Canvas width="125" height="129" backgroundColor="#000000">
     <mx:Image source="{'http://www.coolvisiontest.com/interfaceimages/images/'+ data.icon}" top="5" horizontalCenter="0"/>
     <mx:Label text="{data.label}" bottom="1" horizontalCenter="0"/>
     </mx:Canvas>  
    </mx:Component>
     </mx:itemRenderer>  
    </mx:TileList>
     <mx:TileList id="profile1NewsAndSportAddLinksTilelist" fontWeight="bold" dragEnabled="true" dragMoveEnabled="true" dropEnabled="true" height="166" width="385" top="5" left="128" columnCount="3" rowHeight="145" columnWidth="125" backgroundColor="#000000" color="#FFFFFF">
     <mx:itemRenderer>
     <mx:Component>
     <mx:Canvas width="125" height="129" backgroundColor="#000000">
     <mx:Image source="{'http://www.coolvisiontest.com/interfaceimages/images/'+ data.icon}" top="5" horizontalCenter="0"/>
     <mx:Label text="{data.label}" bottom="1" horizontalCenter="0"/>
     </mx:Canvas>  
    </mx:Component>
     </mx:itemRenderer>  
    </mx:TileList>
     <mx:Button click="profile1NewsAndSportReset()" id="reset" label="Reset" y="5" height="25" x="5"/>
     <mx:Button click="saveprofile1NewsAndSport(event)" id="save" label="Save Changes" x="5" y="38" width="113" height="25.5"/>
     </mx:WindowedApplication>

  • Trying to pass and object variable to a method

    I have yet another question. I'm trying to display my output in succession using a next button. The button works and I get what I want using test results, however what I really want to do is pass it a variable instead of using a set number.
    I want to be able to pass the object variables myProduct, myOfficeSupplies, and maxNumber to method actionPerformed so they can be in-turn passed to the displayResults method which is called in the actionPerformed method. Since there is no direct call to actionPerformed because it is called within one of the built in methods, I can't tell it to receive and pass those variables. Is there a way to do it without having to pass them through the built-in methods?
    import javax.swing.JToolBar;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JTextArea;
    import javax.swing.JScrollPane;
    import javax.swing.JPanel;
    import java.net.URL;
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    public class Panel extends JPanel implements ActionListener
         protected JTextArea myTextArea;
         protected String newline = "\n";
         static final private String FIRST = "first";
         static final private String PREVIOUS = "previous";
         static final private String NEXT = "next";
         public Panel( Product myProduct, OfficeSupplies myOfficeSupplies, int maxNumber )
                 super(new BorderLayout());
              int counter = 0;
                 //Create the toolbar.
                 JToolBar myToolBar = new JToolBar( "Still draggable" );
                 addButtons( myToolBar );
                 //Create the text area used for output.
                 myTextArea = new JTextArea( 450, 190 );
                 myTextArea.setEditable( false );
                 JScrollPane scrollPane = new JScrollPane( myTextArea );
                 //Lay out the main panel.
                 setPreferredSize(new Dimension( 450, 190 ));
                 add( myToolBar, BorderLayout.PAGE_START );
                 add( scrollPane, BorderLayout.CENTER );
              myTextArea.setText( packageData( myProduct, myOfficeSupplies, counter ) );
              setCounter( counter );
         } // End Constructor
         protected void addButtons( JToolBar myToolBar )
                 JButton myButton = null;
                 //first button
                 myButton = makeNavigationButton( FIRST, "Display first record", "First" );
                 myToolBar.add(myButton);
                 //second button
                 myButton = makeNavigationButton( PREVIOUS, "Display previous record", "Previous" );
                 myToolBar.add(myButton);
                 //third button
                 myButton = makeNavigationButton( NEXT, "Display next record", "Next" );
                 myToolBar.add(myButton);
         } //End method addButtons
         protected JButton makeNavigationButton( String actionCommand, String toolTipText, String altText )
                 //Create and initialize the button.
                 JButton myButton = new JButton();
                     myButton.setActionCommand( actionCommand );
                 myButton.setToolTipText( toolTipText );
                 myButton.addActionListener( this );
                   myButton.setText( altText );
                 return myButton;
         } // End makeNavigationButton method
             public void actionPerformed( ActionEvent e )
                 String cmd = e.getActionCommand();
                 // Handle each button.
              if (FIRST.equals(cmd))
              { // first button clicked
                          int counter = 0;
                   setCounter( counter );
                 else if (PREVIOUS.equals(cmd))
              { // second button clicked
                   counter = getCounter();
                      if ( counter == 0 )
                        counter = 5;  // 5 would be replaced with variable maxNumber
                        setCounter( counter );
                   else
                        counter = getCounter() - 1;
                        setCounter( counter );
              else if (NEXT.equals(cmd))
              { // third button clicked
                   counter = getCounter();
                   if ( counter == 5 )  // 5 would be replaced with variable maxNumber
                        counter = 0;
                        setCounter( counter );
                      else
                        counter = getCounter() + 1;
                        setCounter( counter );
                 displayResult( counter );
         } // End method actionPerformed
         private int counter;
         public void setCounter( int number ) // Declare setCounter method
              counter = number; // stores the counter
         } // End setCounter method
         public int getCounter()  // Declares getCounter method
              return counter;
         } // End method getCounter
         protected void displayResult( int counter )
              //Test statement
    //                 myTextArea.setText( String.format( "%d", counter ) );
              // How can I carry the myProduct and myOfficeSupplies variables into this method?
              myTextArea.setText( packageData( product, officeSupplies, counter ) );
                 myTextArea.setCaretPosition(myTextArea.getDocument().getLength());
             } // End method displayResult
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event dispatch thread.
         public void createAndShowGUI( Product myProduct, OfficeSupplies myOfficeSupplies, int maxNumber )
                 //Create and set up the window.
                 JFrame frame = new JFrame("Products");
                 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                 //Add content to the window.
                 frame.add(new Panel( myProduct, myOfficeSupplies, maxNumber ));
                 //Display the window.
                 frame.pack();
                 frame.setVisible( true );
             } // End method createAndShowGUI
         public void displayData( Product myProduct, OfficeSupplies myOfficeSupplies, int maxNumber )
              JTextArea myTextArea = new JTextArea(); // textarea to display output
              JFrame JFrame = new JFrame( "Products" );
              // For loop to display data array in a single Window
              for ( int counter = 0; counter < maxNumber; counter++ )  // Loop for displaying each product
                   myTextArea.append( packageData( myProduct, myOfficeSupplies, counter ) + "\n\n" );
                   JFrame.add( myTextArea ); // add textarea to JFrame
              } // End For Loop
              JScrollPane scrollPane = new JScrollPane( myTextArea ); //Creates the JScrollPane
              JFrame.setPreferredSize(new Dimension(350, 170)); // Sets the pane size
              JFrame.add(scrollPane, BorderLayout.CENTER); // adds scrollpane to JFrame
              JFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); // Sets program to exit on close
              JFrame.setSize( 350, 170 ); // set frame size
              JFrame.setVisible( true ); // display frame
         } // End method displayData
         public String packageData( Product myProduct, OfficeSupplies myOfficeSupplies, int counter ) // Method for formatting output
              return String.format( "%s: %d\n%s: %s\n%s: %s\n%s: %s\n%s: $%.2f\n%s: $%.2f\n%s: $%.2f\n%s: $%.2f",
              "Product Number", myOfficeSupplies.getProductNumber( counter ),
              "Product Name", myOfficeSupplies.getProductName( counter ),
              "Product Brand",myProduct.getProductBrand( counter ),
              "Number of Units in stock", myOfficeSupplies.getNumberUnits( counter ),
              "Price per Unit", myOfficeSupplies.getUnitPrice( counter ),
              "Total Value of Item in Stock is", myOfficeSupplies.getProductValue( counter ),
              "Restock charge for this product is", myProduct.restockingFee( myOfficeSupplies.getProductValue( counter ) ),
              "Total Value of Inventory plus restocking fee", myOfficeSupplies.getProductValue( counter )+
                   myProduct.restockingFee( myOfficeSupplies.getProductValue( counter ) ) );
         } // end method packageData
    } //End Class Panel

    multarnc wrote:
    My instructor has not been very forthcoming with assistance to her students leaving us to figure it out on our own.Aren't they all the same! Makes one wonder why they are called instructors. <sarcasm/>
    Of course it's highly likely that enough information was imparted for any sincere, reasonably intelligent student to actually figure it out, and learn the subject in the process.
    And if everything were spoonfed, how would one grade the performance of the students? Have them recite from memory
    public class HelloWorld left-brace
    indent public static void main left-parenthesis String left-bracket right-bracket args right-parenthesis left-brace
    And everywhere that Mary went
    The lamb was sure to go
    db

  • How to create dynamic View Object and Dynamic Table

    Dear ll
    I want to create a dynamic view object and display the output in a dynamic table on the page.
    I am using Jdeveloper 12c "Studio Edition Version 12.1.2.0.0"
    This what I did:
    1- I created a read only view object with this query "Select sysdate from dual"
    2- I added this View object to the application module
    3- I created a new method that change the query of this View object at runtime
        public void changeVoQuery(String dbViewName) {
            String sqlstm = "Select * From " + dbViewName;
            ViewObject dynamicVo = this.findViewObject("DynamicVo");
            if (dynamicVo != null) {
                dynamicVo.remove();
            dynamicVo = this.createViewObjectFromQueryStmt("DynamicVo", sqlstm);
            dynamicVo.executeQuery();
    4- I run the application module for testing the method and I passed "Scott.Emp" as a parameter and the result was Success
    5- Now I want to show the result of the view on the page, so I draged and dropped the method from the data control as a parameter form
    6- I dragged and dropped the view Object "DynamicVo" as a table and I choose "generate Column Dynamically at runtime". This is the page source
    <af:panelHeader text="#{viewcontrollerBundle.SELECT_DOCUMTN_TYPE}" id="ph1">
            <af:panelFormLayout id="pfl1">
                <af:inputText value="#{bindings.dbViewName.inputValue}" label="#{bindings.dbViewName.hints.label}"
                              required="#{bindings.dbViewName.hints.mandatory}"
                              columns="#{bindings.dbViewName.hints.displayWidth}"
                              maximumLength="#{bindings.dbViewName.hints.precision}"
                              shortDesc="#{bindings.dbViewName.hints.tooltip}" id="it1">
                    <f:validator binding="#{bindings.dbViewName.validator}"/>
                </af:inputText>
                <af:button actionListener="#{bindings.changeVoQuery.execute}" text="changeVoQuery"
                           disabled="#{!bindings.changeVoQuery.enabled}" id="b1"/>
            </af:panelFormLayout>
        </af:panelHeader>
        <af:table value="#{bindings.DynamicVo.collectionModel}" var="row" rows="#{bindings.DynamicVo.rangeSize}"
                  emptyText="#{bindings.DynamicVo.viewable ? 'No data to display.' : 'Access Denied.'}"
                  rowBandingInterval="0" selectedRowKeys="#{bindings.DynamicVo.collectionModel.selectedRow}"
                  selectionListener="#{bindings.DynamicVo.collectionModel.makeCurrent}" rowSelection="single"
                  fetchSize="#{bindings.DynamicVo.rangeSize}" filterModel="#{bindings.DynamicVoQuery.queryDescriptor}"
                  queryListener="#{bindings.DynamicVoQuery.processQuery}" filterVisible="true" varStatus="vs" id="t1"
                  partialTriggers="::b1">
            <af:iterator id="i1" value="#{bindings.DynamicVo.attributesModel.attributes}" var="column">
                <af:column headerText="#{column.label}" sortProperty="#{column.name}" sortable="true" filterable="true"
                           id="c1">
                    <af:dynamicComponent id="d1" attributeModel="#{column}"
                                         value="#{row.bindings[column.name].inputValue}"/>
                </af:column>
            </af:iterator>
        </af:table>
    when I run the page this error is occured
    <Nov 13, 2013 2:51:58 PM AST> <Error> <oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter> <BEA-000000> <ADF_FACES-60096:Server Exception during PPR, #1
    javax.el.ELException: java.lang.NullPointerException
    Caused By: java.lang.NullPointerException
    Can any body help me please
    thanks

    Have you seen Shay's video https://blogs.oracle.com/shay/entry/adf_faces_dynamic_tags_-_for_a
    All you have to do is to use the dynamic table to get your result.
    Timo

Maybe you are looking for

  • Text Variable not working correctly

    In CS3 I could create a TEMPLATE (.indt) with the "creation date" text variable in it and when I opened it it would have the CURRENT DATE (the date the new file was generated from the template) . In CS4 it opens with the date the TEMPLATE was MADE an

  • HT1933 How do I re activate my account.

    I want to re activate my account but don't know how.  Please help.

  • [Schema Design]: How to reduce inventory snapshot table size

    We are planning to store inventory level's periodic snapshot at the end of each day. We have close to 50k different products.  But on a given day only 5-6k products inventory changes.  As I understand if I start inserting just the products which have

  • What's with all the Data?

    Hello everyone, my Dell Inspirion 1521 laptop with 136gigs of disk space seems to only have 25.3 gigs free. This is strange because all the programs that show up under "Programs and Features" only add up to about 7gigs and all the folders in my OS (C

  • Read html from a cgi returned file: help, thanks

    i have a problem with the following case. i want to quote google's searching result in my program, and what i do it like this. 1> open a connection URL url = new URL("http://images.google.com/images"); URLConnection connection = url.openConnection();