Output query using list with 4 columns

Hi Folks,
Is this possible so you end up with:
a          e          h
a          e          h
a          e          h   
b          f           h
b          f          h   
b          f          i
c          f          etc
c          f
c          f
d          f
d          f
d          g
Many thanks

Hi there,
You need to make your own loop!
Something that looks like this:
<!--- dummy query --->
<cfset myQuery = QueryNew(&quot;myCol&quot;)>
<cfset QueryAddRow(myQuery, 17)>
<cfset QuerySetCell(myQuery, &quot;myCol&quot;, &quot;a&quot;, 1)>
<cfset QuerySetCell(myQuery, &quot;myCol&quot;, &quot;b&quot;, 2)>
<cfset QuerySetCell(myQuery, &quot;myCol&quot;, &quot;c&quot;, 3)>
<cfset QuerySetCell(myQuery, &quot;myCol&quot;, &quot;d&quot;, 4)>
<cfset QuerySetCell(myQuery, &quot;myCol&quot;, &quot;e&quot;, 5)>
<cfset QuerySetCell(myQuery, &quot;myCol&quot;, &quot;f&quot;, 6)>
<cfset QuerySetCell(myQuery, &quot;myCol&quot;, &quot;g&quot;, 7)>
<cfset QuerySetCell(myQuery, &quot;myCol&quot;, &quot;h&quot;, 8)>
<cfset QuerySetCell(myQuery, &quot;myCol&quot;, &quot;i&quot;, 9)>
<cfset QuerySetCell(myQuery, &quot;myCol&quot;, &quot;j&quot;, 10)>
<cfset QuerySetCell(myQuery, &quot;myCol&quot;, &quot;k&quot;, 11)>
<cfset QuerySetCell(myQuery, &quot;myCol&quot;, &quot;l&quot;, 12)>
<cfset QuerySetCell(myQuery, &quot;myCol&quot;, &quot;m&quot;, 13)>
<cfset QuerySetCell(myQuery, &quot;myCol&quot;, &quot;n&quot;, 14)>
<cfset QuerySetCell(myQuery, &quot;myCol&quot;, &quot;o&quot;, 15)>
<cfset QuerySetCell(myQuery, &quot;myCol&quot;, &quot;p&quot;, 16)>
<cfset QuerySetCell(myQuery, &quot;myCol&quot;, &quot;q&quot;, 17)>
<cfset totalCols = 4>
<cfset totalRows = ceiling(myQuery.recordcount/totalCols)>
<table>
<cfoutput>
<cfloop index=&quot;rownr&quot; from=&quot;1&quot; to=&quot;#totalRows#&quot;>
<tr>
<cfloop index=&quot;colnr&quot; from=&quot;0&quot; to=&quot;#totalCols#&quot;>
<td>#myQuery[&apos;myCol&apos;][rownr+(colnr*totalRows)]#</td>
</cfloop>
</tr>
</cfloop>
</cfoutput>
</table>

