Problems building a graph using sql SUM

Hello !
i'm curently having issues to build a particular graph :
First, i have a database (moves) which contains 2 columns (timestamp DATETIME, dist NUMERIC), i have no problems to display a graph with these values (even using a time range such 'now','-1 hours', etc.).
But i'd like to build a graph with for example a 2 hours range which gonna display the sum of the value 'dist' every 30 seconds. So for example, if i have 2 'dist' values (3 and 4) at 0min 30sec, the graph will display 7 and the next value will be the sum of
the next 30 secondes dist values.
I tried this :
curs.execute("SELECT timestamp,SUM(dist) AS dist30 FROM moves WHERE timestamp>datetime('now','-30secondes')"
curs.execute("SELECT timestamp,dist30 FROM moves WHERE timestamp>datetime('now','-1 hours')"
But it looks like the column dist30 is not created, and i think this is not gonna work if i want to change the 1 hour range...
I would like a better "algorythme", the table is filled in an other program, should i directly create a 3  columns table and SUM the dist in dist30 directly ?
Thanks for your advice !

Hi Subby,
Regarding your description, are you trying to rollup the dist column by every 30 seconds in a given 2 hours range? If my understanding I correct, you may reference the below sample. As you didn't post any detail about your function datetime(after the where
clause), so the sample is just in a usual way.
CREATE TABLE moves(timestamp DATETIME, dist NUMERIC)
INSERT INTO moves VALUES('2015-02-13 14:20:01',1)
INSERT INTO moves VALUES('2015-02-13 14:20:17',2)
INSERT INTO moves VALUES('2015-02-13 14:20:29',5)
INSERT INTO moves VALUES('2015-02-13 14:22:37',2)
INSERT INTO moves VALUES('2015-02-13 14:22:56',5)
INSERT INTO moves VALUES('2015-02-13 14:27:17',2)
SELECT timestamp,SUM(dist) AS dist30 FROM(
SELECT DATEADD(SECOND,DATEPART(SECOND,timestamp)%30*-1,timestamp) AS timestamp,dist FROM moves) AS T --rollup by every 30 seconds
WHERE timestamp BETWEEN '2015-02-13 13:00:00' AND '2015-02-13 15:00:00' --two hour range
GROUP BY timestamp
If you have any question, feel free to let me know.
Eric Zhang
TechNet Community Support

Similar Messages

  • Problem loading XML-file using SQL*Loader

    Hello,
    I'm using 9.2 and tryin to load a XML-file using SQL*Loader.
    Loader control-file:
    LOAD DATA
    INFILE *
    INTO TABLE BATCH_TABLE TRUNCATE
    FIELDS TERMINATED BY ','
    FILENAME char(255),
    XML_DATA LOBFILE (FILENAME) TERMINATED BY EOF
    BEGINDATA
    data.xml
    The BATCH_TABLE is created as:
    CREATE TABLE BATCH_TABLE (
    FILENAME VARCHAR2 (50),
    XML_DATA SYS.XMLTYPE ) ;
    And the data.xml contains the following lines:
    <?xml version="2.0" encoding="UTF-8"?>
    <!DOCTYPE databatch SYSTEM "databatch.dtd">
    <batch>
    <record>
    <data>
    <type>10</type>
    </data>
    </record>
    <record>
    <data>
    <type>20</type>
    </data>
    </record>
    </batch>
    However, the sqlldr gives me an error:
    Record 1: Rejected - Error on table BATCH_TABLE, column XML_DATA.
    ORA-21700: object does not exist or is marked for delete
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 1
    If I remove the first two lines
    "<?xml version="2.0" encoding="UTF-8"?>"
    and
    "<!DOCTYPE databatch SYSTEM "databatch.dtd">"
    from data.xml everything works, and the contentents of data.xml are loaded into the table.
    Any idea what I'm missing here? Likely the problem is with special characters.
    Thanks in advance,

    I'm able to load your file just by removing the second line <!DOCTYPE databatch SYSTEM "databatch.dtd">. I dont have your dtd file, so skipped that line. Can you check if it's problem with ur DTD?

  • Build essbase cube using Sql query.....

    Hi Team, Can we build dimensions as well as load data into essbase cubes using sql query generated from cognos cube. If so , please guide me the procedure

    I'm not sure about cognos, if you can create an ODBC connection you can try using that in SQL load rules and see if that works.
    Opening an SQL Database
    Regards
    Celvin
    http://www.orahyplabs.com

  • Reg: Building Essbase dimension using SQL in rule file

    Hi,
    We are using Essbase 11.1.2.2. I am trying to build a dimension in a cube using SQL query in the rule file, but i am not able to do it.
    I am not able to establish connection to database. Can anyone please give a step by step process to do this.

    If you really, really, really want to do this --- and by that I mean really get rid of everything in a dimension, create a dummy file with a single child.  That single child should have a name that could never exist in your system.  Something like "Forty-seven ginger headed sailors".  Then set the Dimension Build Settings Member Update to "Remove Unspecified".  Run the dim build -- it will clear out all of the dimension.
    Then take your other dim build rule file and use the same Remove Unspecified setting.  That will get rid of the silly member.  The source can be a file or SQL.
    Ta da, you have now cleared out the dim, added a single silly member, cleared out the dim again, and loaded the right members into it.
    There may be a better way to do the above, but I have done exactly that and it works.
    Regards,
    Cameron Lackpour

  • Problem building record set using Dreamweaver CS6 Cloud Product

    I am having a problem building a Results Page using Dreamweaver CS6.  I have followed all the steps described in Dreamweaver/Build Search and Results Page Article (multiple times).  It seems that when I save the Results page it does not copy the php used to build the dynamic table.  In fact when I view the source, I do not see any php code. 
    Additionally, when I attempt to bind the record set, it also does not accept the Default Value(s).  Enstead it gives me a list of all data in the colum(s) chosen for the record set (using Where..LIKE..variable definition).
    Any suggestions?
    Regards,
    Norv

    Yes, I will be glad to go through each step.  I will also provide code.
    Step 1:  Built the Search Page by adding Form into exisitng htm page.  Used Insert> Form>Form to insert Form area.  Then added three (3) text fields using Text Icon from the Form Menu Bar (Classic View).
    Step 2: Added a Submit and Reset Button to the Search Page.  Again used the Form Menu Bar to create the Buttons.
    Step 3: Selecte the <form> tag at bottom of Document Window to point Form to the Results Page (using the Action Box.
    Saved page and then began building the Results Page using an existing htm page.  Saved the Results Page as a .php document.
    Results Page:  Here are steps taken to build Results Page (Code will follow):
    1/ On the Results Page created a Recordset using the bindings dialog box.  Used the Advanced Recordset Dialog Box.  In the Advanced Dialog Box I used the Select and Where features to create a Recordset that created a 3 column table (records.County, records.ListPrice, records.PropertyType).  In the Variable box I created 3 variables (varCounty, varListPrice, varPropertyType).  varCounty and varPropertyType parameters are text (Type) and % (for Default Value).  varListPrice parameters are floating point (type) and % (for Default Value).  RunTime Value is $_REQUEST["ColumnName"].
    Here is the Code generated by Dreamweaver.  Note, I am not including the code to access the database, because in all tests I am able to access the table.  In fact first time I built the dynamic table, everything worked and I saw the Colum and default value.  Have never been able to duplicate that effort.  :-)
    Here is code:
    <?php
    if (!function_exists("GetSQLValuestring")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    if (PHP_VERSION<6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
    $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) :
    mysql_escape_string($theValue);
    switch ($theType) {
    case "text":
    $theValue = ($theValue != "") ? "". $theValue ."" : "NULL";
    break;
    case "long":
    case "int":
    $theValue = ($theValue != "") ? intval($theValue) : "NULL";
    break;
    case "double":
    $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
    break;
    case "date":
    $theValue = ($theValue != "") ? "".  $theValue ."" : "NULL";
    break;
    case "defined"
    $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
    break;
    return $theValue;
    $varCounty_rslistings = "%";
    if (isset($_GET["County"])) {
    $varCounty_rslistings = $_Get["County"];
    $varListPrice_rslistings = "%";
    if (isset($_GET["ListPrice"])) {
    $varListPrice_rslistings = $_GET["ListPrice"];
    $varPropertyType_rslistings = "%";
    if (isset($_GET["PropertyType"])); {
    $varPropertyType_rslistings = $_GET["PropertyType"];
    mysql_select_db($database_MyDB, $MyDB);
    $query_reslistings = sprintf("SELECT records.County, records.ListPrice, records.PropertyType FROM records WHERE records.County LIKE %s AND records.ListPrice LIKE %s AND records.PropertyType LIKE %s", GetSQLValueString($varCounty_rslistings, "text"),GetSQLValueString($varListPrice_rslistings,"double"),
    GetSQLValueString($varPropertyType_rslistings,"text"));
    $rslistings = mysql_query($query_rslistings, $MyDB) or die(mysql_error());
    $row_rslistings = mysql_fetch_assoc($rslistings);
    $totalRows_rslistings = mysql_num_rows($rslistings);
    ?>
    That's the code that was generated by Dreamweaver. 
    Thanks in advance for your assistance

  • Problem building applicatio​n using Report Generation Toolkit, LV 2011

    I'm using LabVIEW 2011 under Windows 7.
    I tried to use Application Builder to create an executable from a large body of code. One thing the application does is load VIs into a subpanel and run them.
    Application Builder created the executable and gave no error message. The built application ran except that it couldn't run any of the dynamic VIs.
    I finally succeeded in doing a screen grab on a transient dialog (about 1/10 sec. appearance). The dialog showed an attempt to load <vilib>:\Utility\NIReport.llb\NI_report.lvclass.
    In one dynamic VI I commented out the call to the only VI that uses the Report Generation Toolkit (called only from dynamic VIs, all of which call it). Sure enough, when I built the application with that change and ran it, the dynamic VI that didn't invoke the Report Generation Toolkit did successfully load into the subpanel and run.
    So, trying to prove to myself that that was the only problem, I wrote a VI that does nothing but load a VI into a subpanel and run it. User can choose one of two VIs: one that doesn't call the Report Generation Toolkit (or do much of anything), and one that does. Both VIs run fine standalone.
    The not-much-of-anything VI loaded and ran in the subpanel. The other VI didn't--the same dialog, mentioned above, popped up for 1/10 second or less. Screen grab is attached.
    When I included LVClass and NIReport.llb folders in the project (from vi.lib\Utility: Snapshot folders), and "Always Included" those folders (per a suggestion on this forum from a few years ago), the result was the same. The result was also the same when I included either one of those folders but not the other. Likewise it doesn't matter whether I add the dynamic VIs as "Always Included" or not.
    Another piece of information that may be pertinent: when adding the NIReport.llb folder, I got a message that it was impossible to add a certain VI that's part of some report-type class, because a VI of that name already existed in the project. Screenshot of that dialog is also attached.
    VIs and project file are also attached along with the two screenshots. I hardcoded VI paths, so put everything into C:\Testing if you want to see what the code does--or hack as desired, etc.
    I will be deeply grateful for any help! And I apologize in advance if there's already some exact or close-enough solution posted--but I doubt there is. I looked around.
    Thanks very much,
    mws
    Attachments:
    Test-App-Build.zip ‏336 KB

    Hi again,
    If you extract all files in the original zip attachment to a folder called C:\Testing on a Windows 7 machine running LV 2011, and then use the build script within the project file to build the application, you can run the application and see what happens. You can also play around with the build parameters, rebuild, run, and see what happens then. You can also open my VIs and see what I'm doing.
    The application lets you pick one of two dynamic VIs to run in a subpanel. One VI contains calls both to Report Generation VIs and some functions from the Advanced File Functions palette. The other VI does not.
    When you pick the first VI to load and run (the one with the Report Generation and Advanced File Functions calls), it loads into the subpanel but is not executable.
    When you pick the second VI to load and run, it does load into the subpanel and execute. So there's nothing wrong with the way I load and run a VI in the subpanel.
    In the development environment, the whole thing runs with no problems.
    Evidently the built application has problems resolving paths of something called by Report Generation VIs and by the Advanced File Functions I use.
    I've done a lot of experimenting and no luck. I've looked in forum archives, etc. etc., for possible solutions. I'm hoping there's some simple solution I've missed.
    Thanks very much for any help!

  • Problem with loading data using SQL LOADER

    I am having following files with me when i run following command at command prompt
    sqlldr scott/tiger@genuat control =c:\emp.ctl
    then giving error as
    SQL Loader 500: unable to open file
    SQL Loader 553: file not found
    emp.dat file data
    1111,sneha,CLERK     7902,17-Dec-80,800,20
    2222,manoj,SALESMAN,7698,20-Feb-72     ,1600,6500,30
    3333,sheela,MANAGER,7839,8-Apr-81,2975,20     
    emp.ctl file
    LOAD DATA
    INFILE 'c:\emp.dat'
    APPEND
    INTO TABLE emp
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    (EMPNO,
    ENAME ,
    JOB,
    MGR,
    HIREDATE,
    SAL ,
    COMM,
    DEPTNO)
    can anyone tell me what is problem in above file why data is not loaded in table??

    I don't find any problem if you invoke the SQLLDR using the below command(and if you are certain that the control file resides in the C: drive).
    sqlldr scott/tiger@genuat control =c:\emp.ctl
    If this doesn't work then invoke the SQLLDR from the C: prompt itself.
    sqlldr scott/tiger@genuat control=emp.ctl
    It would locate the control file and check whether the sqlldr completes successfully?

  • Problem building a trigger using a BLOB field in Oracle 10

    My case is the following,
    I'm trying to implement an AFTER trigger which uses the :new.blob_field to insert the new value in a table. Because of the documented AFTER restriction and :new use for blob fields, I've though to add other BEFORE trigger that calls a procedure in which I can store the :new value and later insert the temporary value in the table when the AFTER trigger is executed.
    The Idea is the following:
    BEFORE trigger :new -> TEMP
    and then
    AFTER trigger uses TEMP to store in the new table
    So, the final questions are the following:
    -Any other idea to do the same, that is, to use the ":new" value in an AFTER trigger?
    -How can I do this with the temp variable, is this correct?:
    PROCEDURE store_blob ( new_val BLOB ) IS
    BEGIN
    DBMS_LOB.CREATETEMPORARY(new_blob_temp,TRUE, DBMS_LOB.SESSION);
    -- fill with data
    DBMS_LOB.COPY (new_blob_temp,new_val,DBMS_LOB.GETLENGTH(new_val),1,1);
    END store_blob ;
    Because of the design of the application I have to use the AFTER trigger to store the new value so I must find a solution for this type of fields.
    Sorry for the size of the text and also for my english.
    Thanks in advance

    SQL> create or replace trigger trg1 after insert on test_blob for each row
      2  begin
      3  insert into test_blob2 values (:new.a);
      4  end;
      5  /
    Trigger created.
    SQL> insert into test_blob values ('123456789');
    1 row created.
    SQL> desc test_blob;
    Name                                      Null?    Type
    A                                                  BLOB
    SQL> desc test_blob2
    Name                                      Null?    Type
    A                                                  BLOB
    SQL>
    SQL> select dbms_lob.getlength(a) from  test_blob2;
    DBMS_LOB.GETLENGTH(A)
                        5

  • How to use SQL OVER and PARTITION BY in OBIEE Expression Builder??

    Hi there,
    I want to create a new logical coulmn with the following SQL query.
    SUM(Inventory Detail.Qty) OVER(PARTITION BY Inventory Detail.A,Inventory Detail.B,Item.C,Inventory Detail.D,MyDATE )/SUM(Inventory Detail.Qty) OVER(PARTITION BY Inventory Detail.A,Inventory Detail.B,Item.C )
    How to use the OVER and PARTITION BY in OBIEE Expression Builder??
    Thanks in Advance

    hi bipin,
    We cant use by in Expression builder(rpd) .But use the same formula like this in Fx of answers
    SUM(Inventory Detail.Qty) OVER(PARTITION BY Inventory Detail.A,Inventory Detail.B,Item.C,Inventory Detail.D,MyDATE )/SUM(Inventory Detail.Qty) >OVER(PARTITION BY Inventory Detail.A,Inventory Detail.B,Item.C )SUM(Inventory Detail.Qty by Detail,ITEM,Mydate)/SUM(qty by detail,item)
    First check the numerator whether it was giving correct results or not then go with denominator
    compare the results with sql that u have
    Let me know if that does work
    thanks,
    saichand.v
    Edited by: Saichand Varanasi on Jul 27, 2010 9:27 PM
    Edited by: Saichand Varanasi on Jul 27, 2010 9:28 PM

  • Problem occured when create a tree table for master-detail view objects using SQL queries?

    I am programming a tree table for master-detail view objects using SQL queries and these 2 view objects are not simple singel tables queries, and 2 complex SQL are prepared for master and view objects. see below:
    1. Master View object (key attribute is SourceBlock and some varaible bindings are used for this view object.)
    SELECT  cntr_list.SOURCE_BLOCK,                   
            sum(                   
             case when cntr_list.cntr_size_q = '20'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr20 ,                   
            sum(                   
             case when cntr_list.cntr_size_q = '40'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr40 ,                   
             sum(                   
             case when cntr_list.cntr_size_q = '45'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr45                    
    FROM (       
        SELECT yb1.BLOCK_M as SOURCE_BLOCK,       
               scn.CNTR_SIZE_Q,        
               count(scn.CNTR_SIZE_Q) AS cntr_qty        
        FROM  SHIFT_CMR scm, SHIFT_CNTR scn, YARD_BLOCK yb1, YARD_BLOCK yb2       
        WHERE       
        scm.cmr_n = scn.cmr_n             
        AND (scm.plan_start_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS')                 
        OR scm.plan_end_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS'))                 
        AND scm.shift_mode_c = :ShiftModeCode                           
        AND scm.end_terminal_c = :TerminalCode      
        AND scm.start_terminal_c = yb1.terminal_c                  
        AND scm.start_block_n = yb1.block_n                  
        AND substr(scn.start_location_c,(instr(scn.start_location_c,',',1,5)+1),instr(scn.start_location_c,',',1,6)-(instr(scn.start_location_c,',',1,5)+1)) BETWEEN yb1.slot_from_n AND yb1.slot_to_n                  
        AND scm.end_terminal_c = yb2.terminal_c                  
        AND scm.end_block_n = yb2.block_n                  
        AND substr(scn.end_location_c,(instr(scn.end_location_c,',',1,5)+1),instr(scn.end_location_c,',',1,6)-(instr(scn.end_location_c,',',1,5)+1)) BETWEEN yb2.slot_from_n AND yb2.slot_to_n           
        AND scn.status_c not in (1, 11)             
        AND scn.shift_type_c = 'V'             
        AND scn.source_c = 'S'       
        GROUP BY yb1.BLOCK_M, scn.CNTR_SIZE_Q       
    ) cntr_list       
    GROUP BY cntr_list.SOURCE_BLOCK
    2. Detail View object (key attributes are SourceBlock and EndBlock and same varaible bindings are used for this view object.)
    SELECT  cntr_list.SOURCE_BLOCK, cntr_list.END_BLOCK,                
            sum(                     
             case when cntr_list.cntr_size_q = '20'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr20 ,                     
            sum(                     
             case when cntr_list.cntr_size_q = '40'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr40 ,                     
             sum(                     
             case when cntr_list.cntr_size_q = '45'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr45                      
    FROM (         
        SELECT yb1.BLOCK_M as SOURCE_BLOCK,     
               yb2.BLOCK_M as END_BLOCK,  
               scn.CNTR_SIZE_Q,          
               count(scn.CNTR_SIZE_Q) AS cntr_qty          
        FROM  SHIFT_CMR scm, SHIFT_CNTR scn, YARD_BLOCK yb1, YARD_BLOCK yb2         
        WHERE         
        scm.cmr_n = scn.cmr_n               
        AND (scm.plan_start_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS')                   
        OR scm.plan_end_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS'))                   
        AND scm.shift_mode_c = :ShiftModeCode                             
        AND scm.end_terminal_c = :TerminalCode        
        AND scm.start_terminal_c = yb1.terminal_c                    
        AND scm.start_block_n = yb1.block_n                    
        AND substr(scn.start_location_c,(instr(scn.start_location_c,',',1,5)+1),instr(scn.start_location_c,',',1,6)-(instr(scn.start_location_c,',',1,5)+1)) BETWEEN yb1.slot_from_n AND yb1.slot_to_n                    
        AND scm.end_terminal_c = yb2.terminal_c                    
        AND scm.end_block_n = yb2.block_n                    
        AND substr(scn.end_location_c,(instr(scn.end_location_c,',',1,5)+1),instr(scn.end_location_c,',',1,6)-(instr(scn.end_location_c,',',1,5)+1)) BETWEEN yb2.slot_from_n AND yb2.slot_to_n             
        AND scn.status_c not in (1, 11)               
        AND scn.shift_type_c = 'V'               
        AND scn.source_c = 'S'         
        GROUP BY yb1.BLOCK_M, yb2.BLOCK_M, scn.CNTR_SIZE_Q         
    ) cntr_list         
    GROUP BY cntr_list.SOURCE_BLOCK, cntr_list.END_BLOCK
    3. I create a view link to create master-detail relationship for these 2 view objects.
    masterview.SourceBlock (1)->detailview.SourceBlock (*).
    4. I create a tree table using these 2 view objects with master-detail relationship.
    When I set default value for variable bindings of these 2 view objects and the matching records exist, tree table can work well. I can expand the master row to display detail row in UI.
    But I need to pass in dymamic parameter value for variable bindings of these 2 view objects, tree table cannnot work again. when I expand the master row and no detail row are displayed in UI.
    I am sure that I pass in correct parameter value for master/detail view objects and matching records exist.
    Managed Bean:
            DCIteratorBinding dc = (DCIteratorBinding)evaluteEL("#{bindings.MasterView1Iterator}");
            ViewObject vo = dc.getViewObject();
            System.out.println("Before MasterView1Iterator vo.getEstimatedRowCount()="+ vo.getEstimatedRowCount());
            System.out.println("Before MasterView1Iterator ShiftModeCode="+ vo.ensureVariableManager().getVariableValue("ShiftModeCode"));
            vo.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
            vo.ensureVariableManager().setVariableValue("DateTo", dateTo);
            vo.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
            vo.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
            vo.executeQuery();
            System.out.println("MasterView1Iterator vo.getEstimatedRowCount()="+ vo.getEstimatedRowCount());
            DCIteratorBinding dc1 = (DCIteratorBinding)evaluteEL("#{bindings.DetailView1Iterator}");
            ViewObject vo1 = dc1.getViewObject();
            System.out.println("Before DetailView1Iterator vo1.getEstimatedRowCount()="+ vo1.getEstimatedRowCount());
            System.out.println("Before DetailView1Iterator ShiftModeCode="+ vo1.ensureVariableManager().getVariableValue("ShiftModeCode"));
            vo1.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
            vo1.ensureVariableManager().setVariableValue("DateTo", dateTo);
            vo1.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
            vo1.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
            vo1.executeQuery();
            System.out.println("after DetailView1Iterator vo1.getEstimatedRowCount()="+ vo1.getEstimatedRowCount());
    5.  What's wrong in my implementation?  I don't have no problem to implement such a tree table if using simple master-detail tables view object, but now I have to use such 2 view objects using complex SQL for my requirement and variable bindings are necessary for detail view object although I also think a bit strange by myself.

    Hi Frank,
    Thank you and it can work.
    public void setLowHighSalaryRangeForDetailEmployeesAccessorViewObject(Number lowSalary,
                                                                              Number highSalary) {
            Row r = getCurrentRow();
            if (r != null) {
                RowSet rs = (RowSet)r.getAttribute("EmpView");
                if (rs != null) {
                    ViewObject accessorVO = rs.getViewObject();
                    accessorVO.setNamedWhereClauseParam("LowSalary", lowSalary);
                    accessorVO.setNamedWhereClauseParam("HighSalary", highSalary);
                executeQuery();
    but I have a quesiton in this way. in code snippet, it is first getting current row of current master VO to determine if update variables value of detail VO. in my case, current row is possibly null after executeQuery() of master VO and  I have to change current row manually like below.
    any idea?
                DCIteratorBinding dc = (DCIteratorBinding)ADFUtil.evaluateEL("#{bindings.SSForecastSourceBlockView1Iterator}");
                ViewObject vo = dc.getViewObject();           
                vo.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
                vo.ensureVariableManager().setVariableValue("DateTo", dateTo);
                vo.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
                vo.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
                vo.executeQuery();
                vo.setCurrentRowAtRangeIndex(0);
                ((SSForecastSourceBlockViewImpl)vo).synchornizeAccessorVOVariableValues();

  • PROBLEM BUILDING WSDL USING JDEV BPEL DESIGNER

    I have a WSDL that has been generated for MS SQLServer stored proc. I have created SOAP request using XML Spy and posted request to server succesfully.
    Imported the same WSDL and created Partner Link in BPEL process successfully but When i try to assign values to Input variable (XSD), I am getting Error : Problem Building Schema.
    Then I clicked on check box for details, it shows :
    Exception: Invalid reference: 'http://www.w3.org/2001/XMLSchema:schema'
    I appreciate any help in this.
    Thanks.
    Here WSDL file :
    <?xml version="1.0"?>
    <!-- edited with XMLSpy v2007 (http://www.altova.com) by Move (Move) -->
    <wsdl:definitions xmlns:tns="http://DWLV06ENG030/Deleteme/deleteme" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:sql="http://schemas.microsoft.com/SQLServer/2001/12/SOAP" xmlns:sqltypes="http://schemas.microsoft.com/SQLServer/2001/12/SOAP/types" xmlns:sqlmessage="http://schemas.microsoft.com/SQLServer/2001/12/SOAP/types/SqlMessage" xmlns:sqlresultstream="http://schemas.microsoft.com/SQLServer/2001/12/SOAP/types/SqlResultStream" name="deleteme" targetNamespace="http://DWLV06ENG030/Deleteme/deleteme">
         <wsdl:types>
              <xsd:schema targetNamespace="http://schemas.microsoft.com/SQLServer/2001/12/SOAP/types" elementFormDefault="qualified" attributeFormDefault="qualified">
                   <xsd:simpleType name="nonNegativeInteger">
                        <xsd:restriction base="xsd:int">
                             <xsd:minInclusive value="0"/>
                        </xsd:restriction>
                   </xsd:simpleType>
                   <xsd:attribute name="IsNested" type="xsd:boolean"/>
                   <xsd:complexType name="SqlRowSet">
                        <xsd:sequence>
                             <xsd:element ref="xsd:schema"/>
                             <xsd:any/>
                        </xsd:sequence>
                        <xsd:attribute ref="sqltypes:IsNested"/>
                   </xsd:complexType>
                   <xsd:complexType name="SqlXml" mixed="true">
                        <xsd:sequence>
                             <xsd:any/>
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:simpleType name="SqlResultCode">
                        <xsd:restriction base="xsd:int">
                             <xsd:minInclusive value="0"/>
                        </xsd:restriction>
                   </xsd:simpleType>
              </xsd:schema>
              <xsd:schema targetNamespace="http://schemas.microsoft.com/SQLServer/2001/12/SOAP/types/SqlMessage" elementFormDefault="qualified" attributeFormDefault="qualified">
                   <xsd:import namespace="http://schemas.microsoft.com/SQLServer/2001/12/SOAP/types"/>
                   <xsd:complexType name="SqlMessage">
                        <xsd:sequence minOccurs="1" maxOccurs="1">
                             <xsd:element name="Class" type="sqltypes:nonNegativeInteger"/>
                             <xsd:element name="LineNumber" type="sqltypes:nonNegativeInteger"/>
                             <xsd:element name="Message" type="xsd:string"/>
                             <xsd:element name="Number" type="sqltypes:nonNegativeInteger"/>
                             <xsd:element name="Procedure" type="xsd:string"/>
                             <xsd:element name="Server" type="xsd:string"/>
                             <xsd:element name="Source" type="xsd:string"/>
                             <xsd:element name="State" type="sqltypes:nonNegativeInteger"/>
                        </xsd:sequence>
                        <xsd:attribute ref="sqltypes:IsNested"/>
                   </xsd:complexType>
              </xsd:schema>
              <xsd:schema targetNamespace="http://schemas.microsoft.com/SQLServer/2001/12/SOAP/types/SqlResultStream" elementFormDefault="qualified" attributeFormDefault="qualified">
                   <xsd:import namespace="http://schemas.microsoft.com/SQLServer/2001/12/SOAP/types"/>
                   <xsd:import namespace="http://schemas.microsoft.com/SQLServer/2001/12/SOAP/types/SqlMessage"/>
                   <xsd:complexType name="SqlResultStream">
                        <xsd:choice minOccurs="1" maxOccurs="unbounded">
                             <xsd:element name="SqlRowSet" type="sqltypes:SqlRowSet"/>
                             <xsd:element name="SqlXml" type="sqltypes:SqlXml"/>
                             <xsd:element name="SqlMessage" type="sqlmessage:SqlMessage"/>
                             <xsd:element name="SqlResultCode" type="sqltypes:SqlResultCode"/>
                        </xsd:choice>
                   </xsd:complexType>
              </xsd:schema>
              <xsd:schema targetNamespace="http://DWLV06ENG030/Deleteme/deleteme" elementFormDefault="qualified" attributeFormDefault="qualified">
                   <xsd:import namespace="http://schemas.microsoft.com/SQLServer/2001/12/SOAP/types"/>
                   <xsd:import namespace="http://schemas.microsoft.com/SQLServer/2001/12/SOAP/types/SqlMessage"/>
                   <xsd:import namespace="http://schemas.microsoft.com/SQLServer/2001/12/SOAP/types/SqlResultStream"/>
                   <xsd:element name="sp_deleteme">
                        <xsd:complexType>
                             <xsd:sequence>
                                  <xsd:element minOccurs="0" maxOccurs="1" name="name" type="xsd:string" nillable="true"/>
                             </xsd:sequence>
                        </xsd:complexType>
                   </xsd:element>
                   <xsd:element name="sp_deletemeResponse">
                        <xsd:complexType>
                             <xsd:sequence>
                                  <xsd:element minOccurs="1" maxOccurs="1" name="sp_deletemeResult" type="sqlresultstream:SqlResultStream"/>
                             </xsd:sequence>
                        </xsd:complexType>
                   </xsd:element>
              </xsd:schema>
         </wsdl:types>
         <wsdl:message name="sp_deletemeIn">
              <wsdl:part name="parameters" element="tns:sp_deleteme"/>
         </wsdl:message>
         <wsdl:message name="sp_deletemeOut">
              <wsdl:part name="parameters" element="tns:sp_deletemeResponse"/>
         </wsdl:message>
         <wsdl:portType name="SXSPort">
              <wsdl:operation name="sp_deleteme">
                   <wsdl:input message="tns:sp_deletemeIn"/>
                   <wsdl:output message="tns:sp_deletemeOut"/>
              </wsdl:operation>
         </wsdl:portType>
         <wsdl:binding name="SXSBinding" type="tns:SXSPort">
              <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
              <wsdl:operation name="sp_deleteme">
                   <soap:operation soapAction="http://DWLV06ENG030/Deleteme/deleteme/sp_deleteme" style="document"/>
                   <wsdl:input>
                        <soap:body use="literal"/>
                   </wsdl:input>
                   <wsdl:output>
                        <soap:body use="literal"/>
                   </wsdl:output>
              </wsdl:operation>
         </wsdl:binding>
         <wsdl:service name="deleteme">
              <wsdl:port name="SXSPort" binding="tns:SXSBinding">
                   <soap:address location="http://DWLV06ENG030/Deleteme/deleteme"/>
              </wsdl:port>
         </wsdl:service>
    </wsdl:definitions>

    Hi,
    i tried a bit with your xsds in the wsdl. The only way to get jdeveloper work with the xsd is to put them in one file (see below). Another way is perhaps using 4 files with real imports and location attributes...
    Like you see, i had to change the xmlns:xsd to xmlns.
    <schema targetNamespace="http://schemas.microsoft.com/SQLServer/2001/12/SOAP/types"
    xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:this="http://schemas.microsoft.com/SQLServer/2001/12/SOAP/types"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified">
    <simpleType name="nonNegativeInteger">
    <restriction base="int"/>
    </simpleType>
    <attribute name="IsNested" type="boolean"/>
    <complexType name="SqlRowSet">
    <sequence>
    <element ref="schema"/>
    <any/>
    </sequence>
    <attribute ref="IsNested"/>
    </complexType>
    <complexType name="SqlXml" mixed="true">
    <sequence>
    <any/>
    </sequence>
    </complexType>
    <simpleType name="SqlResultCode">
    <restriction base="int"/>
    </simpleType>
    <complexType name="SqlMessage">
    <sequence minOccurs="1" maxOccurs="1">
    <element name="Class" type="this:nonNegativeInteger"/>
    <element name="LineNumber" type="this:nonNegativeInteger"/>
    <element name="Message" type="string"/>
    <element name="Number" type="this:nonNegativeInteger"/>
    <element name="Procedure" type="string"/>
    <element name="Server" type="string"/>
    <element name="Source" type="string"/>
    <element name="State" type="nonNegativeInteger"/>
    </sequence>
    <attribute ref="IsNested"/>
    </complexType>
    <complexType name="SqlResultStream">
    <choice minOccurs="1" maxOccurs="unbounded">
    <element name="SqlRowSet" type="this:SqlRowSet"/>
    <element name="SqlXml" type="this:SqlXml"/>
    <element name="SqlMessage" type="this:SqlMessage"/>
    <element name="SqlResultCode" type="this:SqlResultCode"/>
    </choice>
    </complexType>
    <element name="sp_deleteme">
    <complexType>
    <sequence>
    <element minOccurs="0" maxOccurs="1" name="name" type="string" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    <element name="sp_deletemeResponse">
    <complexType>
    <sequence>
    <element minOccurs="1" maxOccurs="1" name="sp_deletemeResult"
    type="this:SqlResultStream"/>
    </sequence>
    </complexType>
    </element>
    </schema>

  • Problem in deployment of ISA B2B after building the app using ant buildtool

    Hi
    I've a problem with building ISA B2B App after modification.
    I've ISAWAC640SP11 and ant buildtool to build the application.
    I've setup a customer project in NWDS.
    I've build the application using build tool but when i try to deploy it
    on SAP J2EE 6.4 using SDM i get a weird message stating
    <b>"com.sap.sdm.util.sduread.IllFormattedSduFileException: The archive must be deployed with a 6.20 SDM, which has a SDM-SDA compatible version 1 or greater."</b>
    Does anyone know what is the exact proecess to build the application in
    SAP J2EE 6.4.
    Do we have to use the ant build tool or we can directly build the app using NWDS
    default build process ?
    Also can some one suggest me to setup a customer project for extension and
    modification of ISA B2B 640 on NWDS and SAP J2EE 6.4....
    Thanks & Regards
    Sandeep Solanki

    Guys please help  !!!
    atleast gimme some idea or suggestions.. !!!
    Regards
    Sandeep

  • Dynamic Dimesion Building using SQL Interface

    I am attempting to use SQL Interface in Essbase 6.5 to dynamically build the account dimension from a PeopleSoft tree. The view works fine in SQL worksheet, but the last UNION statement does not work using the SQL interface. Here is the SQL that is generated: [SELECT * FROM ps_n_pre_acc_vw WHERE 1 = 1 order by 6,4,5,3] is generated. Here is the view:SELECT B.TREE_NODE AS PARENT , A.TREE_NODE AS CHILD , (A.TREE_NODE||' : '||C.DESCR) , b.tree_node_num AS num , a.tree_node_num AS c_tree_node_num , 'A' AS ord FROM SYSADM.PSTREENODE A , SYSADM.PSTREENODE B , SYSADM.PS_TREE_NODE_TBL C WHERE A.TREE_NAME = 'PRE_CUBE' AND A.SETID = 'NW' AND A.EFFDT = ( SELECT MAX(EFFDT) FROM PSTREELEAF WHERE TREE_NAME = 'PRE_CUBE') AND A.TREE_NAME = B.TREE_NAME AND A.SETID = B.SETID AND A.EFFDT = B.EFFDT AND A.PARENT_NODE_NUM = B.TREE_NODE_NUM AND A.TREE_NODE = C.TREE_NODE AND A.SETID = C.SETID AND C.EFF_STATUS = 'A' AND C.EFFDT = ( SELECT MAX(EFFDT) FROM SYSADM.PS_TREE_NODE_TBL X WHERE C.TREE_NODE = X.TREE_NODE AND C.SETID = X.SETID) UNION SELECT B.TREE_NODE AS PARENT , (A.RANGE_FROM||' : '||DESCR) AS child , A.RANGE_FROM , b.tree_node_num AS num , a.tree_node_num AS c_tree_node_num , 'B' AS ord FROM SYSADM.PSTREELEAF A , SYSADM.PSTREENODE B , SYSADM.PS_GL_ACCOUNT_TBL C WHERE A.TREE_NAME = 'PRE_CUBE' AND A.SETID = 'NW' AND A.EFFDT = ( SELECT MAX(EFFDT) FROM PSTREELEAF WHERE TREE_NAME = 'PRE_CUBE') AND A.TREE_NAME = B.TREE_NAME AND A.EFFDT = B.EFFDT AND A.SETID = B.SETID AND A.TREE_NODE_NUM = B.TREE_NODE_NUM AND C.SETID = A.SETID AND A.RANGE_FROM = C.ACCOUNT AND C.EFFDT = ( SELECT MAX(EFFDT) FROM SYSADM.PS_GL_ACCOUNT_TBL X WHERE C.ACCOUNT = X.ACCOUNT AND c.setid = x.setid) UNION SELECT B.TREE_NODE AS PARENT , (D.ACCOUNT||' : '||DESCR) AS child , D.ACCOUNT , b.tree_node_num AS num , a.tree_node_num AS c_tree_node_num , 'B' AS ord FROM pstreeleaf a , pstreenode b , PS_GL_ACCOUNT_TBL D WHERE a.tree_name = 'PRE_CUBE' AND a.effdt = '01-JAN-2001' AND A.SETID = 'NW' AND A.RANGE_FROM <> A.RANGE_TO AND A.TREE_NAME = B.TREE_NAME AND A.SETID = B.SETID AND A.EFFDT = B.EFFDT AND A.TREE_NODE_NUM = B.TREE_NODE_NUM AND D.ACCOUNT BETWEEN A.RANGE_FROM AND A.RANGE_TO AND D.SETID = 'NW' AND D.EFFDT = ( SELECT MAX(EFFDT) FROM PS_GL_ACCOUNT_TBL X WHERE D.ACCOUNT = X.ACCOUNT AND D.SETID = X.SETID)I created a view from the last union section of the SQL and Essbase returns a zero rows found error, although when I ran the view in SQL worksheet I was able to get rows returned. Any ideas on why the view does not return the expected results in Essbase?

    before your query do:
    <cfsavecontent
    variable="emailmessagebody"><cfinclude
    template="#mancbPath#/mancb_body.cfm"></cfsavecontent>
    then in your query instead of using '<cfinclude ...>'
    use
    '#emailmessagebody#'
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/

  • Problem using SQL Loader with ODI

    Hi,
    I am having problems using SQL Loader with ODI. I am trying to fill an oracle table with data from a txt file. At first I had used "File to SQL" LKM, but due to the size of the source txt file (700MB), I decided to use "File to Oracle (SQLLDR)" LKM.
    The error that appears in myFile.txt.log is: "SQL*Loader-101: Invalid argument for username/password"
    I think that the problem could be in the definition of the data server (Physical architecutre in topology), because I have left blank Host, user and password.
    Is this the problem? What host and user should I use? With "File to SQL" works fine living this blank, but takes to much time.
    Thanks in advance

    I tried to use your code, but I couldn´t make it work (I don´t know Jython). I think the problem could be with the use of quotes
    Here is what I wrote:
    import os
    retVal = os.system(r'sqlldr control=E:\Public\TXTODI\PROFITA2/Profita2Final.txt.ctl log=E:\Public\TXTODI\PROFITA2/Profita2Final.txt.log userid=MYUSER/myPassword @ mySID')
    if retVal == 1 or retVal > 2:
    raise 'SQLLDR failed. Please check the for details '
    And the error message is:
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 5, in ?
    SQLLDR failed. Please check the for details
         at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
         at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.h.y(h.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)

  • Building a report using "PL/SQL Dynamic Content" can I have it output PDF?

    Hi,
    I build several reports using the "PL/SQL Dynamic Content" region and htp.p().
    The output is exactly what the customer wants but they would now like to have it go into PDF document.
    Is there a way to do it?
    Bill

    Bill,
    You can integrate APEX with Oracle BI Publisher and have your report generated to PDF.
    If you're just interested in saving what is on a web page in PDF, have a look at CuteFTP (Windows), which is a free print driver that allows you to "print" to a PDF file as if it were a printer. On the Mac, you can save to PDF and do not need any additional software.
    Thanks,
    &#150; Scott &#150;
    http://spendolini.blogspot.com/
    http://sumnertech.com/

Maybe you are looking for