Solve this Dynamic sql problem

hi i am sending the table and the contents in the table and what i want from the table.
SQL> descr sswms_rule_components;
Name Null? Type
RULE_COMPONENT_ID NOT NULL NUMBER
RULE_COMPONENT_CODE NOT NULL VARCHAR2(30)
RULE_COMPONENT_NAME NOT NULL VARCHAR2(100)
ENABLED_FLAG NOT NULL VARCHAR2(1)
DB_TABLE VARCHAR2 (100)
DB_COLUMN VARCHAR2 (100)
DB_FUNCTION VARCHAR2(100)
WHERE_CLAUSE VARCHAR2 (2000)
FROM_CLAUSE VARCHAR2 (2000)
The table contains the following data
db_table
sswms_shipment_lines
wsh_carrier_ship_method --- the data inside the db_table column is a table
db_column
Ship to
Carrier_id
Where_clause
Oe_order_headers_all.header_id = sswms_shipment_lines.order_header_id
From_clause
Oe_order_headers_all, sswms_shipment_lines -- the data inside the From_clause is a table
Now my requirement is to build a dynamic sql in forms 6i.when I click the build sql it should update the sql
So --- I have to write a procedure --
Select db_table || . || db_column || ‘’ || group_key
---group_key is an alias
From db_table, From_clause
--- Here the logic should be
1. I should remove the commas from the “FROM_CLAUSE” column and check for duplicate values
2. i should check for duplicate values for the “DB_TABLE “ column
3. I should compare both the FROM_CLAUSE and DB_TABLE column for DUPLICATE VALUES
4. After doing this I should add the result to the “FROM” in the select statement
5.The table name should not be repeated from the "FROM"
I am expecting the code and a positive reply from you.

I'm waiting for the code the last 10 minutes and none arrived. What's happening? Developers, do my work, please! (ironic sentence)