Similar Messages

  • How to use unload query using JDBC with Informix database

    Hi friends,
    How can i use unload query using JDBC with Informix database?
    When i use it as "unload to 'abc.txt' select * from ........" it gives syntax error.I want to take the data of a table to a file.With dbaccess i can use it but i need to do it using jdbc.
    Thanks,
    Raneesh.

    To the best of my ability to tell, the right way to use this product from within Power Query would be to use its API. Unfortunately, we don't currently support either of the methods needed to be able to authenticate with the service (OAuth 2.0 and a relatively-custom
    digest-based method). Adding a mechanism to allow use of arbitrary OAuth-protected resources is a fairly high priority for us, and I hope we'll be able to deliver something before mid-2015.
    Scraping the website is very hard to do well -- both from an authentication and from a data discovery perspective.

  • Cannot use comparisons with column column references in pool and cluste

    Hi Experts,
    I  am facing an issue in a select statement written in 4.6 version and in that the table is a transparent table but when porting it to ECC6.0, it gives the follwing error:
    You cannot use comparisons with column column references in pool and cluster tables:'A~MATNR'. refe
    The select statement is as below:
    SELECT akschl alifnr amatnr aekorg awerks aesokz
             aknumh adatbi a~datab
             bmtart bmatkl
            b~yybcezndr " Commented as not required(IDE)
             cwerks cmmsta c~herkl
                INTO CORRESPONDING FIELDS OF TABLE  gt_a017
                FROM a017 AS a
               INNER JOIN mara AS b
                ON bmatnr = amatnr
                 INNER JOIN marc AS c
                   ON cmatnr = bmatnr
                  AND cwerks = awerks
                 INNER JOIN lfa1 AS d
                 ON dlifnr = alifnr
                WHERE a~kappl  = 'M'           AND
                      a~lifnr IN s_lifnr              AND
                      a~matnr IN s_matnr        AND
                      a~ekorg IN s_ekorg        AND
                     a~kschl  = v_kschl        AND
                      a~kschl  = gv_kschl       .
    Kindly help me out in this as A017 is a pooled table in ECC 6.0 . Thanks in advance!!!
    Thanks and Best Regards,
    Sahil

    Hi Sahil,
    Refer below code
    SELECT KSCHL LIFNR MATNR EKORG WERKS ESOKZ
           KNUMH DATBI DATAB
      FROM A017
      INTO IT_A017 " internal Table
      WHERE KAPPL = 'M' AND
            LIFNR IN S_LIFNR AND
            MATNR IN S_MATNR AND
            EKORG IN S_EKORG AND
    *         kschl = v_kschl AND
            KSCHL = GV_KSCHL .
      IF IT_A017[] IS NOT INITIAL.
        SELECT MATNR MTART MATKL
              FROM MARA
          INTO TABLE IT_MARA" internal Table
          FOR ALL ENTRIES IN IT_A017
          WHERE MATNR = IT_A017-MATNR.
        SELECT MATNR WERKS MMSTA HERKL
          FROM MARC
          INTO TABLE IT_MARC" internal Table
          FOR ALL ENTRIES IN IT_A017
          WHERE MATNR = IT_A017-MATNR AND
                WERKS = IT_A017-WERKS.
        SELECT LIFNR
          FROM LFA1
          INTO IT_LFA1" internal Table
          FOR ALL ENTRIES IN IT_A017
          WHERE LIFNR = IT_A017-LIFNR.
        ENDIF.
    After this use READ statement and fill the data in final internal table..
    Please search on SCN for more information about how to use FOR ALL ENTRIES..
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7
    ilesh Nandaniya

  • Caml query using managed metadata column

    hi,
     I am having a console appln, where i want  to pass the one paramater in the form of siteCol1:subsite1:subsite2  where  siteCol1:subsite1:subsite2 is the path of subsite which is in MMS.
    Can i pass this string paramter to the splist which contains a taxonomy column   and match this paramter in the listitemcollection and fetch only those recordw which matches this crirteria.
    and it should fetch the values which matches in a splist. the caml query it expects contains the taxonomy -managed metadata column - , but i am stuck with
    SPList splistLIST = parenttWeb.Lists.TryGetList("LIST1");
                          if ((splistLIST.Items.Count > 0 && splistLIST!= null))
                              SPQuery   objnodeQuery = new SPQuery();
                              objnodeQuery.Query =
                                  string.Format(
           "<OrderBy>" +
              "<FieldRef Name='ID' />" +
           "</OrderBy>" +
           "<Where>" +
              "<Eq>" +
                 "<FieldRef Name='myTaxonomy' />" +
                 "<Value Type='Text'>{0}</Value>" +
              "</Eq>" +
           "</Where>", _mcurrentPathTermSet);
                              SPListItemCollection nodeItemCollection = splistLIST1.GetItems(objnodeQuery);
    am not able to retrieve the listitems which passes this as a parameter and retrieve those records where it matches this taxonomy column.
    my doubt is, how to pass a string parameter to the splist contains taxonomy column and fetch those records

    Hi,
    Managed metada column does not supported in lookup column as the thread below:
    https://social.technet.microsoft.com/Forums/en-US/0dee5ba4-9648-445f-a774-8c59cf01b81c/confirmation-needed-cant-lookup-managed-metadata-field-with-lookup-column?forum=sharepointgeneralprevious
    If you prefer managed metadata in Search, then I'd suggest you find workaround to use managed metadata column in lookup column. You could use a workflow to copy the managed metadata column to a text field, make the text field to be hidded from the list if
    necessary. Then lookup this text field in other list.
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Where Used List with multiple/range of material

    Hi there Gurus!
    We have requirement to have multiple material on CS15(Where-used List Single-Level Material).
    IW13 won't work since there are spares/eqpmnt that has no PM Order yet.
    We are looking at developing SAP Query for this using but I am reluctant if this will work since it's from bottom going up.
    Has anyone tried this? Any tip/watchout?
    Your very valuable input is highly regarded and will be rewarded.
    Thanks a lot in advance!

    Hello Thyagarajan,
    Thanks for clarifying the requirement.
    Can only input one material in selection screen of CS15 and what we want is functionality to enable multiple material entry. Thanks!
    Hi Pete,
    Thanks for your input.
    When you copy CS15 and modify to enable multiple material entry, what other options did you consider before deciding on copying CS15? Does your other options include SAP Query? Do you think it will meet our reqmnt? Thanks!

  • Get Managed Metadata (Taxonomy) ALL Lists with Columns and ALL Choice Lists with Columns VALUES programmatically

    Hi there,
    How to get Managed Metadata Lists  ALL Columns and ALL Choice Lists Columns that are used in the Site Collection programmatically please.
    Regards

    Hi sharepointaju,
    Managed Metadata list is a hidden list, that you can access it through
    http://siteurl/Lists/TaxonomyHiddenList/AllItems.aspx, then it is similar to other lists, you can use server or client code to interate each field in the list, show the the value for each item.
    For all choice list columns, I'm not clear what you mean in this situation, do you mean to get all choice columns in the site collection, if so, iterate site columns, and lists to get list fields, check whether it is a choice type field.
    This may be not your requirement, please provide more information how you want to get which value.
    Thanks,
    Qiao Wei
    TechNet Community Support

  • How to make dynamic query using DBMS_SQL variable column names

    First of all i will show a working example of what i intend to do with "EXECUTE IMMEDIATE":
    (EXECUTE IMMEDIATE has 32654 Bytes limit, which isn't enough for me so i'm exploring other methods such as DBMS_SQL)
    -------------------------------------------------CODE-----------------------------------
    create or replace PROCEDURE get_dinamic_query_content
    (query_sql IN VARCHAR2, --any valid sql query ('SELECT name, age FROM table') 
    list_fields IN VARCHAR2) --list of the columns name belonging to the query (  arr_list(1):='name';   arr_list(2):='age';
    -- FOR k IN 1..arr_list.count LOOP
    -- list_fields := list_fields || '||content.'||arr_list(k)||'||'||'''~cs~'''; )
    AS
    sql_stmt varchar (30000);
    BEGIN
                   sql_stmt :=
    'DECLARE
         counter NUMBER:=0;     
    auxcontent VARCHAR2(30000);     
         CURSOR content_cursor IS '|| query_sql ||';
         content content_cursor%rowtype;     
         Begin
              open content_cursor;
              loop
                   fetch content_cursor into content;
                   exit when content_cursor%notfound;
                   begin                              
                        auxcontent := auxcontent || '||list_fields||';                    
                   end;
                   counter:=counter+1;     
              end loop;
              close content_cursor;
              htp.prn(auxcontent);
         END;';
    EXECUTE IMMEDIATE sql_stmt;
    END;
    -------------------------------------------------CODE-----------------------------------
    I'm attepting to use DBMS_SQL to perform similar instructions.
    Is it possible?

    Hi Pedro
    You need to use DBMS_SQL here because you don't know how many columns your query is going to have before runtime. There are functions in DBMS_SQL to get information about the columns in your query - all this does is get the name.
    SQL&gt; CREATE OR REPLACE PROCEDURE get_query_cols(query_in IN VARCHAR2) AS
    2 cur PLS_INTEGER;
    3 numcols NUMBER;
    4 col_desc_table dbms_sql.desc_tab;
    5 BEGIN
    6 cur := dbms_sql.open_cursor;
    7 dbms_sql.parse(cur
    8 ,query_in
    9 ,dbms_sql.native);
    10 dbms_sql.describe_columns(cur
    11 ,numcols
    12 ,col_desc_table);
    13 FOR ix IN col_desc_table.FIRST .. col_desc_table.LAST LOOP
    14 dbms_output.put_line('Column ' || ix || ' is ' ||
    15 col_desc_table(ix).col_name);
    16 END LOOP;
    17 dbms_sql.close_cursor(cur);
    18 END;
    19 /
    Procedure created.
    SQL&gt; exec get_query_cols('SELECT * FROM DUAL');
    Column 1 is DUMMY
    PL/SQL procedure successfully completed.
    SQL&gt; exec get_query_cols('SELECT table_name, num_rows FROM user_tables');
    Column 1 is TABLE_NAME
    Column 2 is NUM_ROWS
    PL/SQL procedure successfully completed.
    SQL&gt; exec get_query_cols('SELECT column_name, data_type, low_value, high_value FROM user_tab_cols');
    Column 1 is COLUMN_NAME
    Column 2 is DATA_TYPE
    Column 3 is LOW_VALUE
    Column 4 is HIGH_VALUE
    PL/SQL procedure successfully completed.I've just written this as a procedure that prints out the column names using dbms_output - I guess you're going to do something different with the result - maybe returning a collection, which you'll then parse through in Apex and print the output on the screen - this is just to illustrate the use of dbms_sql.
    best regards
    Andrew
    UK

  • BOM where-used list with Phantom item ( Special procurement ) - ALV grid

    Hi Gurus,
    I have a request with tcode CS15 when we use alv-grid.
    We have a component with phantom item indicator because we use the special procurement type 50.
    When we run the transaction we don't use the variable list but we use the alv-grid.
    I change the layout but we haven't the field "Special procurement" or "Phantom item" in the column set
    Thanks in advance
    Marco Ferrari

    dear friend
    you could build a query (t-code SQ01) and make visible any relevant fields.
    before run SQ02 and create an info-set based on a standard logical databse CMC.
    you even do not need an abaper. just try yourself. play in DEV system
    good luck.

  • Report Query using a Named Column Report Layout fails to produce PDF

    I am testing FOP and the Shared Component Report Queries query with a Named Column Report Layout. The xsl file was built using Stylus Studio and worked fine with the saved XML data file in Stylus Studio.
    500 Internal Server Error
    500 Internal Server Error
    Servlet error: An exception occurred.
    The current application deployment descriptors do not allow for including it in this response.
    Please consult the application log for details.
    I assume this is a message from FOP. What do I do now?
    tia,
    Sam

    Sam,
    I would suggest to take APEX out of the picture first and see if you can get this to work directly with your FOP solution, i.e. generate the XML data and take your XSL file and then post it directly to the FOP JSP (or whichever rendering engine you use). If this works, the problem might be somewhere in your APEX configuration. If it doesn't work, then the problem is likely in your XSL or XML structure. Here's how you can setup a static HTML page to post your XML and XSL to FOP:
    http://marcsewtz.blogspot.com/2008/06/heres-another-posting-on-pdf-printing.html
    Regards,
    Marc

  • Text query using a Multi Column datastore index slow

    I have created a text index using multi column datastore preference. I have specified two clob columns in my preference. Searching on this new index works, but it is slower than I expected.
    I have done the following comparison:
    My original two clob columns are: DocumentBody and DocumentFields. I have built an individual text index on each column. My new column with Multi Column index is DocumentBodyAndFields;
    I did two queries:
    1. search 'dog' on DocumentBody UNION search 'dog' on DocumentFields;
    2. search 'dog' on DocumentBodyAndFields;
    I would think the second search should be faster than the first one because it is a single query. But this is not the case. The second query is consistently slower than the first query by about 10-20%.
    Things are getting much worse when I search on preceding wildcards. If I search '%job', the multi column index is twice as slow as the first query! I am very confused by this result. Is this a bug?

    I am unable to reproduce the performance problem. In my tests, the search that uses the multicolumn_datastore performs better, as demonstrated below. Can you provide a similar test case that shows the table structure, datastore, index creations, and explain plan?
    SCOTT@orcl_11g> CREATE TABLE your_tab
      2    (DocumentId            NUMBER,
      3       DocumentBody            CLOB,
      4       DocumentFields            CLOB,
      5       DocumentBodyAndFields  VARCHAR2 (1))
      6  /
    Table created.
    SCOTT@orcl_11g> INSERT ALL
      2  INTO your_tab VALUES (-1, 'adog', 'bdog', NULL)
      3  INTO your_tab VALUES (-2, 'adog', 'whatever', NULL)
      4  INTO your_tab VALUES (-3, 'whatever', 'bdog', NULL)
      5  SELECT * FROM DUAL
      6  /
    3 rows created.
    SCOTT@orcl_11g> INSERT INTO your_tab
      2  SELECT object_id, object_name, object_name, NULL
      3  FROM   all_objects
      4  /
    69063 rows created.
    SCOTT@orcl_11g> BEGIN
      2    CTX_DDL.CREATE_PREFERENCE
      3        ('your_datastore', 'MULTI_COLUMN_DATASTORE');
      4    CTX_DDL.SET_ATTRIBUTE
      5        ('your_datastore', 'COLUMNS', 'DocumentBody, DocumentFields');
      6  END;
      7  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> CREATE INDEX your_idx1 ON your_tab (DocumentBody)
      2  INDEXTYPE IS CTXSYS.CONTEXT
      3  /
    Index created.
    SCOTT@orcl_11g> CREATE INDEX your_idx2 ON your_tab (DocumentFields)
      2  INDEXTYPE IS CTXSYS.CONTEXT
      3  /
    Index created.
    SCOTT@orcl_11g> CREATE INDEX your_idx3 ON your_tab (DocumentBodyAndFields)
      2  INDEXTYPE IS CTXSYS.CONTEXT
      3  PARAMETERS ('DATASTORE your_datastore')
      4  /
    Index created.
    SCOTT@orcl_11g> EXEC DBMS_STATS.GATHER_TABLE_STATS (USER, 'YOUR_TAB')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> SET TIMING ON
    SCOTT@orcl_11g> SET AUTOTRACE ON EXPLAIN
    SCOTT@orcl_11g> SELECT DocumentId FROM your_tab
      2  WHERE  CONTAINS (DocumentBody, '%dog') > 0
      3  UNION
      4  SELECT DocumentId FROM your_tab
      5  WHERE  CONTAINS (DocumentFields, '%dog') > 0
      6  /
    DOCUMENTID
            -3
            -2
            -1
    Elapsed: 00:00:00.65
    Execution Plan
    Plan hash value: 4118340734
    | Id  | Operation                     | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT              |           |     4 |   576 |     2 (100)| 00:00:01 |
    |   1 |  SORT UNIQUE                  |           |     4 |   576 |     2 (100)| 00:00:01 |
    |   2 |   UNION-ALL                   |           |       |       |            |          |
    |   3 |    TABLE ACCESS BY INDEX ROWID| YOUR_TAB  |     2 |   288 |     0   (0)| 00:00:01 |
    |*  4 |     DOMAIN INDEX              | YOUR_IDX1 |       |       |     0   (0)| 00:00:01 |
    |   5 |    TABLE ACCESS BY INDEX ROWID| YOUR_TAB  |     2 |   288 |     0   (0)| 00:00:01 |
    |*  6 |     DOMAIN INDEX              | YOUR_IDX2 |       |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       4 - access("CTXSYS"."CONTAINS"("DOCUMENTBODY",'%dog')>0)
       6 - access("CTXSYS"."CONTAINS"("DOCUMENTFIELDS",'%dog')>0)
    SCOTT@orcl_11g> SELECT DocumentId FROM your_tab
      2  WHERE  CONTAINS (DocumentBodyAndFields, '%dog') > 0
      3  /
    DOCUMENTID
            -1
            -2
            -3
    Elapsed: 00:00:00.28
    Execution Plan
    Plan hash value: 65113709
    | Id  | Operation                   | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |           |     4 |    76 |     0   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| YOUR_TAB  |     4 |    76 |     0   (0)| 00:00:01 |
    |*  2 |   DOMAIN INDEX              | YOUR_IDX3 |       |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("CTXSYS"."CONTAINS"("DOCUMENTBODYANDFIELDS",'%dog')>0)
    SCOTT@orcl_11g>

  • Search Results web part - Custom Query using "Value with a parameter from URL" inconsistent

    I have encountered what I think may be a bug, but I am hoping that there is something that I am missing.
    Within my search site, I have created a new search results page where I want to customize the "Search Results" web part query.  I can add in any number of property and keyword filters (using the "Build Your Query" dialog) without
    issue... until I add a filter that uses the QueryString property (the builder dialog calls this "Value with a parameter from URL").
    If I use {QueryString.MyParameterX} for filtering, it works beautifully in the query builder dialog.  I see the expected results in the search results preview pane, but as soon as I apply the changes things become inconsistent. 
    If I close/reopen my browser and navigate to my page at http://myaddress/search/Pages/testresults.aspx?MyParameterX=test I see results.  If I then refresh the page, I get a "Nothing here matches your search" message.  I can then go to
    the same address but change one character to an uppercase character and get results.  Refreshing that same page again returns "Nothing here matches your search".  I can only get search results one time per uniquely cased URL without having
    to close/reopen my browser.  This behavior was seen on both Firefox and IE.
    Finally, I found that if I instead navigate to http://myaddress/search/testresults?MyParameterX=test, it always returns results.  This, unfortunately isn't the best solution for me... but it is a solution.
    Any insight that anyone can provide is greatly appreciated!  I would really like to be able to depend on this working in all logical cases (especially since the search center of other sites is set using the path all the way down to /Pages).
    Thanks!

    Hi, have you been able to solve this issue? I'm getting the same issue and I cant solve it (required CU is installed).
    Fabio

  • How to pass multiple parameters to Query using START WITH, CONNECT BY OBIEE

    Hi
    I have following oracle query which need to be used as a Data Source in OBIEE Physical Layer. I guess I have to create stored proc. How do I implement this in OBIEE RPD and how do I implement the respective Dashboard prompts for the parameters.
    SELECT
    CIRC.PATH_NAME, CIRC.BANDWIDTH , CIRC.CATEGORY, CIRC.CUSTOMER_ID,
    CIRC.STATUS, CIRC.CUSTOMER_NAME,
    QUER.LEV
    FROM
    CIRCUIT_PATH circ, VAL_CUSTOMER cust,
    ( SELECT
    DISTINCT CIRC_PATH_INST_ID, LEVEL LEV
    FROM
    CIRC_PATH_ELEMENT
    START WITH
    CIRC_PATH_ELEMENT.CIRC_PATH_INST_ID IN ( SELECT
    DISTINCT CIRC_PATH_INST_ID
    FROM
    PORTS a
    WHERE SITE_NAME = @variable('Enter a Site Name')
    AND CARD_SLOT = @variable('Enter a Card Slot')
    CONNECT BY
    PRIOR CIRC_PATH_ELEMENT.CIRC_PATH_INST_ID =
    CIRC_PATH_ELEMENT.PATH_INST_ID
    AND ELEMENT_TYPE != 'K' ) QUER
    WHERE
    circ.circ_path_inst_id = QUER.CIRC_PATH_INST_ID
    and circ.cust_inst_id = cust.cust_inst_id (+)
    ORDER BY
    LEV DESC , CIRC.PATH_NAME ASC, CIRC.BANDWIDTH ASC
    Thanks
    DG

    Hi John
    Thanks. I looked at your URL. I do have package. Just using procedure. So my initialization string (For stored proc in Physical Layer of RPD) is
    exec demo.add_employee(VALUEOF(NQ_SESSION.empid1));
    But when I run request in Answer I get the error
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 900, message: ORA-00900: invalid SQL statement at OCI call OCIStmtExecute: exec demo.add_employee(105); . [nQSError: 17011] SQL statement execution failed. (HY000)
    What should I put in initialization string in RPD?
    Thanks
    DG

  • Building a recursive query using start with/connect by......

    Hi.
    I have data in a table which looks like:
    Top level     Step     3rd Level     4th Level Script Name
    NORMAL_DAY     Step 1 of NORMAL_DAY     DATE_FEEDER     Step 1 of DATE_FEEDER      INT_EOD_DATE_FEEDER
    NORMAL_DAY     Step 2 of NORMAL_DAY     EOD_FX_RATE_UPLOAD Step 3 of EOD_FX_RATE_UPLOAD SEND_MAIL_FXSPOTS
    NORMAL_DAY     Step 2 of NORMAL_DAY     EOD_FX_RATE_UPLOAD Step 2 of EOD_FX_RATE_UPLOAD FXSPOTS
    NORMAL_DAY     Step 2 of NORMAL_DAY     EOD_FX_RATE_UPLOAD Step 1 of EOD_FX_RATE_UPLOAD FX_FTPS_GET_EOD
    NORMAL_DAY     Step 3 of NORMAL_DAY     CALENDAR_UPLOAD     Step 1 of CALENDAR_UPLOAD     CALENDAR
    NORMAL_DAY     Step 3 of NORMAL_DAY     CALENDAR_UPLOAD      Step 2 of CALENDAR_UPLOAD     MDS_STOP
    NORMAL_DAY     Step 3 of NORMAL_DAY     CALENDAR_UPLOAD     Step 3 of CALENDAR_UPLOAD     MDS_HOLIDAY
    NORMAL_DAY     Step 3 of NORMAL_DAY     CALENDAR_UPLOAD     Step 4 of CALENDAR_UPLOAD     MDS_START
    NORMAL_DAY     Step 4 of NORMAL_DAY     FA_VALUATIONS     Step 1 of FA_VALUATIONS     IMPORTMTM
    NORMAL_DAY     Step 4 of NORMAL_DAY     FA_VALUATIONS     Step 2 of FA_VALUATIONS     INT_EOD_VALUATIONS
    As you can see, it lends itself to a tree type structure. I am trying to display this information using the start with/connect by clauses.....
    My initial query looks like:
    select main.name "Top Level",
    level2.name "Step",
    level3.name "3rd Level",
    level4.name "4th Level",
    level5.name "Script Name",
    level5.run_start,
    level5.run_end,
    (level5.run_end - level5.run_start) "Time difference",
    to_char((level5.run_end - level5.run_start),'99999999999999999999999999990.0000000000')*1000 as Total_Run_Time
    from jcs_jobs main,
    jcs_jobs level2,
    jcs_jobs level3,
    jcs_jobs level4,
    jcs_jobs level5
    where main.name = 'NORMAL_DAY'
    and main.PARENT_JOB_ID IS NULL
    and main.job_id = 2253800
    and main.job_id = level2.parent_job_id
    and level2.job_id = level3.parent_job_id
    and level3.job_id = level4.parent_job_id
    and level4.job_id = level5.parent_job_id
    order by level2.step_name;
    This is a bit restrictive, so I need to make it more generic, because we can actually have more than 5 levels of depth.....
    I haven't included the time element in the sample data. This also appears to be another conundrum.....how to display milliseconds in a reasonable date format?
    Thank you very much in advance!
    Dev

    try this way:
    SQL> select script_name, job,
      2         to_char(to_date(run_start,'Jhh24miss'),'dd-mon-yyyy hh24:mi:ss') run_start,
      3         to_char(to_date(run_end,'Jhh24miss'),'dd-mon-yyyy hh24:mi:ss') run_end,
      4         (to_date(run_end,'Jhh24miss')
      5                  - to_date(
      6                        substr(root_start,
      7                               2,
      8                               decode(instr(root_start,'/',1,2),
      9                                      0,
    10                                      length(root_start)+1,
    11                                      instr(root_start,'/',1,2)
    12                                      )-2
    13                               )
    14                            ,'Jhh24miss')
    15          ) "Time difference"
    16  from (
    17  select name script_name, lpad(' ',2*level,' ')||job_id job
    18         ,to_char(run_start,'Jhh24miss') run_start, to_char(run_end,'Jhh24miss') run_end,
    19         sys_connect_by_path(to_char(run_start,'Jhh24miss'),'/') root_start
    20  from jcs_jobs
    21  where name = 'NORMAL_DAY'
    22  connect by prior job_id = parent_job_id
    23  start with PARENT_JOB_ID IS NULL and job_id = 2253800
    24  );
    SCRIPT_NAM JOB                  RUN_START            RUN_END              Time difference
    NORMAL_DAY   2253800            23-jan-2010 15:30:16 27-jan-2010 01:06:16             3,4
    NORMAL_DAY     2253801          27-jan-2010 01:06:16 28-jan-2010 15:30:16               5Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2010/01/23/la-forza-del-foglio-di-calcolo-in-una-query-la-clausola-model/]

  • Xpath query using ANE with AIR3.9 for iOS app

    we are building an app for iOS using AIR 3.9 where we have to load and parse the xml document so that we can read the images path and download the stuff on iOS device. To fix this issue we have found a solution using XCode via ANE where by using XPath Query classes such as "PerformXPathQuery", "PerformXMLXPathQuery", "xmlReadMemory" etc. The code is running well when build on simulator itself on mac machine. But when we are packaging the ANE with AIR 3.9, it gives us the error which says that:-
    Error occurred while packaging the application:
    Undefined symbols for architecture armv7:
      "_xmlReadMemory", referenced from:
          _PerformXMLXPathQuery in libnet.example.download.a(ExampleLib.o)
    ld: symbol(s) not found for architecture armv7
    Compilation failed while executing : ld64
    I have tried linking binary with libraries like "libxml2.dylib", "libxml2.2.dylib" and libz.dylib + added the libXML header files to the header search path in the build properties, but got no help.
    our AIR 3.9 platform xml looks like:-
    <platform xmlns="http://ns.adobe.com/air/extension/3.9">
        <sdkVersion>4.0.0</sdkVersion>
        <linkerOptions>
            <option>-ios_version_min 4.2</option>
            <option>-framework UIKit</option>
            <option>-framework Foundation</option>
            <option>-framework CoreText</option>
        </linkerOptions>
    </platform>
    can anyone suggest where we are going wrong!
    thanks in advance

    Found the solution, i was missing the framework related to xPath library in platform.xml
    follow the instuctions from the below link:-
    http://forums.adobe.com/thread/1037904
    thanks adobe team

  • I want to display output by using shift with a single variable?

    hi,
    i am shabeer ahmed abap fresher i want
    ex:-
       data: st1 value 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z'.
       do 27 times.
       split st1 at  ','  into sy-index.
       write:/ sy-index.
       enddo. 
    i want output like: a
                               b
                               c
                               z.
    then the above code will not becoz sy-index  in int type. but i want output like as displayed as above. what can i do plz  suggest.

    hi,
    shabeer ahmed
    Try this code, it will work and gives u solution
    data : Begin of itab occurs 0,
              char(10) type c.
    data : string type string.
    data : st1 type strng.
    st1 =  'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z'.
    move st1 to string.
    split string at ',' into table itab.
    loop at itab.
    write :/ itab-char.
    endloop.
    with regards
    Kiran.G

