XSU and multiple tables

Hi,
So far I have success using XSU to store an XML file to a single table datawise where each element of the XML correspond to the field name of the table.
But I have couple of questions.
1. I am still using ROWSET and ROW tags in my XML. Can i change it to something meaningful say...PRODUCTS and PRODUCT respectively? If so how can i do that?
2. How do i stored an XML onto more than one table. Each PRODUCT have some linked information to be stored in another table. How can i do this?
Basically this time the XML will look somewhat like this:
<?xml version="1.0" ?>
<ROWSET>
<ROW num="0">
<BRAND>brand name</BRAND>
<CATEGORY>category</CATEGORY>
<ROWSET1>
<ROW1>
<MERCHANT>merchant name</MERCHANT>
</ROW1>
</ROWSET1>
</ROW>
</ROW>
</ROWSET>
Please help me. Thank you.
Regards,
Abdul Rasheed

Hi,
search this xml form for 'multiple tables' and you will learn a lot about it. it seems that using XSU you can only to save to one table or a view. Possible solutions are:
1. create a view over those tables. If your view is complex and not
updatable then you can use insteadof triggers with your
non-updatable view"
2. split your mutl-level XML to several single level XML files and save each xml seperately.
3. And another person was nice enough to mail me the following solution, which might be of help. i copy the mail here...
I saw your message in the XML oracle forum, and i've just finished a small project for my company in doing things like saving an XML document to a DB table.
I think that saving the XML document in one or many tables is not different because what you need is to build dynamic SQL queries to update your tables so you need to guess the setter part of the querry.
UPDATE my_table SET column1=value1,column2=value2... WHERE table_key=key_value.
the best way to do the job is to use an XSLT processor, you give it your XML document and an XSL document for filtering the output.
the output of the XSLT processor could look like:
<?xml version="1.0" ?>
<ROOT>
<TABLEROW table="table1">
<COLUMN1_1>value1_1</COLUMN>
</TABLEROW>
<TABLEROW table="table2">
<COLUMN1_2>value1_2</COLUMN>
</TABLEROW>
</ROOT>
now it's easier to guess the SQL queries all you have to do is to parse this output document and say in you code something like:
String[NBR_OF_TABLES] Queries;
int i=0;
-- Loop inside the xml document {
Queries="UPDATE ";
Queries[i]=+(curent_node.getAttribute("table")).getNodeValue();
-- Loop inside the curent node {
column_name=current_node.getNodeName();
column_value=curent_node.getChild().getNodeValue();
Queries[i]=+" SET "+column_name+"="+column_value; //FIRST TIME
Queries[i]=+","+column_name+"="+column_value; //2,3,4...
you may need some type conversion, from string to numbers,and dates, and the WHERE part of the query is up to your indexation mecanism
of course you can put the tables primary keys values and names rigth in the yout XML document.
and last you simply execute the Array of queries you have:
for (int i=0i<NBR_OF_TABLES;i++)
execute(Queries[i]) .
hope this helps.
abdul rasheed

Similar Messages

  • SQL Loader and multiple tables

    I know how to load multiple tables using the same set of data, but is it possible to load multiple tables using a different set of data for each table? Can someone point me to an example or tell me how to set up the ctl file.
    Thanks.

    http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10825/ldr_control_file.htm#sthref852
    Distinguishing Different Input Record Formats
    A single datafile might contain records in a variety of formats. Consider the following data, in which emp and dept records are intermixed:
    1 50   Manufacturing       &#8212; DEPT record
    2 1119 Smith      50       &#8212; EMP record
    2 1120 Snyder     50
    1 60   Shipping
    2 1121 Stevens    60
    A record ID field distinguishes between the two formats. Department records have a 1 in the first column, while employee records have a 2. The following control file uses exact positioning to load this data:
    INTO TABLE dept
       WHEN recid = 1
       (recid  FILLER POSITION(1:1)  INTEGER EXTERNAL,
        deptno POSITION(3:4)  INTEGER EXTERNAL,
        dname  POSITION(8:21) CHAR)
    INTO TABLE emp
       WHEN recid <> 1
       (recid  FILLER POSITION(1:1)   INTEGER EXTERNAL,
        empno  POSITION(3:6)   INTEGER EXTERNAL,
        ename  POSITION(8:17)  CHAR,
        deptno POSITION(19:20) INTEGER EXTERNAL)

  • CMP Entity Beans and multiple tables

    Hi All,
    Is it possible to have a CMP Entity Bean retrieve attributes from multiple tables
    (using table join), and populate attributes from columns in both tables?
    If yes, how do we configure the same in configuration xml files.
    Is there any special handling required for this in the bean itself?
    Thanks,
    Prabh

    Hi All,
    Is it possible to have a CMP Entity Bean retrieve attributes from multiple tables
    (using table join), and populate attributes from columns in both tables?
    If yes, how do we configure the same in configuration xml files.
    Is there any special handling required for this in the bean itself?
    Thanks,
    Prabh

  • Spreadsheet and multiple table control

    Hello everyone,
    How can we write multiple table controls to a single spreadsheet? say i have 2 table controls. I need to write table control 2 1st and below that I have to write table control 1. How can it be done..?
    Thanking you,
    Sushmith

    I think this might help you.
    Need not to do much just need to explore things
    One suggestion be clear with your question
    =========================================
    Please remember to accept a solutions and show your appreciation by giving Kudos to helpful messages...
    Mangesh D.
    CLAD | Project Engineer
    ==
    VIPM, LabVIEW 8.2, 2009, 2011SP1, 2012, 2012SP1, 2013, cRIO,cDAQ, PXI, ELVIS, Multisim, Smart Camera....

  • Help with multiple table joins

    I'm trying to limit the results of a query joining multiple tables. I have a main table, tbl_webrequests, and multiple tables with supporting information. The unique column for tbl_webrequests is reqID. There is another table, tbl_instructions, that holds all the instructions tied to each request. I join the tables using reqID.
    I'm trying to construct a page that has all of the records in tbl_webrequests. The problem I'm having is that with each request that has multiple instructions, I have multiple results because of the multiple instructions for one reqID. For now, all I want is the original instruction to display. Below is the original query, and below that is what I'm trying to get the query to do for each record in tbl_webrequest. Note that 319 is a random uniqueID in tbl_webrequests.
    SELECT
    DISTINCT W.reqID, W.dt_close, W.dt_due, W.subject, W.statusid, W.empID, W.priorityid, W.assigneeid, W.categoryid, W.url, W.hrs,
    W.closingNotes, W.mins, W.requestTypeID, I.instructions, I.instID
    from tbl_webrequests W left join
    (select reqID, instID, instructions from tbl_instructions) I on W.reqID = I.reqID
    ORDER BY I.instID asc;
    SELECT
    distinct I.instructions, I.instID, W.reqID, W.dt_close, W.dt_due, W.subject, W.statusid, W.empID, W.priorityid, W.assigneeid, W.categoryid, W.url, W.hrs,
    W.closingNotes, W.mins, W.requestTypeID
    from tbl_webrequests W left join
    (select reqID, instID, instructions from tbl_instructions where rowNum = 1 and reqid = 319 order by instID asc) I on W.reqID = I.reqID
    where W.reqID = 319
    ORDER BY I.instID asc;
    My question is, how do I pass the reqID as a variable into the join subquery so that the query returns only returns the first joined item in tbl_instructions for each record in tbl_webrequests?
    Any help is appreciated
    Thanks!

    Scrap the "DISTINCT" and try something like this:
    Select
           I.Instructions, I.Instid
         , W.Reqid, W.Dt_Close, W.Dt_Due, W.Subject, W.Statusid, W.Empid, W.Priorityid
         , W.Assigneeid, W.Categoryid, W.Url, W.Hrs, W.Closingnotes, W.Mins, W.Requesttypeid
      From Tbl_Webrequests W Left Join
         ( Select Reqid, Instid, Instructions
             From Tbl_Instructions I0
            Where Instid = (Select Min(Instid) From Tbl_Instructions I1
                             Where I1.Reqid = I0.Reqid)
         ) I On W.Reqid = I.Reqid
    Where W.Reqid = 319
    Order By I.Instid Asc;;)

  • Search a text in a multiple tables and one table has BLOB column

    Hi,
    I couldn't find a solution/examples for below scenario in oracle text documentation or related forums.
    I need to search a text in a multiple tables,in that one table has blob column which is used to store the documnents(pdf,doc,jpg..etc) and other tables have varchar2 columns,These tables have realation each other.
    Please provide a sample examples for above scenario.
    Thanks in advance..

    Have a look at my blog entry here:
    https://blogs.oracle.com/searchtech/entry/indexing_data_from_multiple_tables
    That describes two methods of achieving what you are looking for.

  • Can VLOOKUP, OFFSET, INDEX and MATCH be used to SUM the value of cells from multiple tables?

    I have a problem thats needs a sulution. I have a Spreadsheet with multiple sheets and tables. The (Truck ) Sheets each represent a "Site" and the tables within from 1-31 show inventory counts for each day of the month.
    Shown below are Edited example's of a "Site" sheet and the Day tables contained within it.
    The Spreadsheet expands as a new "Site" (Truck ) is added regularly. Currently there are 30 "Sites" (Trucks).
    Also within the spreadsheet is a sheet (Checkpoint) which contains tables used to show summary data for each "Site" sheet. There is one table used to review one site, so currently there are 30 tables identical in format and structure reviewing 30 sites.
    An edited example of the summary table for Truck 1 is shown below.
    The table's in CP reference data within cells from other sheets. A LEN INDIRECT formula
    =IF(LEN(INDIRECT("Truck 1::Day "&COLUMN(cell)−3&"::K53",addr-style))<1,"",INDIRECT("Truck 1::Day "&COLUMN(cell)−3&"::k53",addr-style))
    was used to retrieve the values within certain cells. This formula works perfectly because when I add another "Site" I simply need to Dupicate a "Site" Template Sheet and then Copy Paste the LEN INDIRECT formula in to the newly created Summary table. 
    There is another sheet (Command Central) which contains a Master summary table. The Master Summary sheet is identical in structure to the CP Summary Tables. Its purpose is to show the combined data from the tables within Checkpoint (Truck 1-30). for instance MS::D5=Checkpoint::Truck 1:Truck 30::D5. I realize that Numbers cannot calculate cells within a range of table so I am hoping for a workaround. 
    Could someone please help me with a formula something like the LEN INDIRECT formula mentioned above or possible a something else that could work beside
    D5=Truck 1::D5,Truck 2::D5,Truck 3::D5...?
    When I use that formula type I will have to edit the formula every time I add a new site.
    Anothe issue Im having is getting D3:AH3 to show the correct count of names. I am using the following formula:
    D3=SUM(COUNTA(Truck 1::D3,Truck 2::D3,Truck 3::D3,Truck 4::D3))−SUM(COUNT(UNION.RANGES(Truck 1::D3,Truck 2::D3,Truck 3::D3,Truck 4::D3)))
    The cells it is counting are either blank (the refenced cell contains a LEN INDIRECT formula that places "" if needed) or contain a name. This formula works when I and addressing cells without the LEN INDIRECT formula. What am I doing wrong?

    Hello Wayne,
    Here are screenshots of the tables in question. The first on is the Master summary table.
    Cell D5 shows the value pulled from Checkpoint::Truck 1::D5
    Cell E5 shows the value pulled from Checkpoint::Truck 2::D5
    Cell F5 shows the value pulled from Checkpoint::Truck 3::D5
    Cell G5 shows the value pulled from Checkpoint::Truck 4::D5

  • User Datastore for multiple tables and columns!

    Hi,
    I hop so much, someone can help me.
    I've made a user datastore to index multiple columns of multiple tables.
    Now, the Documentation of Oracle explains the idexing of one table.
    I have multiple tables, which have all, the columns descr and tagnr. I want to make a query sth like this:
    select table1.column, table2.columnd... where contains(indexed field,'gas within descr',1)>0
    is it possible to index 4 seperate tables, without having a collective key? I dont want to make a Concatenated Datastore.
    I have wrote this code.
    But it doesn't work. It's been compiled fine. But I don't get any result with my queries.
    create or replace
    procedure My_Proc_Wide
    Must be in ctxsys schema.
    In a full-scale example, this would be a wrapper
    for a proc in the user schema.
    rid in rowid,
    tlob in out NOCOPY clob /* NOCOPY instructs Oracle to pass
    this argument as fast as possible */
    is
    v_descr varchar2(80);
    v_tagnr varchar2(30);
    v_descr_name constant varchar2(20) := 'descr';
    v_descr_start_tag constant varchar2(20) := '<' || v_descr_name || '>';
    v_descr_end_tag constant varchar2(20) := '</' || v_descr_name || '>';
    v_tagnr_name constant varchar2(20) := 'tagnr';
    v_tagnr_start_tag constant varchar2(20) := '<' || v_tagnr_name || '>';
    v_tagnr_end_tag constant varchar2(20) := '</' || v_tagnr_name || '>';
    v_buffer varchar2(4000);
    v_length integer;
    begin
    /* verify the env which called this */
    if Dbms_Lob.Istemporary ( tlob ) <> 1
    then
    raise_application_error ( -20000,
    '"IN OUT" tlob isn''t temporary' );
    end if;
    /* the real logic */
    /* first tabel to be indexed */
    select t1.tagnr, t1.descr
    into v_tagnr, v_descr
    from tweb.pdp_positions t1
    where t1.rowid = rid;
    v_buffer := v_tagnr_start_tag ||
    v_tagnr ||
    v_tagnr_end_tag ||
    v_descr_start_tag ||
         v_descr ||
         v_descr_end_tag;
    v_length := length ( v_buffer );
    Dbms_Lob.WriteAppend(tlob, length(v_buffer) + 1, v_buffer || ' ');
    /* second table to be indexed */
    select t2.tagnr, t2.descr
    into v_tagnr, v_descr
    from tweb.pdp_schema_equ t2
    where t2.rowid = rid;
         v_buffer := v_tagnr_start_tag ||
    v_tagnr ||
    v_tagnr_end_tag ||
    v_descr_start_tag ||
         v_descr ||
         v_descr_end_tag;
    v_length := length ( v_buffer );
    Dbms_Lob.WriteAppend(tlob, length(v_buffer) + 1, v_buffer || ' ');
    /*third table to be indexed */
    select t3.tagnr, t3.descr
    into v_tagnr, v_descr
    from tweb.pdp_equipment t3
    where t3.rowid = rid;
         v_buffer := v_tagnr_start_tag ||
    v_tagnr ||
    v_tagnr_end_tag ||
    v_descr_start_tag ||
         v_descr ||
         v_descr_end_tag;
    v_length := length ( v_buffer );
    Dbms_Lob.WriteAppend(tlob, length(v_buffer) + 1, v_buffer || ' ');
    /* fourth table to be indexed */
    select t4.tagnr, t4.descr
    into v_tagnr, v_descr
    from tweb.pdp_Projcode t4
    where t4.rowid = rid;
         v_buffer := v_tagnr_start_tag ||
    v_tagnr ||
    v_tagnr_end_tag ||
    v_descr_start_tag ||
         v_descr ||
         v_descr_end_tag;
    v_length := length ( v_buffer );
    Dbms_Lob.WriteAppend(tlob, length(v_buffer) + 1, v_buffer || ' ');
    end My_Proc_Wide;
    what have I to do, to make this work?
    Any Help would be appriciated!!
    Kind Regards,
    Arsineh

    Arsineh,
    I realise that it has been quite some time since you posted this question but I thought I'd reply just in case you never did manage to get your user datastore working.
    The reason your procedure will not work is simple. A user datastore procedure accepts a rowid input parameter. The rowid is the ID of the row that Oracle Text is currently trying to index. In the example you have given, you are attempting to use the supplied rowid as the primary key for multiple tables, this will simply never work as the rowid's across multiple tables will never correspond.
    The best way to achieve your goal is to create the index on a master table which contains the common primary keys for each of your four tables e.g.
    MASTER_TABLE
    COL:COMMON_KEY (NUMBER(n))
    COL:USER_INDEX_COLUMN (VARCHAR2(1))
    If you create the user datastore index on the MASTER_TABLE.USER_UNDEX_COLUMN column your stored proc simply needs to read the correct row from the MASTER_TABLE (SELECT t.common_key into v_CommonKey FROM master_table t WHERE t.rowid = rid) and issue subsequent queries to extract the relavant data from the t1..t4 tables using the common key e.g.
    SELECT t1.tagnr, t1.descr into v_tagnr, v_descr FROM t1 WHERE t1.[PRIMARY_KEY_FIELD] = v_CommonKey;
    SELECT t2.tagnr, t2.descr into v_tagnr, v_descr FROM t2 WHERE t2.[PRIMARY_KEY_FIELD] = v_CommonKey;
    and so on...
    Hope this helps
    Dean

  • Crystal Reports and connecting to multiple tables in a dataset - I'm Going Crazy!!

    This is my first application, first report and first everything.  Wouldn't you know the report I am trying to produce is probably more difficult!!  What is happening is that I have a form(screen) up in my application with the information displayed on it from a recrod in a table that I want to put on a report to be view and/or printed and eventually down the road I want to incorporate a signature.  One step at a time though, here is what I have accomplished.  I have created the report, I have gotten it to display in the viewer but it will not push the data from the table that I want displayed.  It only displays the text that I have typed on the form.  This is a Visual Basic application created in Visual Studio 2005 using a SQL database.  If you need more information then just ask and I will try to fumble through and tell you what I know.  (Oh and to top it off............I am also trying to get information to display from other tables also (codes connected to descriptions etc.))
    Any help would be really appreciated as I have went through tutorials, read white papers, tech notes and anything else I can find but I just can't get it to work!!
    Thanks!

    You do need to give more information. To better help, we would need to know the database, when you say SQL do you mean SQL Server, how you created the dataset, whether there are multiple tables in a single dataset or multiple datasets, etc.
    The report appears to be running so the underlying issue as you know will likely be the dataset. You may want to confirm the dataset does in fact have data in it.  Returning a simple count will let you know there are rows. If you used the components rather than code to create the objects you can also see the data returned in the fill process.
    Once you know you have data in the dataset, you can check your reports connection to the dataset.
    Just hang in there... the problem is probably a simple fix. I am sure others will follow on with more suggestions.
    Regards,
    John W.

  • ALV for fields from multiple tables and make them editable

    Hi,
    I am working on a forecasting report. We have created few custom table e.g. store forcaset detail for whole year month wise. tables are say sales data, budget data, forcast data etc.
    Now i need to make a report based on monthwise based on above mention table.
    eg.o/p looks like:
    column name                     type desc monthapr monthmay .......
    table forcast                      Qty  sales    100          150
    table budget/sales             amt   amou    20.50    130.50
    table sales vs forcast       amt   amount  3000     50000
    -Now i don't know how to display data from multiple table in single ALV list that to with different field type.
    -2nd issue is i need to make only perticuler row editable so that user can chage data.
    -3rd when user change data and press calulate button - it should calculate data for future month - i got formula for that and disply the calulated data.
    - 4th if user like the forcast data then when press save - change data should update dbtable.
    Is this all possible with simple abap FM Or need to use ABAPOO.
    I will appericiate all expert help.
    Many thanks in advance.
    KDE.
    Edited by: kde_test on Jun 4, 2010 5:44 PM

    Hi,
    Solutions :
    1. You can use  FM REUSE_ALV_HIERSEQ_LIST_DISPLAY as guided by Ashutosh.
    You can also check out this
    [http://www.sap technical.com/Tutorials/ABAP/3DGraph/demo.htm]  change link to saptechnical without space
    2. [How to make certain rows in ALV grid editable...;
    3 & 4. Use two importing paramaters 'PF_STATUS_SET' 'USER_COMMAND' of  REUSE_ALV_GRID_DISPLAY.
    create two function codes 'CALC and 'SAVE' in pf-status and provide your required functionality to these function codes using User-Command.
    Sorry am unable to provide you with supporting code, but you can search for it and It can solve your problem
    Regards,
    Rohit

  • DBMS_FGA.add_policy .. How to handle multiple tables and multiple users

    Dear All,
    My database is 11gR1 and Linux is the platform.
    I have more then 50 very important tables and around 15 database users.
    I want to implement fine grained auditing on these important tables.
    This is how I am going to implement it:
    SQL>BEGIN
    DBMS_FGA.add_policy(
    object_schema     =>     'Scott',
    object_name     =>     'SAL',
    policy_name     =>     'SALARY_CHK_AUDIT',
    audit_condition     =>     NULL,
    handler_schema     =>     'imran',
    statement_types     =>     'SELECT,INSERT,UPDATE,DELETE',
    audit_column     =>     NULL);
    END;
    what is i have to pass multiple tables in object_schema and multiple users in handler_schema.
    I hope i am able to clear my question, any doubts please let me know.
    Regards, Imran

    Hi,
    object_schema - The schema of the object to be audited. (If NULL, the current log-on user schema is assumed.)
    in case if you like to audit for multiple users - then try to test by holding a null value and test access the important tables -where the relevant auditing records are generated as per your requirement or not. i have not tested.. try it
    - Pavan Kumar N

  • Multiple tables and templates in a main window

    Hi,
    Is it possible to have multiple tables and templates in a main window of a smartform?
    If so then how they are positioned in the main window? Means which table to come first and which to be the next?
    Thanks in advance.........
    Prinan

    Hi!
    both tables and templates can be printed any number of times ina  main window.
    The tables as in sequence are printed...after ending with the first it gets on to the another.
    If u want to print it under some cdonditions you can do it using the condition tabs.As per it is a main window the dats gets flowing to the next page so as the order goes thae data goes on printed.
    Regards.

  • Parked MM invoice and multiple account assignments (table RBCO) ?

    Hi.
    Could someone please explain how the table RBCO works for parked MM invoice and multiple account assignments.
    What I have observed in this table are:
    1. Every position (table RSEG)  in the invoice can have several lines (table RBCO) with account assignment.
    2, If there is only one record for a position, the key in the table RBCO starts with 0002, field RBCO-COBL_NR (???)
    3. IF I add one more line to the psoition, the first line CHANGES the key in table RBCO from 0002 to 0001 and the second line gets RBCO-COBL_NR = 0002
    4. The third line gets 0003.
    5. If i delete line 1-2, the remaining one line gets a new key feild RBCO-COBL_NR = 0002.
    The reason for understanding how this works is that i need to make a Z-table storing the history of changes done to records in table RBCO (..don’t ask why...)
    Lest say, I make a change for in an invoice for one of the positions, how do I compare the values in the itab, YDRSEG[]-CO[]- with the lines in table RBCO ?
    And whats the logic for the key in table RBCO?
    Please advice, Tom

    -

  • Toggling between single and multiple selection in a table

    I am working on ADF faces. I need to switch between single and multiple selection in <af:table based on a button I select.
    I cannot use switcher or rendered property inside <af:table. Only the first one is rendering the second one is not rendering based on the switch
    <f:facet name="selection">
    <af:tableSelectMany autoSubmit="true"
    rendered="#{treeBean.multipleRows}"/>
    </f:facet>
    <f:facet name="selection">
    <af:tableSelectOne autoSubmit="true"
    rendered="#{treeBean.singleRows}"/>
    </f:facet>
    When I use inside the switcher, it doesn't like the parent.
    Any ideas would be greatly appreciated.
    Thanks,
    Vijay.

    I have probably misunderstood what your issue is. I do not know what your version of ADF faces is. Here is some sample code working with my version. Please check if your jdev has "rowSelection" attribute. If it has, please try my sampe code
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:afh="http://xmlns.oracle.com/adf/faces/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces">
    <jsp:directive.page contentType="text/html;charset=utf-8"/>
    <f:view>
    <af:document title="tableSelectMany Demo">
    <af:form>
    <af:panelGroup layout="vertical">
    <af:messages/>
    <af:selectOneChoice value="#{sessionScope.tableSelection}"
    autoSubmit="true"
    id="selType"
    label="Selection Type">
    <af:selectItem label="Single" value="#{null}"/>
    <af:selectItem label="Multiple" value="#{true}"/>
    </af:selectOneChoice>
    <af:table summary="Periodic table"
    binding="#{tableActions.table}"
    partialTriggers="selType"
    rowSelection="#{sessionScope.tableSelection ? 'multiple' : 'single'}"
    value="#{periodicTable.tableData}" var="row" rows="10">
    <af:column>
    <f:facet name="header">
    <af:outputText value="Name"/>
    </f:facet>
    <af:outputText value="#{row.name}"/>
    </af:column>
    <af:column>
    <f:facet name="header">
    <af:outputText value="Symbol"/>
    </f:facet>
    <af:outputText value="#{row.symbol}"/>
    </af:column>
    <af:column>
    <f:facet name="header">
    <af:outputText value="Action Column"/>
    </f:facet>
    <af:commandButton immediate="true" text="Action"
    action="#{row.action}"/>
    </af:column>
    </af:table>
    </af:panelGroup>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>

  • Dbms_xmlgen.newcontext query from multiple tables and ||

    I have two questions
    How do I get a dbms_xmlgen.context to query from multiple tables? I have been able to make it work with using one table only, but not with multiple tables.
    And how to get the || (concat) to work within my query for my output to an xml file?
    Here is my current query:
    create or replace function get_xml return clob is
    result clob;
    qryctx dbms_xmlgen.ctxHandle;
    SELECT DBMS_XMLGEN.getxml('select prefix, suffix, fiscal_yr
    FROM rcv.recv_accessions ra
    where ra.prefix = 8 and ra.fiscal_yr = 11')xml into result FROM dual;
    result := DBMS_XMLGEN.getXML(qryCtx);
    This is what I desire:
    SELECT DBMS_XMLGEN.getxml('select ra.prefix||'-'|| ra.suffix||'-'|| ra.fiscal_yr accession, ss.date_in, st.test
    FROM rcv.recv_accessions ra, ser.sero_samples ss, ser.sero_tests st
    where ra.prefix = 8 and ra.fiscal_yr = 11 and ss.raid = ra.id and st.ssid = ss.id')xml into result FROM dual;
    On this both the reference to multiple tables and the concat function cause errors.
    Thank you
    Edited by: user583094 on Mar 2, 2011 3:36 PM

    Hi,
    for the concat do I use xmlconcat?No, XMLConcat is used to concatenate XMLType fragments.
    The || operator will do fine, but you must escape any single quote inside the string :
    SELECT DBMS_XMLGEN.getxml(
    'SELECT ra.prefix ||''-''|| ra.suffix ||''-''|| ra.fiscal_yr as accession,
            ss.date_in,
            st.test
    FROM rcv.recv_accessions ra,
          ser.sero_samples ss,
          ser.sero_tests st
    WHERE ra.prefix = 8
    AND ra.fiscal_yr = 11
    AND ss.raid = ra.id
    AND st.ssid = ss.id'
    INTO result
    FROM dual;Or, use the quoting operator to define a custom string delimiter :
    SELECT DBMS_XMLGEN.getxml(
    q'{SELECT ra.prefix ||'-'|| ra.suffix ||'-'|| ra.fiscal_yr as accession,
            ss.date_in,
            st.test
    FROM rcv.recv_accessions ra,
          ser.sero_samples ss,
          ser.sero_tests st
    WHERE ra.prefix = 8
    AND ra.fiscal_yr = 11
    AND ss.raid = ra.id
    AND st.ssid = ss.id
    INTO result
    FROM dual;BTW, a good practice would be to use bind variables for the query. DBMS_XMLGEN can handle them nicely :
    CREATE OR REPLACE FUNCTION get_xml
    RETURN CLOB
    IS
    qryctx   DBMS_XMLGEN.ctxHandle;
    v_out    CLOB;
    qrystr   VARCHAR2(4000) :=
    'SELECT ra.prefix ||''-''|| ra.suffix ||''-''|| ra.fiscal_yr as accession,
            ss.date_in,
            st.test
    FROM rcv.recv_accessions ra,
          ser.sero_samples ss,
          ser.sero_tests st
    WHERE ra.prefix = :b_prefix
    AND ra.fiscal_yr = :b_fiscal_yr
    AND ss.raid = ra.id
    AND st.ssid = ss.id';
    BEGIN
    qryctx := DBMS_XMLGEN.newContext(qrystr);
    DBMS_XMLGEN.setBindValue(qryctx, 'b_prefix', '8');
    DBMS_XMLGEN.setBindValue(qryctx, 'b_fiscal_yr', '11');
    -- to generate empty elements if necessary :
    DBMS_XMLGEN.setNullHandling(qryctx, DBMS_XMLGEN.EMPTY_TAG);
    v_out := DBMS_XMLGEN.getXML(qryctx);
    DBMS_XMLGEN.closeContext(qryctx);
    RETURN v_out;
    END;

Maybe you are looking for

  • Cant send email from new iphone

    Hey I hope the following will make sense.? I got an new phone and have "added" my hotmail account to the mail. It accepts my email address and password. I can receive emails however I am unable to send emails. When I attempted to send an email a mess

  • Audio back-up software... Is Time machine an option?

    Here's what's up... I'm currently installing and re-authorizing everything under the sun, on my new 8 core mac. One bit of software that I really made a lot of use of was LaCie's Silver keeper. It allowed me to keep a "list" of the 20 songs I was cur

  • Right-click Google search - put in new tab or window??

    Safari has a feature that allows one to right-click on some text and then Google that text. When using that feature, it Googles the text, but the new webpage of the Google search for that text appears in the same browser window that one was originall

  • App Server and Process Scheduler stuck while booting

    Hi All, We are facing a big issue in our production instance.The application server showed down while accessing the PIA.When we tried to reboot the same it didnt start and was getting stuck after some steps..few snipets are below after the last PSSRE

  • When queried v$dataguard_stats results no rows selected at standby db?

    Hi Chaps, I have oracle database 10g 10.2.0.4.0 on AIX version 5.3 I am curious about standby database that whether it is in sync with the primary database or not? when I queried at standby to know dataguard stats the result was 'no rows selected' SE