Similar Messages

  • Help to make this dynamic sql work

    Hi,
    I have many DDLs to execute and these DDLs change over time, so I try to load these DDLs into a table (y) and write a proc to loop through them. But I run into some problems and need your help.
    Here are the details:
    create table y ( x varchar2(4000));
    CREATE TABLE error_log (
    error_log_ID NUMBER(20),
    statement VARCHAR2(2000),
    error_msg VARCHAR2(400),
    Action VARCHAR2(16)
    CREATE SEQUENCE SEQ_error_log
    START WITH 1
    INCREMENT BY 1
    NOMINVALUE
    NOMAXVALUE
    NOCYCLE
    CACHE 20
    NOORDER
    CREATE OR REPLACE PROCEDURE CUST_UPDATE1 (
    schema_name IN VARCHAR2 ,
    table_tablespcae_name IN VARCHAR2,
    index_tablespcae_name IN VARCHAR2
    ) AS
    v_code NUMBER;
    v_errm VARCHAR2(400);
    sql_stmt1 VARCHAR2(3000) ;
    CURSOR c1 IS SELECT x FROM y;
    BEGIN
    FOR i IN c1 LOOP
    sql_stmt1 := i.x;
    DBMS_OUTPUT.PUT_LINE ( 'x = '|| sql_stmt1 );
    / **************************** worked if use this hard coded ********************************
    sql_stmt1 := 'CREATE TABLE '||schema_name||'.zz
    aa VARCHAR2(4) NOT NULL,
    bb VARCHAR2(100) NOT NULL,
    cc VARCHAR2(2) NOT NULL
    TABLESPACE '|| table_tablespcae_name;
    BEGIN
    EXECUTE IMMEDIATE sql_stmt1;
    EXCEPTION
    WHEN OTHERS THEN
    v_code := SQLCODE;
    v_errm := SUBSTR(SQLERRM, 1 , 400);
    INSERT INTO error_log VALUES ( SEQ_error_log.nextval, sql_stmt1, v_errm, DECODE(v_code, -1430, 'IGNORE', 'CHECK') );
    END;
    END LOOP;
    END;
    Test:
    exec cust_update1('SCOTT', 'USERS', 'c'); -- didn't use last parameter
    Senario 1. insert into y values (
    'CREATE TABLE schema_name.zz
    aa VARCHAR2(4) NOT NULL,
    bb VARCHAR2(100) NOT NULL,
    cc VARCHAR2(2) NOT NULL
    TABLESPACE table_tablespcae_name ' );
    ===> error_log show: ORA-01918: user 'SCHEMA_NAME' does not exist
    Senario 2. insert into y values (
    '''CREATE TABLE ''||schema_name||''.zz
    aa VARCHAR2(4) NOT NULL,
    bb VARCHAR2(100) NOT NULL,
    cc VARCHAR2(2) NOT NULL
    TABLESPACE ''|| table_tablespcae_name' );
    ==> error_log show: ORA-00900: invalid SQL statement
    3. I hard coded the exact dynamic from step 2 and assigned to sql_stmt1, ( as commeted out in my code) it WORKED.
    Thanks
    George

    hi,
    do the scenario1 but you have to substitute the schema_name and table_space name with your actual string before calling the dynamic sql.
    ei.
    sql_stmt1 := replace(sql_stmt1,'schema_name',schema_name);
    sql_stmt1 := replace(sql_stmt1,'table_tablespcae_name',table_tablespcae_name);
    BEGIN
    EXECUTE IMMEDIATE sql_stmt1;
    EXCEPTION
    WHEN OTHERS THEN
    v_code := SQLCODE;
    v_errm := SUBSTR(SQLERRM, 1 , 400);
    INSERT INTO error_log VALUES ( SEQ_error_log.nextval, sql_stmt1, v_errm, DECODE(v_code, -1430, 'IGNORE', 'CHECK') );
    END;
    Cheers,
    J

  • How to solve this ORA-12154 problem please?

    Hello,
    I'm trying to execute the following command:
    C:\Documents and Settings\HP>sqlplus "sys/neo555@orcl as sysdba"
    SQL*Plus: Release 10.1.0.4.2 - Production on Dom Dez 18 02:45:37 2005
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    ERROR:
    ORA-12154: TNS:nÒo p¶de resolver o identificador de conexÒo especificado
    Translating: ORA-12154 TNS could not solve the conection identifier specified
    Informe o nome do usußrio:
    Translating: Inform the user name:
    How to solve this please because I get no other errors in the software.
    Thank you,
    André Luiz

    Hi
    If objective is to just connect as sysdba then you can simply check your SQLNET.ORA file under ORACLE_HOME\NETWORK\ADMIN and make an entry like
    SQLNET.AUTHENTICATION_SERVICES = (NTS)
    C:\Documents and Settings\HP>set oracle_sid=orcl
    C:\Documents and Settings\HP>sqlplus "/ as sysdba"
    Pls paste contents of your TNSNAMES.ORA and LISTENER.ORA files here.
    Rgds
    Adnan

  • How to solve this "amnesia" protect problem

    Hi All
    I have a two nodes one quorum cluster environment. I just see this problem:
    I shutdown nodeA and all all othe resource groups switch to nodeB, it works fine
    and I believe quorum device vote belongs to nodeB.
    Then I shutdown nodeB and power on the nodeA, nodeA cannot boot as cluster,
    there's messages like:
    NOTICE: clcomm: Path NodeB:e1000g0 - NodeA:e1000g0 errors during initiation
    WARNING: Path NodeB:e1000g0 - NodeA:e1000g0 initiation encountered errors, errno = 62. Remote node may be down or unreachable through this path.
    NOTICE: CMM: Cluster doesn't have operational quorum yet; waiting for quorum.
    I know this is because the quorum vote is nodeB to prevent amnesia condition.
    But I still confused for this: if the problem occurs, nodeB is broken and cannot
    boot anyway,what people can do is just hack the CCR?Is there any solution ,for
    example, nodeA can boot as cluster master and after nodeB come up ,the DR can
    update the older nodeB CCR ?is there any option for this?
    thanks
    lifeng

    here a procedure from http://prefetch.net/reference/suncluster.txt :
    # Recovering from amnesia
    # (use at your own risk)
    Scenario: Two node cluster (nodes A and B) with one QD,
    nodeA has gone bad, and amnesia protection is preventing
    nodeB from booting up.
    - Boot nodeB in non-cluster mode (boot -x).
    - Edit nodeB's file /etc/cluster/ccr/infrastructure as follows:
    - Change the value of "cluster.properties.installmode" from
    "disabled" to "enabled".
    - Change the number of votes for nodeA from "1" to "0",
    in the following property line:
    "cluster.nodes.<NodeA's id>.properties.quorum_vote".
    - Delete all lines with "cluster.quorum_devices" to remove
    knowledge of the quorum device.
    - Run command:
    /usr/cluster/lib/sc/ccradm -i /etc/cluster/ccr/infrastructure -o
    - Reboot nodeB in cluster mode.

  • Help in solving this pl/sql block

    Hi
    Could some one help me in solving my problem
    i want some data to be extracted by a sql its not fetching it so i prefered to write a pl/sql block for it ...
    the block is as follows
    begin
    cursor opunit is
    select code from fmg_operating_units;
    cursor pak_code is --- those are the 3 codes which i require
    select 'BNL' from dual
    union select 'HNA' from dual
    union select 'HNL' from dual;
    cursor data1(opunit,pak_code) is
    select mas.name ,
    cl.id ,
    opup.oun_code ,
    fmg_phone_no(mas.id),
    clpk.pak_code ,
    clpk.id
    from fmg_op_unit_positions opup,
    fmg_clients cl,
    fmg_client_paks clpk,
    fmg_masters mas,
    fmg_policies po,
    fmg_policy_items pi
    where mas.id=cl.mas_id
    and cl.id=clpk.cli_id
    and clpk.oup_id=opup.id
    and opup.oun_code = opunit
    and clpk.id=po.ctp_id
    and po.id=pi.pol_id
    and pi.current_status='AC'
    and clpk.pak_code = pak_code;
    loop opunits
    loop pak_code
    open data1
    fetch data1(opunit,pak_code) ;
    end loop;
    end loop;
    could some one help me in extracting the data and put it on the CSV file ...
    i would be very thank full to you if some one take some time to full fill this task..
    thanks in advance

    Declare
         cursor opunit is
              select distinct code
              from fmg_operating_units;
         cursor pak_code is --- those are the 3 codes which i require
              select 'BNL' codes from dual
              union
              select 'HNA' codes from dual
              union
              select 'HNL' codes from dual;
         cursor data1(opunit,pak_code) is
              select mas.name ,
                   cl.id ,
                   opup.oun_code ,
                   fmg_phone_no(mas.id),
                   clpk.pak_code ,
                   clpk.id
              from fmg_op_unit_positions opup,
              fmg_clients cl,
                   fmg_client_paks clpk,
                   fmg_masters mas,
                   fmg_policies po,
                   fmg_policy_items pi
              where mas.id     =     cl.mas_id
              and cl.id     =     clpk.cli_id
              and clpk.oup_id =     opup.id
              and opup.oun_code =      opunit
              and clpk.id     =     po.ctp_id
              and po.id     =     pi.pol_id
              and pi.current_status=     'AC'
              and clpk.pak_code =      pak_code;
    begin
         FOR opunits IN opunit LOOP
              FOR pak_codes IN pak_code LOOP
                   OPEN data1;     
                        fetch data1(opunits.code,pak_codes.codes) ;
                        EXIT WHEN data1%NOTFOUND;
                        < Rest of your code here > -- You can insert processed data into a temp table &
                                       -- extract data from that table afterwards via select statement
                                       -- & saving the data in a .cvs file extension.
                   CLOSE data1;
              END LOOP;
         END LOOP;
         <Some more code here if applicable>
    EXCEPTION
         <Exception handling code section here>
    END;

  • Can you help me to solve this matrix filling problem?

    Hi,
    I need to fill a matrix column. this is the description briefly.
    1.This is my binding
    oForm.DataSources.UserDataSources.Add("usr_col5", SAPbouiCOM.BoDataType.dt_DATE, 50);
    oColumn = oColumns.Add("Col5", SAPbouiCOM.BoFormItemTypes.it_EDIT);
                    oColumn.Description = "Konteringsdato";
                    oColumn.TitleObject.Caption = "Konteringsdato";
                    oColumn.DataBind.SetBound(true, "", "usr_col5");
                    oColumn.Width = 89;
                    oColumn.Editable = false;
    2.I am going to fill this column using record set's field. all of the other column's fillings are ok.but problem is here
    oForm.DataSources.UserDataSources.Item("usr_col5").Value = oRs.Fields.Item("DocDate").Value.ToString();
    I think there should be a casting instead of of using ToString(). But i couldn't able to do it. So please help me.

    Hi,
    you can try once to set
    ((SAPbouiCOM.EditText)((SAPbouiCOM.Matrix)(oForm.Items.Item("mtxItemUID").Specific)).Columns.Item("Col5").Cells.Item(cellnumber).Specific).String = oRs.Fields.Item("DocDate").Value.ToString();
    or
    ((SAPbouiCOM.EditText)((SAPbouiCOM.Matrix)(oForm.Items.Item("mtxItemUID").Specific)).Columns.Item("Col5").Cells.Item(cellnumber).Specific).Value = oRs.Fields.Item("DocDate").Value.ToString();
    regards
    David

  • Any ideas on this dynamic link problem I'm having.....?? CS4

    Installed the full Production Premium CS4 package under Win7, 64-bit.
    If I right click a clip in Premiere and select "Replace with an After Effects Composition," AE opens, clip appears and I can add an effect, etc.
    I can also save the AE project.
    However, I can never get back into Premiere. I just get the spinning circle.
    Timeline shows, "Replace with AE Composition" where the clip was.
    And, I must close AE first before I can close Premiere, so it appears that AE is communicating with it, but just not completely.
    Same exact thing happens with Soundbooth and Photoshop. I can get data in and modify it, but never return it to Premiere.
    I've reset the preferences (shift ^ alt) at startup of Premiere and AE to no avail.
    Haven't seen anything in searching the forum that helps, so I'm wondering if this rings any bells for anyone?
    TIA,

    Some additional information about the problem:
    Open Premiere with "Run as Administrator"
    Right click on a clip (doesn't matter which) and select "replace with AE composition"
    AE opens and asks for a filename. Task Manager (TM) indicates "Running" for AE and "Not Responding" for Pr.
    Give filename and AE opens with the selected clip from Pr. TM indicates both as "Running."
    Can return to Pr and then go back to AE. Can "File\Save" in both.
    However, when I add an effect in AE - e.g., Brightness/Contrast, the effect works fine in AE but if I return to Pr, just get the spinning wheel and TM says "Not Responding" for Pr. AE is still "Running."
    If I click in the timeline, or any other "box" in Pr, it goes "whitish" or semi-transparent or fades. Hard to describe exactly.
    Every box I click in does the same. Spinning wheel never stops and Pr never recovers.
    State of the system at that point is as follows:
    Once there was another program that appeared in TM called "droverloard.exe" that appeared and was also "Not Responding."
    I'm about out of ideas here, so hopefully this will jog someone's memory about what's going on...
    TIA,

  • How do I solve this distinct count problem?

    Hello experts,
      So, I have an OBI report (table view).  I needed to get the percentage difference btn 2 columns, I did. Then I had to summarize difference in 4 buckets (0-15, 16-30, 31-50, >50%); I did (case statement). NOW,  I need to summarize(distinct count) the above buckets based on Store numbers for each day.
    Basically, if the difference is btn(0-5%) and I have 5 stores then I need to see 5 stores separately. The problem I am having when I do the distinct count instead of having separate counts for each bucket I am getting the total.  I see the buckets summarized, but the store column is showing the total number of all(we have about 700 stores) instead of breaking down the count for each bucket.  In the stores column I am using the distinct count function, I don't know if the problem is here or the case statement for buckets. I don't know either OBIEE is able to do what I trying to do, since I have yet to do this kind of function.  I have gotten few leads on my first post,  so far none of them have worked.
    As always, your insights are highly appreciated,

    Instead of using Distinct Count in Aggregation Rule,Try using in Column Formula.
    Let me know if u need any help on this.
    Thanks,

  • Since upgrading to firefox4.0, my NVIDIA kernel mode driver frequently not responding, turning monitor black, then successfully recovered. The Firefox browser would then crash afterwards. Please help solve this very annoying problem.

    as above.

    I have the same problem. I just upgraded to Win 7, no problems. Then I upgraded to FF 4.0, and I kept getting Nvidia Video Card crashes. I always undo my last computer change/install when something like this happens, so I immediately uninstalled 4.0, and went back to my older version of Firefox. No problems ever since.

  • Solving corrupt dynamic memory problem

    Using LabWindows/CVI 2010, Windows XP. I have a data acquisition program that uses a rather large number of dynamically allocated arrays as buffers. The buffers are used to hold data from DAQmx and are passed and copied to a number of thread-safe queues and other routines. In certain circumstances, when I free one buffer I get a "dynamic memory is corrupt" error, which probably means - from reading the other posts on this topic on this forum - that some buffer was written past its end and corrupted the dynamic memory linked list. Is there any good way to determine exactly <i>which</i> buffer was corrupted? I don't believe that it was the one that I get the error on, it was probably the previous or next one in the chain. I can see the memory chain in the resource window, but I'm not sure how to interpret it.

    Hi pblase, 
    Here is an KnowledgeBase article that was written for LabWindows\CVI 6.0 but it still has some valid suggestions for debugging in LabWindows\CVI 2010:
    http://digital.ni.com/public.nsf/allkb/862567530005F09C8625632500692F41?OpenDocument
    There are three valid suggestions to debug from this article.  The only one that does not work still is the Run » Dynamic Memory feature.
    Peter T
    Applications Engineer
    National Instruments

  • [SOLVED]JDBC Dynamic credentials problem

    Hello everyone. I have been trying to implement Steve Muench example 14 about JDBC Dynamic Credentials on my own web app., I am using Jdeveloper 10.1.3.2 and JSF/ADF.
    The thing is that the JDBC dynamic credential works well but when I enter a non-existant username/password the login.jsp page sends me to the main.jsp page and in the table that I have placed there (in the main.jsp page) it shows "Access Denied". Is there any way to tell the app. to redirect the users to the login.jsp page if they try to acces other parts of the app. and they are not logged in???, or is it thay I am missing something from the Steve Muench's example???
    I have been cheking the "DynamicJDBCBindingFilter.java" code and, if I understand correctly ('cause I consider myself a newbe), the "super.doFilter(request, response,chain)" is suppoused to throw an exception if the authentication fails and the "catch" code then sends the user to the login.jsp page... but for some reason this doesn't work!!!
    Can anybody help me on this one please?
    Thanks.
    * By the way, no errors are thrown!
    Message was edited by:
    dragonov7

    Hi Frank, thanks for your response. That same idea crossed my mind but the thing is that the line "super.doFilter(request, response,chain);" is supouseded to throw an exception if it fails to do its job but for some reason it does not... I have placed a "System.out.printline("XXX");" line inmediatly after the "catch" statement to see if an exception is thrown but apparently it doesn't, so I can't set a flag if I don't know for sure if the process ended well (or wrong).
    I think I'll clear my mind for 1 hour and start all over again... maybe I am missing something...

  • I just can't solve this Photoshop graphic problem

    Greetings...
    I've seen a bit hereabouts on graphics import problems, but nothing so far has led me to a solution.
    Here's the thing: A multi-layer graphic was created for me in Photoshop CS2. It has a backround image and text. I intend to use it as a menu background. Looks swell in Photoshop, but when imported into DVDSP4, the text goes bad on me. The nice smooth edges on the capital "S" and other rounded characters now look roughhewn. The capital "T" and other hard edge characters look fine. The background image looks fine. Only the text stubbornly refuses to look like it does when still in Photoshop.
    The file was delivered to me at 800x600, 72 dpi. I've tried importing it into DVDSP4 most every way my feeble mind can think of: as is, resized to 720x534; as a merged-layer psd file; as a flattened psd file; as a tiff; as a pict; as a jpeg. It always comes out exactly the same - bad font problems, background image okay. I then took a few of the above images, dropped them into menus, burned a disc and looked at the finished product on my TV. The font problems were still very evident. (I also included on the test disc a menu with fonts entered directly from DVDSP4; they looked just fine.)
    Obviously, I'm missing something here. I have only superficial knowledge of Photoshop, so I'm really at a loss. Clearly, one should be able to transfer a graphic from Photoshop to DVDSP4 without a noticeable loss, but I'll be darned if I can figure out how to do it.
    Any advice, o learned ones?
    - derek
    PowerMac dual 2.0   Mac OS X (10.4.4)  

    Thanks again to all for your feedback. I'm going to look into every option you mentioned to see if I can find the key to my problem.
    By the way, I just now tried a test file of my own. Started from scratch with the NTSC 720x540 preset; typed in some print (36 pt, 24 pt); left the setting at "crisp"; saved the file as a PSD; imported it into DVDSP4; dropped it into a new menu ("Set Background, All layers visible") and...same problem.
    But just so my expectations are not off base, let me ask you this: The test file looked fine in Photoshop, yet the round characters all looked very rough once they were dropped into the DVDSP menu. What do you see on your setup when YOU do this? Are the letters all approximately as clean and well-formed as they were when residing in Photoshop? Now, I haven't burned this latest test file to see what it looks like on my TV, but I'm still curious as to why it looks so bad in DVDSP simulation. Note that text generated from within DVDSP4 looks just fine all down the line, from viewer to simulation to burned DVD.
    What the heck...????????
    - derek

  • How to solve this case sensitive problem for the parameters in function?

    Hi,
       I have a function, which should receive one parameter comes from textbox in BSP form. User will input upper case or lower case characters together in this textbox. But when I debug function, I found after function recevice the value from BSP form, the string value was converted into upper case automatically.
       I don't want system convert string to upper or lower case. I want keep the original value that user inputted.
       So is it possible to do this?
       Thanks!

    Hi,
       Thanks for your reply.
       Yes, I use the inputfield. The problem is if I use the parameter which contain user's input in the event handler of BSP, the value is equal to the user's input. But if the parameter was transfered into function, the value was converted to uppercase.
       But I want to keep  the original value.
       Thanks!

  • Can anyone solve this simple MVC problem with ArrayCollection

    I have very simple application trying to understand how to apply MVC without any framework. There are quite a few exemples on the net but most do not deal with complex data.
    here is my application with 4 files: MVCtest.mxml, MyController.as, MyModel.as and MyComponent.as
    first the Model MyModel.as
    package model
    import flash.events.Event;
    import flash.events.EventDispatcher;
    import flash.events.IEventDispatcher;
    import mx.collections.ArrayCollection;
    [Event(name="ArrayColChanged", type="flash.events.Event")]
    [Bindable]
    public class MyModel extends EventDispatcher
      private static var instance:MyModel;
      public static const ARRAYCOL_CHANGED:String = "ArrayColChanged";
      private var _myArrayCol:ArrayCollection;
      public function MyModel(target:IEventDispatcher=null)
       super(target);
       instance = this;
      public static function getInstance():MyModel
       if(instance == null)
        instance = new MyModel();
       return instance;
      public function get myArrayCol():ArrayCollection
       return _myArrayCol;
      public function set myArrayCol(value:ArrayCollection):void
       _myArrayCol = new ArrayCollection(value.source);
       dispatchEvent(new Event(ARRAYCOL_CHANGED));
    then the controller: MyController.as
    package controller
    import components.MyComponent;
    import flash.events.Event;
    import flash.events.EventDispatcher;
    import flash.events.IEventDispatcher;
    import model.MyModel;
    import mx.collections.ArrayCollection;
    import mx.controls.Alert;
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.remoting.RemoteObject;
    public class MyController extends EventDispatcher
      [Bindable]
      public var view:MVCtest;
      [Bindable]
      public var componentView:MyComponent;
      private var _model:MyModel = MyModel.getInstance();
      public function MyController(target:IEventDispatcher=null)
       super(target);
       _model.addEventListener("ArrayColChanged", onArrayColChange);
      public function initialise(event:Event):void
       getData();
      public function getData():void
       var dataRO:RemoteObject = new RemoteObject;
       dataRO.endpoint = "gateway.php";
       dataRO.source = "MytestdbService";
       dataRO.destination = "MytestdbService";
       dataRO.addEventListener(ResultEvent.RESULT, dataROResultHandler);
       dataRO.addEventListener(FaultEvent.FAULT, dataROFaultHandler);
       dataRO.getAllMytestdb();   
      public function dataROResultHandler(event:ResultEvent):void
       _model.myArrayCol = new ArrayCollection((event.result).source);
      public function dataROFaultHandler(event:FaultEvent):void
       Alert.show(event.fault.toString());
      public function onArrayColChange(event:Event):void
       componentView.myDataGrid.dataProvider = _model.myArrayCol;
    This is the main application: MVCtest.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/mx"
          xmlns:controller="controller.*"
          xmlns:components="components.*"
          width="600" height="600"
          creationComplete="control.initialise(event)">
    <fx:Declarations>
      <controller:MyController id="control" view = "{this}"/>
    </fx:Declarations>
    <fx:Script>
      <![CDATA[
       import model.MyModel;
       import valueObjects.MyVOorDTO;
       [Bindable]
       private var _model:MyModel = MyModel.getInstance();
      ]]>
    </fx:Script>
    <s:VGroup paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">
      <s:Label fontSize="20" fontWeight="bold" text="MVC Test with components"
         verticalAlign="middle"/>
      <components:MyComponent/>
    </s:VGroup>
    </s:Application>
    And this is the component: MyComponent.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
       xmlns:s="library://ns.adobe.com/flex/spark"
       xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300">
    <s:layout>
      <s:VerticalLayout paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10"/>
    </s:layout>
    <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:Label fontSize="16" fontWeight="bold" text="My Component " verticalAlign="bottom"/>
    <s:DataGrid id="myDataGrid" width="100%" height="100%" requestedRowCount="4">
      <s:columns>
       <s:ArrayList>
        <s:GridColumn dataField="mystring" headerText="String"></s:GridColumn>
        <s:GridColumn dataField="myinteger" headerText="Integer"></s:GridColumn>
        <s:GridColumn dataField="myreal" headerText="Real"></s:GridColumn>
        <s:GridColumn dataField="mydate" headerText="Date"></s:GridColumn>
       </s:ArrayList>
      </s:columns>
    </s:DataGrid>
    </s:Group>
    Here is the code to generate the database:
    CREATE DATABASE mytest;
    CREATE TABLE myTestDB
          myid INT UNSIGNED NOT NULL AUTO_INCREMENT,
          mystring CHAR(15) NOT NULL,
          myinteger INT NOT NULL,
          myreal DECIMAL(6,2) NOT NULL,
          mydate DATE NOT NULL,
          PRIMARY KEY(myid)
    ) ENGINE = InnoDB;
    INSERT INTO myTestDB (mystring, myinteger, myreal, mydate) VALUES ('Test', 123, 45.67, '2012-01-01'), ('Practice', 890, 12.34, '2012-02-01'), ('Assay', 567, 78.90, '2011-10-01'), ('Trial', 111, 22.22, '2009-09-09'), ('Experiment', 333, 44.44, '1999-04-15'), ('Challenge', 555, 66.66, '2012-12-21');
    And finally here is the PHP script.
    <?php
    class myVOorDTO
      var $_explicitType = "valueObjects.myVOorDTO";
      public $myid;
      public $mystring;
      public $myinteger;
      public $myreal;
      public $mydate;
      public function __construct()
        $this->myid = 0;
        $this->mystring = "";
        $this->myinteger = 0;
        $this->myreal = 0.0;
        $this->mydate = date("c");
    class MytestdbService
      var $username = "yourusername";
      var $password = "yourpassword";
      var $server = "yourserver";
      var $port = "yourport";
      var $databasename = "mytest";
      var $tablename = "mytestdb";
      var $connection;
      public function __construct()
        $this->connection = mysqli_connect(
        $this->server, $this->username, $this->password, $this->databasename, $this->port);
    * Returns all the rows from the table.
    * @return myVOorDTO
      public function getAllMytestdb()
        $query = "SELECT * from $this->tablename";
        $result = mysqli_query($this->connection, $query);
        $results = array();
        while ($obj = mysqli_fetch_assoc($result))
          $row = new myVOorDTO();
          $row->myid = $obj['myid'] + 0;
          $row->mystring = $obj['mystring'];
          $row->myinteger = $obj['myinteger'] + 0;
          $row->myreal = $obj['myreal'] + 0.0;
          $row->mydate = new Datetime($obj['mydate']);
          array_push($results, $row);
        return $results;
    ?>
    My understanding as to what is going on is: (1) on creation complete the application launch the initialise() function of the controller (2) this function starts the remoteObject which get the data (3) once the results arrive the resultHandler store the data into the ArrayCollection of the model ***this does not work*** (4) even if part 3 did not work, the setter of the ArrayCollection in the model send an event that it has been changed (5) the controller receive this event and assigns the ArrayCollection of the model as the dataprovider for the datagrid in the compoent.
    Of course, since the ArrayCollection is null, the application gives an error as the dataProvider for the datagrid is null.
    What is missing in this application to make it work properly? I believe this is an example that could help a lot of people.
    Even if I change the setter in the model to _myArrayCol = ObjectUtil.copy(value) as ArrayCollection; it still does not work.
    Also, it seems that the remoteObject does not return a typed object (i.e. myVOorDTO) but rather generic objects. I am usually able to make this works but in this particular application I have not managed to do it. Again what's missing?
    Thanks for any help with this!

    Calendar c = GregorianCalendar.getInstance();
    c.set(Calendar.YEAR,2000);
    System.out.println(c.getActualMaximum(Calendar.WEEK_OF_YEAR));
    c.set(Calendar.YEAR,2001);
    System.out.println(c.getActualMaximum(Calendar.WEEK_OF_YEAR));But it says that 2000 has 53 weeks and 2001 has 52.

  • Solving this simple GB problem

    I have a Presonus Firepod, I'm recording drums and I have 7 inputs connected.
    Is there some kind of way to select all the tracks and a enable the recording button all at once? Instead of clicking the Record button on each track/input.
    Also, I like my drums to have the Detailed Drums preset. I want to apply it on all the tracks, again, how do I do this without having to select each input/track to change it.

    Is there some kind of way to select all the tracks and a enable the recording button all at once?
    no
    I like my drums to have the Detailed Drums preset.
    create one track, set its effects, and then duplicate it 6 times.

Maybe you are looking for

  • Server 2008 crash - black screen with mouse cursor

    dell poweredge 2950 with Perc 5/I RAID, ESXi 4.1 host, Windows Server 2008 R2 SP1 VM After swapping out a failed raid5 drive this vm began displaying inpage operation error popups while checking folder permissions.  event viewer errors:  The file sys

  • TS4062 This iPhone cannot be synched.You do not have enough access privledges for this operation.

    I have installed the latest version of iTunes on a new computer and want to sync my phone on it. I receive this message when trying to sync. I have tried unchecking sync photos but still no luck. Thanks

  • Jmap   executable not found  in linux

    I have installed jdk 1.6 in linux long time before, now I want to use jmap to get heap dump, looking under the bin folder there is no jmap, lrwxrwxrwx 1 root root     10 May 21  2012 ControlPanel -> ./jcontrol -rwxr-xr-x 1 root root  50794 Jan 20  20

  • Finder crashes if I attempt to read any image updated by Adobe Lightroom

    Install seemed to go flawlessly except that I can no longer preview, see an icon or open in any way in Preview, any image that has been updated (the metadata) in Adobe Lightroom. I'm running Adobe Lightroom 1.2 and all image still open fine in it, or

  • JBO-26030 while updating

    My application was generated with BC4J/JSP Application wizard in JDeveloper 3.2.3 and it runs in Oracle9iAS 1.0.2.2.1 When I push the "Edit Current Record" button, the application lock the current record by a Select for update, if a press the "Cancel