Diferent querries and flow control in xsql servlets

My question is if i can make a flowcontrol in an xsql servlet.
For example I want to use different querries depending on an attribute which is delivered by an xsql querry.
For shemata example:
<query>
select a from table a
</query>
if a=abc
<query>
select b from table b
</query>
if a=def
<query>
select c from table b
</query>
Is such a thing possible or should i use a PL/SQL block in the xsql Servlet.
Thanks for your answers
Andreas

For a fully-worked example, illustrating how to use <xsql:ref-cursor-function> to programmatically determine a dynamic query, see Chapter 17 of my Building Oracle XML Applications book.
The basic technique is illustrated by the following procedure:
CREATE OR REPLACE PACKAGE App IS
TYPE ref_cursor IS REF CURSOR;
FUNCTION HotItems(userid VARCHAR2) RETURN ref_cursor;
END;
CREATE OR REPLACE PACKAGE BODY App IS
FUNCTION HotItems(userid VARCHAR2) RETURN ref_cursor IS
the_cursor ref_cursor;
my_sal NUMBER := 1;
query VARCHAR2(2000);
BEGIN
IF UPPER(userid) = 'STEVE' THEN
query := 'SELECT ename, sal FROM EMP WHERE ROWNUM < 4';
ELSE
query := 'SELECT dname, deptno FROM DEPT WHERE ROWNUM < 2';
END IF;
OPEN the_cursor FOR query; /* USING var, var, var */
RETURN the_cursor;
END;
END;
/Using <xsql:ref-cursor-function>, depending on the values that you pass to the App.HotItems() function, you'll either get back EMP data or DEPT data.

