Select queries in pl/sql

i don't know if this is a stupid question, but is it possible to pose a select query to an xml document using this xml parser?

No it is not possible to pass a query to an XML document through a parser. There is an XML Query W3C Working Group that is defining that standard.
XML Parser allow programmatic access to XML documents using DOM and SAX APIs as described in the docs.
Oracle XML Team
null

Similar Messages

  • Running Multiple SQL in a Single Worksheet: Can I Selectively Run a Single SQL and Append Output?

    In any release of SD, if I have a single worksheet containing 10 sqls. Is it possible to place the cursor on any of the sql and run only that sql, yet, append its output to existing output window. I can then select another sql and execute it and keep appending output. In other words, do not clear existing output or start a new output tab.
    As it exists today (in any release), I can either 'run script' which does append, but it executes all the sql (non-selective). Alternately, I can 'run statement' to selectively run a single sql, but it will clear the output window (or if pinned), start a new one. None of this is what I want.
    Thank you.

    Select the query you want to run. Execute it via F5. Then highlight the next query and repeat.
    The output will append to the Script Output panel.
    There's no way to get 2 queries to share a grid, unless you were to run them as a single query a la UNION.

  • Executing Multiple Select Queries in a Single attempt

    HI,
    I executed two select queries in a single statement execute. It is executing without any error. Hence there must be two resultset objects within that single statement.
    What the problem is that I m able to fetch the first resultset and its data, But I execute stmt.getMoreResults() to move to the next resultset, it returns false, which means there is no more results. I want to know what is the problem ?? (Record exist in the database for both queries)
    And How can I rertieve both the resultsets. ??
    Plz help me asap.
    For ur convenience I m posting the Java code also which I m trying.
    sql.delete(0, sql.length());
    sql.append("select FIRST_NAME , MIDDLE_NAME , LAST_NAME from USER_MASTER where USER_ID=4;");
    sql.append("select producttransaction_id, product_type from product_transaction where transaction_id=102 order by product_type desc");
    Statement stmt = con.createStatement();
    stmt.execute(sql.toString());
    int resultsetcount =1;
    ArrayList arrlist = new ArrayList();
    rs = stmt.getResultSet();
    if(rs !=null)
    if(rs.next())
    .........// logic here working properly
    //Now when I move to next resultset using the below statement
    //it returns false indicating that there r no more results.
    // Why this is so ?????
    boolean moreresultsets = stmt.getMoreResults();
    System.out.println("MoreResultsets::"+moreresultsets);
    if(moreresultsets)
    rs = stmt.getResultSet();          
    if(rs!=null)
    while(rs.next())
    //...Logic.......
         rs.close();
    Thanks

    I've never seen this used the way you are using it. In my experience the only way to do this would be to execute a single SQL statement that returns multiple result sets - you are trying to append two SQL statements.
    You could define an in-line procedure wrapping your two select statements, or you could define a stored procedure to do the same thing. Then (either way) use CallableStatement to execute the call to the procedure.

  • Multiple select queries for JDBC sender

    I am working on JDBc to IDOC scenario.
    I need to process two select queries in PI where output of 1st query becomes the input of second.
    Now i need to map the output of second to IDOC through XSL mapping also i need to use BPM to process(without using the stored procedure) the scenario.
    In my JDBC communication channel i have option for only one select query and second query should fetch the data through BPM.
    In BPM i have used the following sequence mentioned below:
    Start --> Receive step ( receives all the header lines) --> Transformation (to split the header messages to single message) --> Block Start( To processEachRecord) --> Send Syn (to map the request message i,e. output of first query with Response i,e. structure of the second query)  --> Send Asyn (to send the output of second query to XSLT mapping) -->Block End --> stop
    Output of XSLT mapping is the input for IDOC
    Now i need to understand how to process the second query?

    >> I need to process two select queries in PI where output of 1st query becomes the input of second
    Use SQL Nested Queries. 
    Example:
    SELECT Model FROM Product WHERE ManufacturerID IN (SELECT ManufacturerID FROM Manufacturer
    WHERE Manufacturer = 'Dell')
    Here first table is Manufacturer .. we do select query in manufacturer to return data and pass it to the first table Product.
    >> Now i need to understand how to process the second query?
    You dont need at all. In your sender jdbc channel, write sql statement nested query and you will get only output of the second table. you map the second table output to the idoc.
    Note: Dont know why do you need BPM for this case..
    Jdbc sender adapter  help links
    http://help.sap.com/saphelp_srm40/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
    Check this thread for update statement in jdbc cc
    Re: sender jdbc adapter

  • Running Stacked Queries in Oracle SQL Developer

    Is it possible to run stacked queries in Oracle SQL Developer???
    Something like this...
    SELECT *
    FROM TABLE_1
    SELECT *
    FROM TABLE_2
    SELECT *
    FROM TABLE_3
    And give my 3 different result sets in my Query Result window
    I tried "BEGIN" and "END" and Oracle SQL Developer did not seem to like it.
    Can someone let me know if this is possible and what the syntax might be???
    Thanks in advance for your review and am hopeful for a reply.
    PSULionRP

    Wrong forum!
    Please post this in the sql developer forum.
    SQL Developer
    You can run multiple queries exactly the way you posted them but you need to use F5 - the run script toolbar button.

  • Select query inside PL/SQL block.

    Hello Experts,
    I am just a beginner with PL/SQL.
    If I write a select query from client like SQL dev and fire it against a database, it gives me result.
    Eg: select * from employee;
    Now when I use the same Query inside a PL/SQL block suppose:
    Declare
    begin
    select * from employee;
    end;
    This gives error on execution, mentioning that an INTO is expected etc...
    I have doubts here:
    1. Can't I use a plain select inside a PL/SQL block (if so why?)
    I know this is kind of very basic question, I tried searching this on the forum but could not find the thread, please redirect me to the link if this is already answered.

    user8578271 wrote:
    Hello Experts,
    I am just a beginner with PL/SQL.
    If I write a select query from client like SQL dev and fire it against a database, it gives me result.
    Eg: select * from employee;
    Now when I use the same Query inside a PL/SQL block suppose:
    Declare
    begin
    select * from employee;
    end;
    This gives error on execution, mentioning that an INTO is expected etc...
    I have doubts here:
    1. Can't I use a plain select inside a PL/SQL block (if so why?) Because when you run a query in a tool like SQL Developer, or SQL*Plus or TOAD etc. then it opens up a cursor and fetches the data into internal memory structures before displaying it, and that is all done automatically and hidden from you. In PL/SQL, there is no interface to display the results of SQL queries, so you have to specifically tell it what to put the data into.
    The syntax is (in basic terms)...
    SELECT column1, column2... columnX
    INTO variables or record structure
    FROM ...Though that can only select a single row of data. If your query returns more than 1 row it will give a TOO_MANY_ROWS exception. If your query returns no rows you will get a NO_DATA_FOUND exception.
    If you need to select multiple rows into variables etc., then you would need to "BULK COLLECT" into a collection/array structure, though this takes up valuable memory on the server and shouldn't be used unless necessary (and you understand the implications of doing it).

  • High CPU load on Oracle when executing SELECT queries on TT

    Hello. I have cache grid: 2 TT instances + Oracle with global dynamic async write cache group on single table with 1million entries. Each cache grid instance is located on its own host. I start performance test executing only SELECT queries on TT instances. At this time I see that Oracle process starts extensively consuming CPU time. According to documentation (if I get it right) all db reads are executed between TT instances. What is Oracle doing when I perform select from TT? In case we scale horizontally by adding TT instances won't Oracle become a bottleneck?

    -bash-3.2$ ttVersion
    TimesTen Release 11.2.1.8.0 (64 bit Linux/x86_64) (tt1121:53388) 2011-02-02T02:20:46Z
    Instance admin: amironenko
    Instance home directory: /opt/TimesTen/tt1121
    World accessible
    Daemon home directory: /opt/TimesTen/tt1121/info
    PL/SQL enabled.
    I create cache group as:
    REATE DYNAMIC ASYNCHRONOUS WRITETHROUGH GLOBAL CACHE GROUP ttGroup
    FROM tengri.sub (
    id integer not null primary key,
    msisdn varchar(32) not null,
    name varchar (64),
    balance integer,
    short_num varchar (32),
    address varchar (512),
    type integer not null,
    is_locked integer not null,
    charging_profile_id integer,
    cos_id integer,
    currency_id integer,
    language_id integer
    create unique index idx_sub_msisdn on sub ( msisdn );
    I perform SELECT query as the following:
    if (readPs == null) {
    String sqlQuery = "SELECT id, msisdn, name, balance, short_num, address, type, is_locked, " +
    "charging_profile_id, cos_id, currency_id, language_id FROM sub WHERE msisdn = ?";
    readPs = con.prepareStatement(sqlQuery, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
    readPs.setString(1, key);
    ResultSet rs = readPs.executeQuery();
    1million entries were provisioned via TT so I assume it's already there. I have 2 clients. Each one is connected to local TT instance. They read data from the same range so I assume there is a lot of data movement between TT instances. No specific value was set for PassThrough.
    I'll provide "ttIsql 'monitor'" information as soon as possible, can't perform it right now, sorry.
    Thanks!

  • Multiple select queries used in Excel BI report ,fetching data from Sharepoint DB(SP2010_Prod_ProjectServer) causing blockage on DB ,when more than one workbook(same copy of Excel BI Report) refreshed using Refresh All option.

    I am using mutiple select queries to fetch data from Project Server 2010 DB(its sharepoint DB) and these queries fetch data in Excel BI report by establishing connection with DB using instance name and all. I have enhance all these select queries and data
    is being fetched in secs. but when more than one copy of same Excel BI report is refreshed using 'Refresh All' option, then these select queries cause blockage on DB.
    Please let me know mitigation for this blockage issue.
    Should I use begin transaction and commit transaction statements/ shared lock statements.
    please reply

    Hi,
    run same query at the same time?

  • JDBC Sender Selects Queries

    I know that the JDBC sender adapter can handle joins, but can it handle more sophisticated SELECT queries such as subselects, group by, rownum, etc.  In other words, are there any limitations in the SELECT query?
    Thanks in advance.

    Hi Bevan,
    The only limitation with XI30-JDBC Sender Adapter is with Oracle Stored Procedure/Functions, as Oracle SP Query returns a cursor, and not a resultset.
    Thanks
    Prasad

  • Select queries

    Hi All,
    I have a program to be performance tuned. There are select queries on VBAP and BSEG which are taking time.
    The where condition includes maximum primary keys. But when I checked the data its fetching is very large.
    I have performance tuned another code and replaced the selects with FMs but now for VBAP and BSEG  I am not
    getting suitable FMs . Also some which I got are taking more time then the selects.
    Kindly suggest something.
    Thanks
    Moderator message - Please see Please Read before Posting in the Performance and Tuning Forum before posting - post locked
    Edited by: Rob Burbank on Mar 18, 2010 3:07 PM

    Hi,
    If you are giving All the fields of the table in the Second Query and trying to use CORRESPONDING FIELDS then second query will take more time, since here FILED names will be compared which is an extra operation if you use * instead it will just to BYTE copy which is faster.
    If you are giving only some fields of the table in the Second query then second query takes less time than First query.
    This is beacuse the amount of data that is transferred from Database server to Application server will be less in the second case if all fields of the table are not mentioned.
    Regards,
    Sesh

  • SELECT  QUERIES IN ABAP.....

    Can you give some idea about writing efficient select queries in ABAP?

    Hi kishan,
      i can give you some hint from one document, please reward point.
    The hit list is the set of rows determined by the WHERE clause. In other words, it is the set of table rows that the database system must take into account to respond to the query. Don’t confuse the hit list with the solution set, which is the set of rows (not necessarily from the table the query deals with) the database system returns to the program. Notice that in many cases the query’s hit list and the solution set are different.
    What is the reason behind this rule? A smaller hit list saves disk I/Os by the database system and often reduces network load. Both of these factors have a strong influence on your program’s runtime performance.
    How can you use ABAP to limit a hit list? First, use a WHERE clause whenever possible. Second, always try to describe the full search condition (not just part of it) within a single WHERE clause. ABAP provides a variety of arithmetical and logical operators to do this. Compared with your application program, the database server is usually the better place to evaluate search conditions.
    Let me give you an example: Run a query against the flight table to produce a list of all flight dates for Lufthansa flight 0300 in 1998. Air carrier and air connection are known and can easily be used within the WHERE clause of the SELECT statement. The relevant year is also given, but at first glance it is difficult to build an appropriate search condition. Faced with this situation, you could be tempted to use the ABAP CHECK statement.
    CHECK evaluates the subsequent logical expression. If it is true, the processing continues with the next statement. CHECK with a negative outcome terminates the current SELECT-ENDSELECT loop to start with the next row of the solution set, if there is one. Considering that fldateis a type D(YYYYMMDD) column of the sflighttable, a correct fragment of an ABAP program could look like this:
    SELECT fldate
      FROM sflight INTO xdate
      WHERE carrid = 'LH'
        AND connid = '0300'.
      CHECK xdate = '1998'.
        WRITE: / xdate.
    ENDSELECT.
    With ABAP in general, CHECK does the job of pattern matching in character variables. But in the WHERE clause of a SELECT statement, pattern matching also can be done easily by applying the LIKE operator. Within the search pattern, two characters have a particular meaning: “_” stands for any one character and “%” stands for any character string. With this in mind, a better solution would be:
    SELECT fldate
      FROM sflight INTO xdate
      WHERE carrid ='LH'
        AND connid ='0300'
        AND fldate LIKE '1998%'.
      WRITE: / xdate.
    ENDSELECT.

  • Dynamic select / function module for select queries

    Hello experts,
    Is there any function module to build dynamic select queries and also to build standard select queries .
    Thanks,
    krishnakumar

    What are you meaning by 'to build' ???
    BR, JAcek
    Message was edited by: Jacek Slowikowski

  • Union among multiple select queries with full outer join

    Hello everyone,
    I have 3 different select queries (used FULL Outer Join) which work fine. Now I want to add Union to the results among them and pick the selected columns from each query in the final result. while doing so, I am getting an error as "right parenthesis missing". I am quite sure, it is not the real cause. I guess might be issue with the query structure.
    select j.pod, j.hostname, portal.hostname,saasc.hostname,a3s.hostname from -- * from
    Select J.Pod,J.Hostname, P.Pod Portal_Pod,P.Hostname Portal_Hostname
    From Total_Pod J
    full outer join Portal_Tmp P On (J.Pod = P.Pod And J.Hostname = P.Hostname) as portal
    Union
    Select J.Pod,J.Hostname, s.Pod saasc_Pod,s.Hostname saasc_Hostname
    From Total_Pod J
    full outer join Saasc_Tmp S  On (J.Pod = s.Pod And J.Hostname = s.Hostname) as saasc
    Union
    Select J.Pod,J.Hostname, a.Pod a3s_Pod,a.Hostname a3s_Hostname
    From Total_Pod J
    Full Outer Join A3s_Tmp A  On (J.Pod = A.Pod And J.Hostname = A.Hostname) as a3s
    )p.s: select * from (INNER QUERY); also does not work.
    Any help appreciated.
    Thanks in advance.

    With T as
    (Select J.Pod,J.Hostname, P.Pod Portal_Pod,P.Hostname Portal_Hostname
    From Total_Pod J
    full outer join Portal_Tmp P On (J.Pod = P.Pod And J.Hostname = P.Hostname) ),
    U as
    (Select J.Pod,J.Hostname, s.Pod saasc_Pod,s.Hostname saasc_Hostname
    From Total_Pod J
    full outer join Saasc_Tmp S  On (J.Pod = s.Pod And J.Hostname = s.Hostname) ),
    V as
    (Select J.Pod,J.Hostname, a.Pod a3s_Pod,a.Hostname a3s_Hostname
    From Total_Pod J
    Full Outer Join A3s_Tmp A  On (J.Pod = A.Pod And J.Hostname = A.Hostname) )
    Select T.Pod,T.Hostname,nvl(T.Portal_Hostname,'Not Available') portal,nvl(U.Saasc_Hostname,'Not Available') saasc,NVL(V.A3s_Hostname,'Not Available') a3s From T,U,V
    Where T.Pod = U.Pod
    And U.Pod = V.Pod
    And T.Hostname = U.Hostname
    And U.Hostname = V.Hostname

  • Problem with select queries

    Dear Friends,
    I have written the below select queries to get the shipment details for a given date range.
    select vbeln lddat
      into table itab
      from likp
      where lddat in l_r_date2 .
      if not it_ldt[] is initial.
        select fknum fkpos rebel
        into table jtab
        from vfkn
        for all entries in itab
        where
        rebel = itab-vbeln.
      endif.
    First query is giving 82000 entries and second query is giving approx 60000 from the table VFKN( total entries in this table are 8 lakhs).
    Here the problem is second select query(for all entries select query) is taking a time of 3 to 4 hours.
    So please suggest me how can i reduce the time.
    Thanks and Regards

    Hi,
    Use FREE or PACKAGE size.
    Some steps that might make FOR ALL ENTRIES more efficient:
    Removing duplicates from the driver table Sorting the driver table
    If possible, convert the data in the driver table to ranges so a BETWEEN statement is used instead of and OR statement:
    FOR ALL ENTRIES IN i_tab
                      WHERE mykey >= i_tab-low and
                 mykey <= i_tab-high.
    Regards
    Krishna

  • Want to use ldb selection screen with select queries

    I want to use ldb selection screen with select queries since ldb having performance issue .How can I use the fields of the dynamic selection of LDB in the select queries

    Hi,
    Check the code snippet below: Here 'XXXX' is the table for your select query.
      DATA L_DS_CLAUSES TYPE RSDS_WHERE.
      MOVE 'XXXX' TO L_DS_CLAUSES-TABLENAME.
      READ TABLE DYN_SEL-CLAUSES WITH KEY L_DS_CLAUSES-TABLENAME
                                 INTO L_DS_CLAUSES.
      SELECT * FROM XXXX
              WHERE field1 IN ...
               AND   field2 ....
               AND (L_DS_CLAUSES-WHERE_TAB).
          PUT XXXX.
      ENDSELECT.
    You can also try using the FM 'RS_REFRESH_FROM_DYNAMICAL_SEL' passing SY-CPROG in curr_report and 'M'  for mode to get the dynamic selection screen values.
    Regards,
    Munesh.

Maybe you are looking for

  • How can I modify Finder to actually find my most recent files?

    The more I use Finder the more I realize it's pretty crappy. The "recent files" folder never actually shows any files. And when I create my own recent files saved search, it's hit or miss as to whether it actually shows my recent files. All I'm tryin

  • Download songs from my ipod into iphone

    I have my iTunes recognizing my iPhone now.  When I touch the iTunes icon it just open iTunes in general as if I would buy a song.  I just want to download my current songs onto my phone.  Feasible?

  • Problems connecting between ipad and hudl for vide...

    Hi, I've managed to video chat to my dad from an ipad to a hudl afew times since setting us both a skype account. I travelled to Turkey last week, and we could not manage to connect ok. My dad from the uk hudl got messages about connecting to a uk nu

  • Partial Sync with iPod / iTunes

    I'm a new iTunes user so apologies if this is a really simple question. I want to store all my albums on iTunes , but only have a 2GB iPod nano. When I connect my iPod, it tries to sync all the music in iTunes - when I exceed 2GB on iTunes it can't s

  • Iphone not recognised in lg home theatre system

    iphone not recognised in lg home theatre system