Maybe you are looking for

  • Problems in using a certificate with  different versions of JVM

    Hi friends, I am facing a typical problem: I have to use a certificate which uses the sha1DSA signing algorithm to contact a web service(I am coding a client). I was using J2SDK_1.4.1_02 before. I added the certificate to keystore and it was working

  • Email Alert on a Successful message in PO/PI 7.4 system

    Hi All, I am looking to send an email alert on successful delivery of my message from PI/PO system. I am running on a single-stack Java stack system. My scenario is from a Flat File to IDOC creation in ECC. As soon as all the IDOCs are created in ECC

  • 8120 Media Sync - "Your device is not recognized by Blackberry Media Sync"

    I got a new (refurbished from ebay) Pearl 8120.  I just downloaded the newest Desktop Manager and Media Sync software.  The Desktop Manager  works fine with the Pearl.  The 8GB microSDHC card was formatted and has worked fine in the phone so far.  Ho

  • Designer8..The Send Email button function gives an Error

    I created a name and address form and a dropdown combo in AA9 then saved and closed it. I then opened it in designer 8 and placed a "send by Email" button and closed it. I then opened the pdf file in Reader 9 (as a user would) Then filled out the for

  • Ext prog check errors

    in my program,   TRANSLATE p_letter TO UPPER CASE. and I am getting Ext Prog Check errors: Dangerous use of TRANSLATE in a multilingual system             (The message can be hidden with "#EC TRANSLANG or "#EC SYNTCHAR) How can I avoid this error wit