Build/call Query URL with selections using JavaScript???

I have created a web query to list specific materials and each row has a checkbox for the user to select which materials they would like to work with.  Once they push the "Submit" button I have collected the materials they selected into a Javascript array. 
I would now like to call a different query with the materials selected as a filter.  Can anyone show me how to build an URL to call the query and use the materials as a filter?  There could be 10 or 20 selected materials...
Thanks for any direction you can provide!

Hi,
the form should look like this:
<form action="<SAP_BW_URL>" method="post">
<input type="hidden" name="CMD" value="LDOC"/>
<input type="hidden" name="QUERY" value="yourQueryname"/>
<input type="hidden" name="INFOCUBE" value="yourInfoCubename"/>
<input type="hidden" name="FILTER_IOBJNM" value="0MATERIAL"/>
<input type="checkbox" name="FILTER_VALUE_1" value="Mat1"/>
<input type="checkbox" name="FILTER_VALUE_2" value="Mat2"/>
<input type="checkbox" name="FILTER_VALUE_N" value="MatN"/>
<input type="submit" value=" Submit "/>
</form>
form Method has to be post because of url length restriction!
Heike

Similar Messages

  • How to call java function with parameter from javascript in adf mobile?

    how to call java function with parameter from javascript in adf mobile?

    The ADF Mobile Container Utilities API may be used from JavaScript or Java.
    Application Container APIs - 11g Release 2 (11.1.2.4.0)

  • How do you rotate a selection using Javascript?

    I am trying to find a simple script on how to rotate a selection using javascript within InDesign CS3. Any ideas!?
    Thanks in Advance!

    Hey!
    Yeah, you can!
    app.activeWindow.transformReferencePoint = AnchorPoint.CENTER_ANCHOR
    or you can check my InDesign Scripting Snippets blog
    http://indisnip.wordpress.com/2010/07/24/rotate-single-selected-object/
    where I explained how it works.
    tomaxxi

  • Call a URL which is a Javascript

    Hi All.
    I know we CANNOT call javascript in Web dynpro abap.
    I also know we can call a URL via calling external window and passing the URL.
    We needed a functionality which requires a small piece of javascript code to be executed on click of any button. I have placed a javascript code in the portal server.
    I was wondering if there could be a way to call a URL WITHOUT the external window - this would mean that I call my javascript URL whenever I want.
    Thanks in adv for your patience.

    >
    kanki kovana wrote:
    > Hmm, have to find other forum where i could say my honest opinion then...
    > Customers pays quite a lot of  using SAP products...Somebody have to speak up sometimes
    > It is not any personal!
    > Back to issue then. How i open another web page via office control?
    > "Use OfficeControl or InteractiveForm for Office and PDF documents"
    > KK
    Did I ever say you can't express your opinion?  I said you must remain civil. Saying that SAP doesn't have "common sence" is not being civil.  You can claim that there is no use of Adobe PDF online (which I don't agree with at all), but don't insult our developers/product designers.
    Who said you should be able to open another web page via office control.  As stated in the help OfficeControl is for opening Office documents.  InteractiveForm is for opening PDF documents.  We never said anything about opening just any web page via these UI elements.  We are just stating that if you have office or PDF documents you don't use the iFrame to open them - you should use their respective UI elements.
    If you want to open another web page, the recommended solution is another iView within a Portal or NetWeaver Business Client page. This way the two technologies are clear separated and there is less expectation that all parts should meet the same standards for theming, accessibility, personalization, etc. You can still communicate events between the two iViews using Portal eventing if necessary.

  • Browser Selection using Javascript

    Hi All,
    I am using a multi select ibrowser for a query data set.I am calling a function on selection of that item on browser. But on page load I need to take default as first row of that browser and need to call the function related to that. But i am willing to keep that row showing as selected on browser. Is there anyway i can do that using javascript....?
    There is one more button on the same screen which says 'Show for next Row' like that sort. On clicking that button I need to unselect the earlier one and need to select the next row of that browser and call the same browser select function.
    I didn't get any applet method for selecting a browser row using javascript.
    Any ideas will be appreciated....
    Regards,
    Satish

    Hi Satish,
    You can use this method to display an item by default as the ist row of ibrowser on page load .
    document.Appletname.getBrowserObject().setDefaultItem(variable_name);
    To select next row of an ibrowser after click 'Show for next Row' button, you can use this method:
    var vVariable = document.Appletname.getBrowserObject().getItemAt(int itemNo);
    document.Appletname.getBrowserObject().setDefaultItem(vVariable );
    Just try this out.This may work.

  • Call an URL with ABAP program (Method POST)

    Hi everyone,
      I need to call an URL for example "www.google.com?q=hello" with ABAP using POST method.
      Like the FM "Call_Browser", but my variable q=hello need to be passed with POST method.
    Any idea ?
    Thanks.

    here is one example I use from abap to call a web browser ITS solution with a project number, I guess you can adapt the it for your purpose?
          check <data>-pspid is not initial.
          concatenate gv_pfs_link
                      'zpfs2?~okcode=PROJ_SEL&zpspid=<###>&sel_action=X'
          into lv_url.
          replace '<###>' with <data>-pspid into lv_url.
          condense lv_url no-gaps.
          cl_gui_frontend_services=>execute(
            exporting document = lv_url ).

  • ABAP WebDynpro: Call a URL with POST-parameters?

    Hi all,
    I want to call a URL from an ABAP WD method with additional data. I know that this is simply possible via the Window Manager, passing a URL. Adding additional parameters inside the URL is of course also possible using "&" and "?" separators.
    Is it somehow possible to call such a URL out of WebDynpro with additional POST data (e.g. an XML datastream)?
    Best regards.
    Alexander

    Hi Alex.,
    As u said that u know how to call URL and pass parameters using window manager., and i am not sure about XML data stream.!!
    I can advise u to post ur thread here: [Web Dynpro ABAP Forum|Web Dynpro ABAP;
    U will get some useful inputs..
    Thanks & Regards
    Kiran

  • Calling a VI as ActiveXObject using Javascript

    Hello,
    I would like to control a Labview-VI (Version 7.1) from a Javascript-program by using the ActiveXObject-model.
    It looks like that:
        lvapp = new ActiveXObject("Labview.Application");
        viPath = "C:\\test.vi";
        vi = lvapp.GetVIReference(viPath);   // Load the vi into memory
        vi.FPWinOpen = 1;                               // Open front panel
        var paramNames = new Array(["Input","Output"]);   // create array with parameter names
        var paramVals  =     new Array([125,0]);                       // create array with parameter values
        vi.Call(paramNames, paramVals);    // call Labview  --> error occurs here
        alert("Result from LV:"+paramVals[1]);
    Starting Labview and loading the VI works fine. The scripts stops during the "Call"-methode.
    Problem is, that an error occurs which indicates that VI-object does not unterstand
    the Javascript array structure ("expected 1D-array"). If I call theVI without parameters everything
    works fine, but this makes no sense since I cant exchange data with LV.
    The same programm coded in VisualBasic-Script worked fine also.
    Is there anyone who knows of which type parameters for "Call"-mehode must look like in
    Javascript?? Every hint is welcome.
    Regards

    Sorry, this replay was submitted befored finished...
    Hi Brian
    That was the hint I looked for:
      > The only other thing you could do would be to use the SetControlValue/GetControlValue to do the I/O one control at a time.
    Since I stranded to create the mentioned SAFEARRAY of VARIANTs I tried it with the following way:
       lvapp = new ActiveXObject("Labview.Application");
        viPath = "C:\\test.vi";
        vi = lvapp.GetVIReference(viPath);   // Load the vi into memory
        vi.FPWinOpen = 1;                               // Open front panel
        vi.SetControlvalue("Input",125)       // set the input parameter, 125 is just a sample
        vi.Run();                                               // run the VI here, the"Call"-methode without parameter does not work since it uses
                                                                      // the defaults of the controls
        var paramNames = new Array(["Input","Output"]);   // create array with parameter names
        var paramVals  =     new Array([125,0]);                       // create array with parameter values
        vi.Call(paramNames, paramVals);    // call Labview  --> error occurs here
        alert("Result from LV:"+paramVals[1]);

  • Calling Amazon URL with XML response

    Hello,
    I would like to call a specific amazon-services via http://webservices.amazon.de/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=myAC&AssociateTag=associateTag-21&ItemId=9783836212007&ResponseGroup=Large&Operation=ItemLookup but this is not a web service (I think).
    Could someone tell me have to call the URL and how I can handle the response? With a web service or bapi it wouldnu2019t be a problem but I donu2019t know to handle thisu2026
    I will try it out with CL_HTTP_CLIENT (hint of Thomas Jung). But did this someone before and how to handle the respone XML?
    Can someone help me out with this?
    Thx, Vanessa

    you can consume this either using SOAP protocol of using REST approach (CL_HTTP_CLIENT)
    on how to consume this using CL_HTTP_CLIENT, just do a where used list of this class in your system or search here in the forum, you will find lot of examples.
    more on this how to construct the url for this can be found at
    http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?rest-signature.html
    once you consume this and get the xml result, you can either parse it using XSLT program or if you are not comfortable you can use FM SMUM_XML_PARSE to parse the XML
    Hope this helps.
    Regards
    Raja

  • Build dynamic query depending upon selection of table and columns

    Hi ,
    I want your views on following requirement :
    we r doing generic export to excel functionality .
    1.User will select multiple tables and according to tables ,columns on that table will select
    2.There can be multiple table
    3.depending upon column and table selection , we have to build dynamic query and execute .
    Please let me know is it possible .If yes then please tell me how to do above requirement.
    Thanks in advance

    Hi,
    Identifiers cannot be used as bind variables, query are parsed
    before evaluate bind variables. Identifiers like table name.
    For excel you can use some like this:
    SET MARKUP HTML ON ENTMAP ON SPOOL ON PREFORMAT OFF
    SPOOL test_xls.xls
    SELECT colum1||chr(9)||columN FROM tableName;
    or CSV:
    SELECT colum1|| ',' ||columN FROM tableName;
    SPOOL OFF
    SET MARKUP HTML OFF ENTMAP OFF SPOOL OFF PREFORMAT ON
    For construct the query i suggest to read "Dynamic SQL Statements":
    http://www.java2s.com/Tutorial/Oracle/0440__PL-SQL-Statements/0300__Dynamic-SQL.htm
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/dynamic.htm
    http://docs.oracle.com/cd/B10500_01/appdev.920/a96590/adg09dyn.htm
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:227413938857
    --sgc                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Calling external URL with POST data

    Hi:
    In my action bean I have to call and external URL (outside my domain), and along with this URL 'POST' data. I have tried the following code:
    try {
    FacesContext lclFC = FacesContext.getCurrentInstance().getFacesContext();
    lclFC.getExternalContext().getRequestMap().put("x_loc_zip","94804");
    lclFC.getExternalContext().redirect("http://www.mysite.com/personals/search/search.html");
    } catch (IOException e) {
    throw new FacesException(e);
    finally {
    lclFC.responseComplete();
    This works fine in calling the other URL, but no data is sent thru the post protocol. I have no control to the site I am calling....
    I have also tried
    ExternalContext ectx = FacesContext.getInstance().getFacesContext().getExternalContext();
    HttpServletRequest request = (HttpServletRequest) ectx.getRequest();
    HttpServletResponse response = (HttpServletResponse) ectx.getResponse();
    RequestDispatcher dispatcher = request.getRequestDispatcher("http://www.mysite.com/personals/search/search.html");
                   dispatcher.forward(request, response);
    But this tends to put a "/" at the front of the called URL. Can someone please recoomed the coorect way to call a URL from yr action bean and sending it data thru post protocol. I also wish that this new URL should now be displayed within the browser. This is urgent, yr quick reply is appreciated

    Myfaces sandbox form gives the ability to change its action url and port. Look here:
    http://myfaces.apache.org/sandbox/form.html

  • Random text with links using Javascript?

    I have a very simple script I downloaded that makes text random using javascript. I would like to add a hypertext link on parts of the text, but can't seem to get it to work.
    Would anyone be so kind as to show me how this can be done. I would like to add links to the "Random text string 1.", Random text string 2. etc., within the javascript below.
    <SCRIPT LANGUAGE="Javascript"><!--
    function text() {
    text = new text();
    number = 0;
    // textArray
    text[number++] = "Random text string 1."
    text[number++] = "Random text string 2."
    text[number++] = "Random text string 3."
    text[number++] = "Random text string 4."
    text[number++] = "Random text string 5."
    // keep adding items here...
    increment = Math.floor(Math.random() * number);
    document.write(text[increment]);
    //--></SCRIPT>
    Thank you!

    Hi, Mic,
    I actually don't know if this will work, but what if you added <a href> coding around your text line? You might need \ escape characters so that your script sends it out without trying to execute it as code.
    Z

  • Call a report with selection screen as subscreen.

    Hi all,
    i need to Submit And Return a Report having some parameters and Select options, from a Function Module.
    all i want that the Selection Scrren of Report should appeared as Subscreeen, so that Calling Screen sould be visible in Background.
    Is this Possible , if yes then How ?
    thanks in advance,
    Nitin

    Running new report means opening new internal session. This can't be embeded within the current internal session where your function group (function module specifically) runs. So there is no such a way which you could run a report inside a subscreen area.
    If you however want only selection screen of the report to be embeded inside your subscreen area (not run) you can use
    "report Z_SUBSCREEN_REPORT
    SELECTION-SCREEN BEGIN OF SCREEN 0200 as SUBSCREEN.
      PARAMETERS pa type c.
    SELECTION-SCREEN end of SCREEN 0200.
    "main screen's flow logic in function group with subscreen area
    PROCESS BEFORE OUTPUT.
      call SUBSCREEN area INCLUDING 'Z_SUBSCREEN_REPORT '0200'.
    Regards
    Marcin

  • Oracle: slow performance with SELECT using ojdbc14 and connection pooling

    Hello,
    i'm working hard the last days to solve a performance problem with our customer using a oracle 10g database. For testing I used our oracle 9.2.0.1.0 database which shows the same symptoms. All doing solved nothing: the performance while using this oracle is much slower than other databases. This result I cannot trust and so I need some advice. What is missing to improve the performance on the java side?
    The webapplication I use runs fast on MySQL 4.x and SQLServer 2000, but on the above mentioned Oracle it was always 4 times slower. The webapplication uses a lot of simple SELECT-Statements without complicated joins and so on (because it should run on many different databases). Doing some days of creating tests within this webapplication, I was not able to find any entrance point for a change. All databases server I'm using, having only the default configurations after a common installation.
    To reduce the complexity I wrote a simple java application with connection pooling using only the latest libraries from apache-commons(dbcp, pool), and the latest ojdbc14 for oracle 9.2.
    First the results than the code: MySQL needed less than 1000 millisecond, SQLServer around 1000 milliseconds and Oracle over 2000 milliseconds. I stopped pooling and the results are for Oracle even worse: over 18000 milliseconds (mysql:2500, sqlserver:4100).
    I changed the classes for Oracle and used the class oracle.jdbc.pool.OracleConnectionCacheImpl from the ojdbc14-library. No difference (around 100 milliseconds more or less).
    The only Select-Statement works on this table, which has one index on HICTGID.
    It contains 259 entrances.:
    CREATE TABLE HIERARCHYCATEGORY (
      HICTGID                 NUMBER (19)   NOT NULL,
      HICTGLEVEL              NUMBER (10)   NOT NULL,
      HICTGEXTID              NUMBER (19)   NOT NULL,
      HICTGEXTPARENTID        NUMBER (19)   NOT NULL,
      HICTGNAME               VARCHAR2(255) NOT NULL
    );The application simply loops through this table using
    SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID = ?, but I always open a connection before this query and closes this connection afterwards. So I use the pooling as much as possible. That's all SQL I'm using.
        protected static DataSource setupDataSource(String sDriver, String sUrl, String sUser, String sPwd) throws SQLException {
            BasicDataSource ds = new BasicDataSource();
            ds.setDriverClassName(sDriver);
            ds.setUsername(sUser);
            ds.setPassword(sPwd);
            ds.setUrl(sUrl);
            // The maximum number of active connections:
            ds.setMaxActive(3);
            // The maximum number of active connections that can remain idle in the pool,
            // without extra ones being released, or zero for no limit:
            ds.setMaxIdle(3);
            // The maximum number of milliseconds that the pool will wait (when there are no available connections)
            // for a connection to be returned before throwing an exception, or -1 to wait indefinitely:
            ds.setMaxWait(3000);    
            return ds;
        }I can switch by using external properties between three databases (oracle, mysql and sqlserver) and if I want I can switch pooling off. And all actions I'm interested are logged by Log4J.
        public static Connection getConnection() throws SQLException {
            Connection result = null;
            String sJdbcDriver = m_oJbProp.getString("jdbcDriver");
            String sJdbcUrl = m_oJbProp.getString("databaseConnection");
            String sJdbcUser = m_oJbProp.getString("dbUsername");
            String sJdbcPwd = m_oJbProp.getString("dbPassword");
                try {
                    if (m_oJbProp.getString("useConnectionPooling").equals("true")) {
                         if (log.isDebugEnabled()) {
                              log.debug("ConnectionPooling true");
                        if(null == m_ds) {
                            m_ds = setupDataSource(sJdbcDriver,sJdbcUrl,sJdbcUser,sJdbcPwd);
                              if (log.isDebugEnabled()) {
                                   log.debug("DataSource created");
                        result = m_ds.getConnection();
                    } else {
                        // No connection pooling:
                         if (log.isDebugEnabled()) {
                              log.debug("ConnectionPooling false");
                        try {
                            Class.forName(sJdbcDriver);
                            result = DriverManager.getConnection(sJdbcUrl, sJdbcUser, sJdbcPwd);
                        } catch (ClassNotFoundException cnf) {
                            log.error("Exception: Class Not Found. ", cnf);
                            System.exit(0);
    (.. ErrorHandling ...)Here is the code fragment which is doing the work:
                     StringBuffer sb = new StringBuffer();
                while (lNextBottom <= lNextCeiling) {
                     con = getConnection();
                     innerSelStmt = con.prepareStatement("SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID = ?");
                     innerSelStmt.setLong(1, lNextBottom);
                     rsInner = innerSelStmt.executeQuery();
                     if ((rsInner != null) && (rsInner.next())) {
                         sb.append(rsInner.getLong(1) + ", " + rsInner.getString(2) + "\r");
                          if (log.isDebugEnabled()) {
                               log.debug("Inner Statement: " + rsInner.getLong(1) + "\r");
                     rsInner.close();
                     con.close();
                     lNextBottom++;
                 if (log.isInfoEnabled()) {
                      log.info("\rResult values: Hictgid, Hictgname \r");
                      log.info(sb.toString());
                 }and the main method:
        public static void main(String[] args) {
            try {
                 long lStartTime = System.currentTimeMillis();
                 JdbcBasic oJb = new JdbcBasic();
                 boolean bSuccess = false;
                 bSuccess = oJb.getHierarchycategories();
                 if (log.isInfoEnabled()) {
                      log.info("Running time: " + (System.currentTimeMillis() - lStartTime));
                 if (null != m_ds) {
                     printDataSourceStats(m_ds);
                      shutdownDataSource(m_ds);
                      if (log.isInfoEnabled()) {
                           log.info("Datasource closed.");
             } catch (SQLException sqe) {
                  log.error("SQLException within  main-method", sqe);
        }My database values are
    databaseConnection=jdbc:oracle:thin:@SERVERDB:1521:ora
    jdbcDriver=oracle.jdbc.driver.OracleDriver
    databaseConnection=jdbc:jtds:sqlserver://SERVERDB:1433/testdb
    jdbcDriver=net.sourceforge.jtds.jdbc.Driver
    databaseConnection=jdbc:mysql://localhost/testdb
    jdbcDriver=com.mysql.jdbc.Driver
    dbUsername=testusr
    dbPassword=testpwdThanks for your reading and maybe for your help.

    A few comments.
    There is of course another difference between your test cases then just the database. There is also the driver. And I suspect that in at least the case with the jtds driver it is helping you along where you are doing something silly and the Oracle driver is not.
    Before I explain the next part I would say the speed differences between MS-SQL and MySQL look about right I think you are aiming here for MS-SQL level performance not MySQL. (For a bunch of reasons MySQL is inherently faster but there are MANY drawbacks as well which have been well discussed on previous threads)
    Here is where I believe your problem lies
    while (lNextBottom <= lNextCeiling) {
                     con = getConnection();
                     innerSelStmt = con.prepareStatement("SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID = ?");
                     innerSelStmt.setLong(1, lNextBottom);
                     rsInner = innerSelStmt.executeQuery();
                     if ((rsInner != null) && (rsInner.next())) {
                         sb.append(rsInner.getLong(1) + ", " + rsInner.getString(2) + "\r");
                          if (log.isDebugEnabled()) {
                               log.debug("Inner Statement: " + rsInner.getLong(1) + "\r");
                     rsInner.close();
                     con.close();
                     lNextBottom++;
                 }There at least four things that are wrong with above.
    1) Why are you preparing the statement INSIDE the loop. Let us for a moment say that the loop will spin 100 times. That means that you are preparing the same statement 100 times. This is bad. It is also very relevant because for example the Jtds driver is going to be caching the prepared statements you make so that actually while you try and prepare it 100 times it only actually does it once... but in Oracle I don't know what it is doing for sure but if it is preparing on each pass well than that bit of it is going take 100 times longer then it should.
    2) You are opening and closing the connection on each pass through the loop... also a terrible idea. You need to fix this first so that you can repeatedly use the same prepared statement.
    3) Why are you looping in the first place? More on this later.
    4) Where do you close the PreparedStatement? It doesn't look like you do.
    Okay so for starters your loop should look a lot more like this...
    code]
    con = getConnection();
    innerSelStmt = con.prepareStatement("SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID = ?");
    while (lNextBottom <= lNextCeiling) {
    innerSelStmt.setLong(1, lNextBottom);
    rsInner = innerSelStmt.executeQuery();
    if ((rsInner != null) && (rsInner.next())) {
    sb.append(rsInner.getLong(1) + ", " + rsInner.getString(2) + "\r");
    rsInner.close();
    lNextBottom++;
    innerSelStmt.close();
    con.close();
    I think the code above (and you can put your debug stuff back if you want) which uses ONE connection and ONE prepared Statement will improve your performance dramatically.
    The other question though I would as is why in the hell you are doing 100 or whatever number of queries anyway. This can be done all in ONE query which again will improve performance.
    Your query and such should look like this I think.
    String sql = "SELECT Hictgid, Hictgname FROM HIERARCHYCATEGORY WHERE HICTGID >=? AND HICTGID<=?";
    PreparedStatement ps = conn.prepareStatement(sql);
    ps.setLong(1,lNextBottom );
    ps.setLong(2,lNextCeiling);
    ResultSet rs = ps.executeQuery();
    while(rs.next()){
      // your appending to string buffer code goes here
    }and I can't understand why you're not doing that in the first place.

  • Query Issue with select level from dual

    Hi,
    I have a question regarding this query. The problem seems that when selecting level from dual while including another table the rows returned seem to increase exponentially.
    I can add distinct and get the correct number of rows but am worried that this will cause a possible performance issue. Am I using the level option wrong?
    I have included details below.
    There are 4 rows in tbl_incidents
    When I run the following queries I get rows returned based on the total number of rows
    select start_date + level - 1, tbl_incidents.incident_id, level
    from dual, tbl_incidents
    where incident_id = 6
    connect by level <= 1;
    returns 1 row
    select start_date + level - 1, tbl_incidents.incident_id, level
    from dual, tbl_incidents
    where incident_id = 6
    connect by level <= 2;
    returns 5 rows
    select start_date + level - 1, tbl_incidents.incident_id, level
    from dual, tbl_incidents
    connect by level <= 3 and incident_id = 6;
    returns 21 rows
    select start_date + level - 1, tbl_incidents.incident_id, level
    from dual, tbl_incidents
    connect by level <= 4 and incident_id = 6;
    returns 85 rows
    select start_date + level - 1, tbl_incidents.incident_id, level
    from dual, tbl_incidents
    connect by level <= 5 and incident_id = 6;
    returns 341 rows
    So with
         r being the number of rows in tbl_incidents and
         l being the number used in the connect by for level and
         q being the number of rows returned by the query
         it appears that
    q(l) = r * q(l-1) + 1
    level 2:     4 * 1 + 1 = 5
    level 3:     4 * 5 + 1 = 21
    level 4:     4 * 21 + 1 = 85
    level 5:     4 * 85 + 1 = 341
    Thanks much,
    Nora

    Hi,
    The dual table is used when you want to do something in SQL when you are not otherwise using a table.
    Generating a "counter table" of the integers 1, 2, 3,..., X is an example
    SELECT  LEVEL   AS n
    FROM    dual
    WHERE   LEVEL   <= x;There is never any point in joining dual to another table, as in
    select  start_date + level - 1
    ,       tbl_incidents.incident_id
    ,       level
    from    dual
    ,       tbl_incidents
    where    incident_id = 6
    connect by  level <= x;You will always get the same more easily by just eliminating dual:
    select  start_date + level - 1
    ,       incident_id
    ,       level
    from    tbl_incidents
    where    incident_id = 6
    connect by  level <= x;It is quite useful and common to join a counter-table to a real table, like this cross-join:
    WITH    counter_table  AS
        SELECT  LEVEL   AS n
        FROM    dual
        WHERE   LEVEL   <= x
    select  start_date + n - 1
    ,       incident_id
    ,       n
    from    tbl_incidents
    ,       counter_table
    where    incident_id = 6

Maybe you are looking for

  • Times missing in left column in week view

    I am using iCal 2.0.3 and the hour times to not show in the left column in week view. Noon is present, but no others. There have been a few occasions that times have shown up, but then the next time they are gone. I set up a new user and went into iC

  • Getting my hands on some mac equipment

    Hello everyone. I earlier posted about an Intel iMac for a friend of mine who had a question. You guys were great and helped, so I want to ask again. This time I'm thinking of getting my own mac. I've wanted them for a long time now, but never could,

  • Installing .gz files

    I feel stupid asking this question. This is actually in Solaris 8, but I can not figure out how to install this .gz file. I type gunzip and the file name and is expands the file and removes the .gz extension and that is were I get lost. The file I am

  • Mail mac disconnected and not working when mac back sleeping

    I have a problem with my mail app on imac and Mountain Lion installed. when the mac goes  in sleep mode, if the mail app was open,, on wake up all the accounts are disconnected and clicking the "connect the accounts" not working. To fix it I have alw

  • Windows 2000 won't start after iTunes 7.3 upgrade

    Yesterday I upgraded to iTunes 7.3 and after the required reboot, windows 2000 hangs on its startup screen. I can boot from the windows 2000 CD and login to the win2k installation on the hard disk using the admin password, but I don't know how to uni