Similar Messages

  • Problems with parity and flow control using visa serial

    I am trying to create a basic user interface with the options that my
    company uses most often for a force indicator.  You can configure
    the indicator over serial, as well as read the values off the
    indicator.  I am trying to create the user interface so that using
    producer/consumer loops with events, once you change a value, it will
    write that new value to the serial port, ie the device. 
    The problem I am having is transfering the parity and flow control
    values for the serial config to the Basic read write VI.  The
    problem is that once the consumer loop executes, it will write the
    values correctly to the VI, but then the outer loop executes 200 ms
    later and clears the values.  I know that this is normal behavior
    and that in order to keep the values stored, normally you would use a
    shift register.  I tried to use this and had some issues with
    correct data types/array mis-mtaches, ets, so I created an indicator
    and had a local vaible read the indicator, which seems to be working
    for the stop bits, read bits, baud rate, etc, but not the parity anf
    flow control.  I always get "blank" outputs for theses values (if
    you enable the digital display you can see that they are outputing the
    value 0 which correspondes to None in both cases, which is
    correct).  Even though it appears that it is outputting the
    correct value, I get an error that says the VISA property is
    invalid.  I initally did a search and found that my stop bit
    control was wrong (outputting double instead of integer), but I could
    not find anything on the parity/flow control issue.  I even tried
    to copy the serial config controls from the basic serial read/write to
    my dialog box and that did not work either.
    I would be grateful for any suggestions.
    Thanks
    Kenny
    Kenny
    Attachments:
    BGI_main pandc.zip ‏232 KB

    I should add that I am using LV 8.0 and that the serial config
    indicator in the consumer loop will be off the frontpanel in the final
    VI so that it is not visible to the user.
    Kenny

  • Difference between STATIC and FLOW CONTROL in IKM

    Hello,
    Can someone explain the difference between STATIC and FLOW control in IKM ? What is the best situation to use them with some example ?
    Can we have more than one ODI Constraint at the target table.
    Thanks
    Edited by: cdmnagaraj on 19-Oct-2008 21:59

    Hi Nagaraj,
    Suppose your Lookup table -> column "VALUE" is 101.
    How many rows in your source table (column) have "Balance" = 101 ??
    I hope only One.
    From your Source table all the recors will be moved to your I$ . then from your I$ it will check for the condition
    and all the violated records will be moved to your E$
    please check your "Insert CK Errors" from your operator
    it will be like this....
    insert into E$_TargetTable
         ERR_TYPE,
         ERR_MESS,
         CHECK_DATE,
         ORIGIN,
         CONS_NAME,
         CONS_TYPE,
         col1,
         col2,
         balance
    select
         'F',
         sysdate,
         '(3367100)TESTPROJECTS.TestTable',
         'conditionTest',
         'CK',     
         col1,
         col2,
         balance
    from     I$_TargetTable CHI
    where     not      (
              Balance = (Select value from LOOKUP)
    So in your case it will check for balance not equal to 101 . and it will push those records into your E$ table
    Rathish

  • Forms and reports 10g :  enable xsql servlet

    Please, how can I enable a XSQL Servlet on "Forms and reports AS 10g : 9.0.4"?
    I have added xsql <servlet> and <servlet-mapping> info to global-web-application.xml.
    I have copied XSQLConfig.xml file to $ORACLE_HOME/j2ee/home/default-web-app/WEB-INF/classes.
    But if I run any xsql script from xsql demos, I will get some result as xml : (<?xml version="1.0" ?>
    <xsql:query connection="demo" xmlns:xsql="urn:oracle-xsql">SELECT name, origin FROM location loc WHERE loc.origin.x = {@x-coord}</xsql:query> )
    => xsql servlet doesn't work !
    Help me?

    Certification information is pulished on metalink.oracle.com
    Regards
    Grant Ronald
    Forms Product Management

  • XDL & XSQL servlet, where is it?

    I downloaded the XDK (Java) for windows and cannot find the XSQL servlet that the HTML doc's talk about. Has anyone else ran into this problem?
    Any help is appreciated...thanks!

    Ok I found the Servlet now it seems like there are a lot of discrepencies between the Oracle HTML documentation and the XDK. For instance it tells me:
    "The XSQL Pages distribution includes a ......along with the xsql-wtg.bat script to start the server with all XSQL Servlet settings setup properly."
    Yet I cannot find that Batch file anywhere?
    Any ideas?
    Thanks!
    null

  • XSQL and basic flow control

    Hello again,
    Is there any mean to execute more that one time the same XSQL action-element, like this (future XSQL version?):
    <xsql:for-each test="{@selectedITEMS}">
    <xsql:dml>
    DELETE FROM ITEMS
    WHERE ItemID = {.}
    </xsql:dml>
    </xsql:for-each>
    Yes the duty can still be transferred outside XSQL, in the form of a DB proc or a custom action-element, but if some form of basic flow control exists/ed here inside XSQL, this would certainly come in handy!
    Thanks
    JRoch

    A simple way to do this would be to write an action handler that processes the value of the "selectedITEMS" parameter and sets a page-private parameter to the equivalent value with commas between them, then do:
    <xsql:dml>
    delete from items
    where ItemId IN ({@ListOfLitems})
    </xsql:dml>
    then you do it all in one trip to the database.

  • XSQL Servlet and Dynamic SQL

    Does the XSQL servlet support dynamic SQL? Take a stock screening page as an example. In this example you want to dynamically build the where clause based on user input. Thus if a Minimum PE Ratio of 3 was entered, the where clause of "where PE_Ratio >= 3" would be appended to the query. In this case there may be up to 20 different parameters or more to be mapped dynamically, so it wouldn't be feasible to nest all of the different combinations.

    XSQL Supports lexical substitution parameters
    so any and every part of any query can be parameterized.
    The extreme case is:
    <query> {@sql} </query>
    where the entire query is passed in
    in a parameter (named "sql").
    But any combination of parameters
    and substitutions is legal and can
    be used to do what you want.
    Since the variables are not BIND
    variabled, but instead lexical
    substitution variables, you can
    do things like:
    <query>
    select {@collist}
    from {@table}
    where {@where}
    order by {@orderby}
    </query>
    You can provide default parameter values
    using XML attributes on the <query>
    element which then can be overridden
    if a value is passed in in the request...
    <query collist="ename, sal"
    orderby="sal desc"
    where="1=1"
    from="dept">
    select {@collist}
    from {@table}
    where {@where}
    order by {@orderby}
    </query>
    And then a request to the page
    can pass in a orderby=decode(comm,null,1,0)
    or something to override the defaults.
    null

  • Oracle's XML Publisher in JDeveloper and XSQL Servlet

    A While ago, in this thread JDeveloper 10g, XSQL and FOP , was mentioned an ongoing effort for the "integration of Oracle's XML Publisher in JDeveloper and XSQL Servlet", Is this still happening ?, will this be something will be able to use without having to be an Oracle Apps shop? Any additional info would be appreciated.

    Hi,
    is there any progress about XML publisher integration with JDeveloper. I'm right now examining XML publisher but there is no explicit directions and explanations of using XML publisher with jdeveloper.
    any news !?
    best regards...
    --barisk                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Page Flow and Java Control interaction

    Hi everybody !
    Even after to read some documents like
    http://dev2dev.bea.com/pub/a/2004/06/wlw_internals.html
    and
    http://dev2dev.bea.com/pub/a/2004/01/jones.html
    i still didn't get what is really happening "behind the scenes" between Page Flows and Java Controls (Workshop 8.1). I would be glad if anyone could send to me more detailed documentation or explanation about this subject.
    How can a Java Control to stand behind a Stateless Session Bean (GenericStatelessSLSB) and still to keep its internal state (instance variables) consistent ? How can a statefull Java Control to remain statefull being accessed by a stateless component (the EJB) ? Or is the source code of a Java Control (the JCS file) kept by the Page Flow and sent to EJB for its execution ?
    Thanks in advance.

    Hi Daniel
    I have attached a doc I created that explains what happens behind the scenes
    when a pageflow call a JCS va a JWS calling a JCS.
    Can you please go through the document and let me know any questions you may
    have?
    Thanks
    Vimala
    <Daniel Lima> wrote in message news:[email protected]..
    Hi everybody !
    Even after to read some documents like
    http://dev2dev.bea.com/pub/a/2004/06/wlw_internals.html
    and
    http://dev2dev.bea.com/pub/a/2004/01/jones.html
    i still didn't get what is really happening "behind the scenes" between
    Page Flows and Java Controls (Workshop 8.1). I would be glad if anyone
    could send to me more detailed documentation or explanation about this
    subject.
    How can a Java Control to stand behind a Stateless Session Bean
    (GenericStatelessSLSB) and still to keep its internal state (instance
    variables) consistent ? How can a statefull Java Control to remain
    statefull being accessed by a stateless component (the EJB) ? Or is the
    source code of a Java Control (the JCS file) kept by the Page Flow and
    sent to EJB for its execution ?
    Thanks in advance.

  • Introduction of flow control and synchronization steps in Test Description

    Hi ALL,
              I am working on developing of Test Scripts in ATML standards. Can any one inform me how to introduce flow control (if, else, end, for, while, break etc)  and synchronization (wait etc) steps into the Test scripts. Thanks in advance.
    With Best Regards,
    Kalyan 

    I had a similar issue in a project I am working on. I'm not sure if I did this the "Best Practices" way or not, but it works perfectly.
    In the head area of my JSP I include the following:
    <f:view>
        <h:outputText id="refresher1" rendered="#{queryHandler.queryRunning}">
            <f:verbatim escape="false">
                <meta http-equiv="refresh"
                      content="5,<%=response.encodeURL(request.getContextPath()+
                              "/queryStatus.jsf")%>">
            </f:verbatim>
        </h:outputText>
        <h:outputText id="refresher1" rendered="#{queryHandler.queryFinishedRunning}">
            <f:verbatim escape="false">
                <meta http-equiv="refresh"
                      content="5,<%=response.encodeURL(request.getContextPath()+
                              "/queryResults.jsf")%>">
            </f:verbatim>
        </h:outputText>This puts a 5 second refresh meta in the header to direct the browser to the correct page based on the status of the query thread.
    There are many ways to accomplish the effect you want. I suggest putting all the controls into the JSP and making use of the rendered attributes instead of the JSTL conditionals to show the controls you want for the state of the application.
    -jeffhoward

  • Ssis data flow item and ssis control flow item tab missing in choose toolbox item from ssdt 2010

    ssis data flow item and ssis control flow item  tab missing in choose toolbox item from ssdt 2010

    I have the same problem.
     When i click on tools -> choose tools Items dialog box, Control Flow and Data Flow Tab are missing.
    I've just worked with SQL Server Data Tools and SQL Server 2012 and these tabs are not missing.
    i think this is a problem installing SQL Server.
    I've not yet  found a solution.

  • OAS 4.0.8 and XSQL Servlet

    Are there any instructions for configuring OAS 4.0.8 to work with
    the XSQL Servlet ? I've been trying unsuccessfully for a week.
    null

    Jason Bennett (guest) wrote:
    : Are there any instructions for configuring OAS 4.0.8 to work
    with
    : the XSQL Servlet ? I've been trying unsuccessfully for a week.
    At the moment I feel there is no way to do that. Youe have to
    use Apache and Jserv if you really need it now.
    Karl
    null

  • Weblogic and XSQL Servlet

    Has anyone configured the XSQL Servlet to run with Weblogic? Is so, could you explain the set-up?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Brent Gardner:
    Has anyone configured the XSQL Servlet to run with Weblogic? Is so, could you explain the set-up?<HR></BLOCKQUOTE>
    I4m still having problems with this, but maybe it4s not weblogic.
    However, at least you need to modify the web.xml file for your web applicaition, as to register the servlet.
    null

  • Standard flow control

    JSTL support for standard flow control.
    what that means ?
    I am aware of that JSTL can help in SQL processing , XML processing through Tag libraries.
    But however, how the JSTL supports standard flow control ? is it the JSTL iterator we are talking about ?

    Although you can apparently access a database on the JSP page using JSTL tags, it doesn't mean its a good idea. I suggest you use the MVC design. You separate the layers and not put database functionality in the presentation layer (JSP).
    Hers is one MVC approach in which a single servlet acts as the control. There are other ways of doing it via Spring, Structs, etc. However, I suggest you master this approach before moving onto those.
    presentation layer:
    JSP, CSS, Javascript, and JSTL.
    The JSP page and its supporting languages is responsible for displaying data and submitting user input back the controller. The Javascript is typically responsible for basic client side validation of user input. JSP gets its data that it is to display from request scope (and perhaps some from session scope). JSTL assists JSP in displaying data by doing such tasks as looping though a Java collection from the request scope and displaying it. The JSP page should not contain any logic from the other layers (below). The page will get complicated enough over time just displaying data without making it even more difficult to read by inserting business logic into it.
    control layer:
    A single servlet. This servlet takes in all url request and page submits coming from JSP pages. Avoid JSP to JSP page naviigation (there are exceptions to this rule). Go through the control layer. This servlet calls business logic to get data that the page requests. It puts it in request and/or session scope, and dispatches to the appropriate JSP page. Because all url request go through this servlet, the servlet can do centralized authentication (log in) and authorization (user assigned to a role). Dont generate presentation data (html) from this layer.
    business layer:
    Java classes that carry out requests from the control layer. It calls the database layer for raw data from the database and performs business logic on the data (if any) before sending it to the control layer.
    database layer:
    Takes in requests from the business layer. Queries the database via SQL. Is the only layer that has sql in it. Reads the resultSet from the database and puts the data in some kind of Java collection before returning it to the business layer. Never return the resultSet (a database concept) to the business layer.

  • Console flow control

    With no flow control on the console port, it's common to overrun the port when sending large config files from a terminal emulator. Is there any way to avoid this, other than manually breaking up the file and sending a chunk at a time, maybe by adjusting the console buffer size, if possible?

    Michael
    Most terminal emulator programs (like Hyperterm, or TeraTerm, or SecurCRT, etc) have a setting where you can specify character delay and or line delay. If you use these parameters to specify some delay you can send the config file (even very large configs) without over-running the console.
    HTH
    Rick

Maybe you are looking for