Query Hire date in a PCR

Hi,
Could you help me in querrying hire date in a PCR.
I need to differentiate b/w EEs who joined from 1st-15th of a month to the ones who joined in the later part of the month.
Any help is highly appreciated.

Hi,
what about this quick idea - use VARSTREDAY in PCR rule and make 01, 02, . . . .31 as a result from query. Continue with wtriting the rows and choose some time type. Store the value 1 into the time type. Then put a HRS query with the chosen time type before the VARST - it will prevent the rule to check itself over again. Store the time type into SALDO. If you generate qoutas according to some time types, then the time type can also be stored in the PCR rule with Varst. Then you need to solve roll-over if the qouta needs to be generated the next year.
ex.
HRS=BZZZ1
HRS?1
= nothing
VARSTREDAY
01 HRS=1
01 ADDDBZZZ1
01 HRS=1
01 ADDDBQBAS (time type for qouta base)
It is not some smooth solution but it should work.
Cheers
xDracula

Similar Messages

  • How to calculate number of days between fixed date and hire date in schema

    i want to calculate the number of days between a fixed date en the hire date (infotype 041)
    If i read the documentation  right, i should use the following command:
    HRS=YDXA02
    Variable 3 (the x) is the fixed data.
    My question is how do i program the variable x?
    Let's say the date 01.01.2008
    Any help would be welcome

    I assume we are talking about PCR for payroll. In this case look at documentation for operation NUM:
    OOOOOO
    Xnnnnn
    X     Table
    nnnnn Table field
    nn    Date type 'nn' from the Date Specifications infotype (0041)
         Date types are taken from table T548Y.
    Your operation would look like:
      NUM=Faaesb
          F          Fixed indicator for deadline calculation
           aa           Date type: Start date of period to be
                        calculated; if the date type is not 'nn,'
                        the second position is left blank.
             e          Unit, in which the duration is calculated:
                        T = days
                        W = week
    s         End date of period to be calculated:
              (blank)  End of current payroll period
              J        End of current calendar year
              A        Start of current calendar year
              B        Start of WPBP period
             No other specifications are possible.
    So it depends on what kind of fixed date you need.
    Hope it helps,
    Carlos.

  • HR-PA Personnel Administration Adjusted Hire date not in std extractor?

    All,
    Does anybody know if the dates in PA0041, like adjusted hire date, Original hire date, Severance date, etc are available in extractors?  I have been doing BW for some time, but am new to HR.  I don't want extend the 0employee data source with these dates unless I have to.  Any advice would be greatly appreciated.
    Kind Regards,
    Chris

    Savornin,
    Thank you very much for your reply.  It was very helpful to me.
    Kind Regards,
    Chris

  • How to compare result from sql query with data writen in html input tag?

    how to compare result
    from sql query with data
    writen in html input tag?
    I need to compare
    user and password in html form
    with all user and password in database
    how to do this?
    or put the resulr from sql query
    in array
    please help me?

    Hi dejani
    first get the user name and password enter by the user
    using
    String sUsername=request.getParameter("name of the textfield");
    String sPassword=request.getParameter("name of the textfield");
    after executeQuery() statement
    int exist=0;
    while(rs.next())
    String sUserId= rs.getString("username");
    String sPass_wd= rs.getString("password");
    if(sUserId.equals(sUsername) && sPass_wd.equals(sPassword))
    exist=1;
    if(exist==1)
    out.println("user exist");
    else
    out.println("not exist");

  • How can I do for a row of a query be data provider for a variable?

    Hi friends, I have a problem !
    How can I do for a row of a query be data provider for a variable?
    I need that a value of variable be stored when the user select a row in a query. At the BPS we can do this configuring the variable selector in WIB, and in a WAB how I can do this ?
    Best regards,
    Gustavo Liberado

    In this case when I press the key to call other forms I need to wait for the response in the secondary form and then process the result.That is exactly what a "modal JDialog" (or JOptionPane) are used for.
    Try it. Create a short demo program. All you need is a JFrame with a single button to show the modal dialog. All you modal dialog needs is a single button to close the dialog. After you show the modal dialog add a System.out.println(...) statement in your code and you will see that it is not executed until the dialog is closed.
    Then once you understand the basics you add the code to your real program.
    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
    Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.

  • An error occurred querying a data source - with REST services

    Hi,
    I have a SharePoint 2013 form library library with an info-path form. I need to get the logged in user's 'Display Name' on my form load automatically.
    I used REST service to fetch the current user details. In the preview mode of the form, its showing the right name. But when I publish this form to library I am getting the following error.
    REST Service --> http://site url/_api/SP.UserProfiles.PeopleManager/GetMyProperties
    Please help me to resolve this issue.
    Thanks in advance for your time and reply :)

    Hi,
    According to your post, my understanding is that an error occurred querying a data source with REST services.
    It is defiantly permission issue with GetUserProfileByName service
    and could be many reasons of this problem. You first try with UDCX file and make sure that UPS is running.
    Here are some similar threads for your reference:
    http://social.technet.microsoft.com/Forums/en-US/b8c668ea-7511-4657-a1a8-08fb4a6bd53d/info-path-an-error-occurred-querying-a-data-source?forum=sharepointcustomizationprevious
    http://social.technet.microsoft.com/Forums/en-US/46866ac2-da09-4340-a86a-af72cbb2c8d7/info-path-an-error-occurred-querying-a-data-source-?forum=sharepointcustomization
    http://blogs.msdn.com/b/russmax/archive/2012/08/17/want-to-call-sharepoint-2010-web-services-within-browser-based-infopath-2010-forms.aspx
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Error occurred querying a data source in office 365.

    I have created a simple infopath form and in one of my dropdown box  i am receiving the REST services. 
    when i run the infopath form 2013 in preview it was running good but when i upload it on to office 365 cloud it's showing me error. i had converted the services into UDL and save it on Data connection Library and it's approved.
    Warning
    Click OK to resume filling out the form. You may want to check your form data for errors.
    The entry has been added to the Windows event log of the server.
    log ID:5566
    Correlation ID:feb08a9c-9d47-30f5-5d89-60340242d6d1.

    Hi,
    According to your post, my understanding is that you got error when querying a data source in office 365.
    Per my knowleadge, we cannot connect to SharePoint Web Services from InfoPath Forms within SharePoint Online.
    Loopback protection is enabled on the SharePoint Online environment and will block calls to SOAP and REST from InfoPath Form Services.
    For more information, you can refer to:
    Error message when you connect an InfoPath form to a SharePoint Online web service: "An error occurred while connecting to a Web Service"
    As a workaround, to look up data for some dropdowns from several external REST Web Services, we need to have a Data Connection library in your Site Collection in which to store the UDCX files.
    The steps seem to be:
    Create a Data Connection Library in your Site Collection
    In the InfoPath ribbon, go to Data, then Data Connections. Your existing data connections should be listed.
    Choose the data connection which is hosted on a different domain.
    Clink the
    Convert to  Connection File… button
    In the location selector, specify the path to the Data Connection Library you created above.
    Leave the
    Relative to  site collection (recommended) radio button selected.
    Click OK
    Here is a great blog for your reference:
    InfoPath 2013 Forms on Office365 with External REST DataSources
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Query xml data from a CLOB datatye

    All,
    I read in an oracle white paper that is is possible to query XML data from CLOB datatype using oracle text index using operators HASPATH() and INPATH(). I am not able to find any example on how to do this. Can someone please post a simple example here.
    Thank You very much!

    SCOTT@10gXE> CREATE TABLE your_table (id NUMBER, xml_data CLOB)
      2  /
    Table created.
    SCOTT@10gXE> INSERT INTO your_table (id, xml_data)
      2  SELECT t.deptno,
      3           DBMS_XMLGEN.GETXML
      4             ('SELECT d.dname,
      5                   CURSOR (SELECT e.ename, e.job
      6                        FROM   emp e
      7                        WHERE  e.deptno = d.deptno) emp_data
      8            FROM   dept d
      9            WHERE  d.deptno = ' || t.deptno)
    10  FROM   dept t
    11  /
    5 rows created.
    SCOTT@10gXE> COMMIT
      2  /
    Commit complete.
    SCOTT@10gXE> begin
      2    ctx_ddl.create_section_group('xmlpathgroup', 'PATH_SECTION_GROUP');
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> CREATE INDEX myindex
      2  ON your_table(xml_data)
      3  INDEXTYPE IS ctxsys.context
      4  PARAMETERS ('datastore ctxsys.default_datastore
      5              filter ctxsys.null_filter
      6              section group xmlpathgroup'
      7            )
      8  /
    Index created.
    SCOTT@10gXE> SELECT * FROM your_table
      2  WHERE  CONTAINS (xml_data, 'PERSONNEL INPATH (//DNAME)') > 0
      3  /
            ID XML_DATA
            50 <?xml version="1.0"?>
               <ROWSET>
                <ROW>
                 <DNAME>PERSONNEL</DNAME>
                 <EMP_DATA>
                 </EMP_DATA>
                </ROW>
               </ROWSET>
    SCOTT@10gXE> SELECT * FROM your_table
      2  WHERE  CONTAINS (xml_data, 'HASPATH (//DNAME="PERSONNEL")') > 0
      3  /
            ID XML_DATA
            50 <?xml version="1.0"?>
               <ROWSET>
                <ROW>
                 <DNAME>PERSONNEL</DNAME>
                 <EMP_DATA>
                 </EMP_DATA>
                </ROW>
               </ROWSET>
    SCOTT@10gXE> SELECT * FROM your_table
      2  WHERE  CONTAINS (xml_data, 'CLARK INPATH (//ENAME)') > 0
      3  /
            ID XML_DATA
            10 <?xml version="1.0"?>
               <ROWSET>
                <ROW>
                 <DNAME>ACCOUNTING</DNAME>
                 <EMP_DATA>
                  <EMP_DATA_ROW>
                   <ENAME>CLARK</ENAME>
                   <JOB>MANAGER</JOB>
                  </EMP_DATA_ROW>
                  <EMP_DATA_ROW>
                   <ENAME>KING</ENAME>
                   <JOB>PRESIDENT</JOB>
                  </EMP_DATA_ROW>
                  <EMP_DATA_ROW>
                   <ENAME>MILLER</ENAME>
                   <JOB>CLERK</JOB>
                  </EMP_DATA_ROW>
                 </EMP_DATA>
                </ROW>
               </ROWSET>
    SCOTT@10gXE> SELECT * FROM your_table
      2  WHERE  CONTAINS (xml_data, 'HASPATH (//ENAME="CLARK")') > 0
      3  /
            ID XML_DATA
            10 <?xml version="1.0"?>
               <ROWSET>
                <ROW>
                 <DNAME>ACCOUNTING</DNAME>
                 <EMP_DATA>
                  <EMP_DATA_ROW>
                   <ENAME>CLARK</ENAME>
                   <JOB>MANAGER</JOB>
                  </EMP_DATA_ROW>
                  <EMP_DATA_ROW>
                   <ENAME>KING</ENAME>
                   <JOB>PRESIDENT</JOB>
                  </EMP_DATA_ROW>
                  <EMP_DATA_ROW>
                   <ENAME>MILLER</ENAME>
                   <JOB>CLERK</JOB>
                  </EMP_DATA_ROW>
                 </EMP_DATA>
                </ROW>
               </ROWSET>
    SCOTT@10gXE>

  • 5200: Error executing query: The data form grid is invalid.

    Hi,
    I am getting this error " 5200: Error executing query: The data form grid is invalid. Verify that all members selected are in Essbase. Check log for details.
    com.hyperion.planning.HspException;hasPovDims=1;povXML=<?xml version="1.0"?><datasources><datasource name="Profit " dsid="228af2c3_129ca3dd85c_-77b1" allowEdit="1"><dim name="Period" dimIndex="1" dsName="Profit " keyDimName="Period" memberName="Apr" displayName="Period: Apr"/><dim name="Year" dimIndex="2" dsName="Profit " keyDimName="Year" memberName="FY10" displayName="Year: FY10"/><dim name="Entity" dimIndex="5" dsName="Profit " keyDimName="Entity" memberName="9999" displayName="Entity: 9999"/></datasource></datasources>"
    I have checked that both the systems essbase and planning are same. nothing's different. still i cannot find the exact reason why the report is not working.
    can any please help me.
    btw, i am using Hyperion Planning 9.3.1
    Thanks,
    BIMS

    Hi
    You probably deleted some members from outline that are used by report
    I would recommend you to open you report/grid via rep.client and try to find which elements are abcent
    Regards
    Alexander
    Edited by: Softperson on 19/8/2010 17:38

  • How to find out the Hire date of an employee?

    Hi All
    What is effective date, Latest start date and other date fields which are are used when we create a new employee?
    What is the difference between hire date and joining date?
    How to find out the Hire date and joining date of an employee?
    Regards
    Rahman

    The effective dates are related to date tracking. The effective start date shows when this version of the record became effective.
    The Hire Date, or Latest Satrt Date shows the date on which the employee was last hired. If he was hired before from 01/01/01 to 31/12/01, then left but was hired again from 01/01/07, the Latest Hired Date would be 01/01/07 and the First Hired Date would be 01/01/01.
    When using Oracle HR, datetracking allows you to either correct data (because it was wrong or incomplete), or update it (because a time effective change took place e.g. got married).
    The[b] effective dates show when a record was updated. So, if an update was made on 07/02/07, and the update datetrack option was used, the current record would have its effective end date set to 06/02/07 (the day before the update) and a new version would be created with the updates and an effective start date of 07/02/07.
    Hope this helps.

  • Error when querying OLAP data with BI answers

    Have been doing all the Lessons in "Using Oracle OLAP With Oracle BI Enterprise Edition 10g Release 3". Got till lesson 3 where I'm supposed to query the data with Answers but If I add any of the facts to the report, I get the following error:
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17003] Oracle gateway error: Unsupported data type 101. (HY000)
    SQL Issued: SELECT Customer."Ship To" saw_0, Measures.COST saw_1 FROM Global ORDER BY saw_0
    So I was wondering if anyone knows what the catch could be.
    Thanks in advance!

    Yes. Me too. I have the same issue and I don't find any information about it. Could anyone help ?

  • I need to pass a query in form of string to DBMS_XMLQUERY.GETXML package...the parameters to the query are date and varchar ..please help me..

    I need to pass a query in form of string to DBMS_XMLQUERY.GETXML package...the parameters to the query are date and varchar ..please help me build the string .Below is the query and the out put. ( the string is building fine except the parameters are with out quotes)
    here is the procedure
    create or replace
    procedure temp(
        P_MTR_ID VARCHAR2,
        P_FROM_DATE    IN DATE ,
        P_THROUGH_DATE IN DATE ) AS
        L_XML CLOB;
        l_query VARCHAR2(2000);
    BEGIN
    l_query:=  'SELECT
        a.s_datetime DATETIME,
        a.downdate Ending_date,
        a.downtime Ending_time,
        TO_CHAR(ROUND(a.downusage,3),''9999999.000'') kWh_Usage,
        TO_CHAR(ROUND(a.downcost,2),''$9,999,999.00'') kWh_cost,
        TO_CHAR(ROUND(B.DOWNUSAGE,3),''9999999.000'') KVARH
      FROM
        (SELECT s_datetime + .000011574 s_datetime,
          TO_CHAR(S_DATETIME ,''mm/dd/yyyy'') DOWNDATE,
          DECODE(TO_CHAR(s_datetime+.000011574 ,''hh24:'
          ||'mi''), ''00:'
          ||'00'',''24:'
          ||'00'', TO_CHAR(s_datetime+.000011574,''hh24:'
          ||'mi'')) downtime,
          s_usage downusage,
          s_cost downcost
        FROM summary_qtrhour
        WHERE s_mtrid = '
        ||P_MTR_ID||
       ' AND s_mtrch   = ''1''
        AND s_datetime BETWEEN TO_DATE('
        ||P_FROM_DATE||
        ',''DD-MON-YY'') AND (TO_DATE('
        ||P_THROUGH_DATE||
        ',''DD-MON-YY'') + 1)
        ) a,
        (SELECT s_datetime + .000011574 s_datetime,
          s_usage downusage
        FROM summary_qtrhour
        WHERE s_mtrid = '
        ||P_MTR_ID||
        ' AND s_mtrch   = ''2''
        AND s_datetime BETWEEN TO_DATE('
        ||P_FROM_DATE||
        ',''DD-MON-YY'') AND (TO_DATE('
        ||P_THROUGH_DATE||
        ','' DD-MON-YY'') + 1)
        ) B
      where a.S_DATETIME = B.S_DATETIME(+)';
    SELECT DBMS_XMLQUERY.GETXML('L_QUERY') INTO L_XML   FROM DUAL;
    INSERT INTO NK VALUES (L_XML);
    DBMS_OUTPUT.PUT_LINE('L_QUERY IS :'||L_QUERY);
    END;
    OUTPUT parameters are in bold (the issue is they are coming without single quotes otherwise th equery is fine
    L_QUERY IS :SELECT
        a.s_datetime DATETIME,
        a.downdate Ending_date,
        a.downtime Ending_time,
        TO_CHAR(ROUND(a.downusage,3),'9999999.000') kWh_Usage,
        TO_CHAR(ROUND(a.downcost,2),'$9,999,999.00') kWh_cost,
        TO_CHAR(ROUND(B.DOWNUSAGE,3),'9999999.000') KVARH
      FROM
        (SELECT s_datetime + .000011574 s_datetime,
          TO_CHAR(S_DATETIME ,'mm/dd/yyyy') DOWNDATE,
          DECODE(TO_CHAR(s_datetime+.000011574 ,'hh24:mi'), '00:00','24:00', TO_CHAR(s_datetime+.000011574,'hh24:mi')) downtime,
          s_usage downusage,
          s_cost downcost
        FROM summary_qtrhour
        WHERE s_mtrid = N3165 AND s_mtrch   = '1'
        AND s_datetime BETWEEN TO_DATE(01-JAN-13,'DD-MON-YY') AND (TO_DATE(31-JAN-13,'DD-MON-YY') + 1)
        ) a,
        (SELECT s_datetime + .000011574 s_datetime,
          s_usage downusage
        FROM summary_qtrhour
        WHERE s_mtrid = N3165 AND s_mtrch   = '2'
        AND s_datetime BETWEEN TO_DATE(01-JAN-13,'DD-MON-YY') AND (TO_DATE(31-JAN-13,' DD-MON-YY') + 1)
        ) B
      where a.S_DATETIME = B.S_DATETIME(+)

    The correct way to handle this is to use bind variables.
    And use DBMS_XMLGEN instead of DBMS_XMLQUERY :
    create or replace procedure temp (
      p_mtr_id       in varchar2
    , p_from_date    in date
    , p_through_date in date
    is
      l_xml   CLOB;
      l_query VARCHAR2(2000);
      l_ctx   dbms_xmlgen.ctxHandle;
    begin
      l_query:=  'SELECT
        a.s_datetime DATETIME,
        a.downdate Ending_date,
        a.downtime Ending_time,
        TO_CHAR(ROUND(a.downusage,3),''9999999.000'') kWh_Usage,
        TO_CHAR(ROUND(a.downcost,2),''$9,999,999.00'') kWh_cost,
        TO_CHAR(ROUND(B.DOWNUSAGE,3),''9999999.000'') KVARH
      FROM
        (SELECT s_datetime + .000011574 s_datetime,
          TO_CHAR(S_DATETIME ,''mm/dd/yyyy'') DOWNDATE,
          DECODE(TO_CHAR(s_datetime+.000011574 ,''hh24:'
          ||'mi''), ''00:'
          ||'00'',''24:'
          ||'00'', TO_CHAR(s_datetime+.000011574,''hh24:'
          ||'mi'')) downtime,
          s_usage downusage,
          s_cost downcost
        FROM summary_qtrhour
        WHERE s_mtrid = :P_MTR_ID
        AND s_mtrch   = ''1''
        AND s_datetime BETWEEN TO_DATE(:P_FROM_DATE,''DD-MON-YY'')
                           AND (TO_DATE(:P_THROUGH_DATE,''DD-MON-YY'') + 1)
        ) a,
        (SELECT s_datetime + .000011574 s_datetime,
          s_usage downusage
        FROM summary_qtrhour
        WHERE s_mtrid = :P_MTR_ID
        AND s_mtrch   = ''2''
        AND s_datetime BETWEEN TO_DATE(:P_FROM_DATE,''DD-MON-YY'')
                           AND (TO_DATE(:P_THROUGH_DATE,'' DD-MON-YY'') + 1)
        ) B
      where a.S_DATETIME = B.S_DATETIME(+)';
      l_ctx := dbms_xmlgen.newContext(l_query);
      dbms_xmlgen.setBindValue(l_ctx, 'P_MTR_ID', p_mtr_id);
      dbms_xmlgen.setBindValue(l_ctx, 'P_FROM_DATE', to_char(p_from_date, 'DD-MON-YY'));
      dbms_xmlgen.setBindValue(l_ctx, 'P_THROUGH_DATE', to_char(p_through_date, 'DD-MON-YY'));
      l_xml := dbms_xmlgen.getXML(l_ctx);
      dbms_xmlgen.closeContext(l_ctx);
      insert into nk values (l_xml);
    end;

  • "An error occured querying a data source" - Web Service connecting to GetUserCollectionFromGroupSupport

    I have an infopath form that is getting the error when opening an existing form or creating a new form:-
    Warning
    An error occurred querying a data source.
    Click OK to resume filling out the form. You may want to check your form data for errors.
    Hide error details
    An error occurred while trying to connect to a Web service.
    Correlation ID:7ab6be2c-60e1-4025-be1e-1a2fbe00acd3
    So I know its a permission issue because full control users have no problem.  I have found a suggestion here suggesting making sure the group has "Who can View Membership to the Group" but that didn't work for me - and
    my test user is only a member of one group -
    http://sharepoint.stackexchange.com/questions/109488/usergroup-asmx-returns-unauthorized-for-some-groups
    How can I get around this without provding users Full Control?

    So I fixed this with exactly what I mentioned above by adding "everyone" "Who can View Membership to the Group" permission.  My error initially was that I was looking at the incorrect security group.

  • Problem inserting and querying XML data with a recursive XML schema

    Hello,
    I'm facing a problem with querying XML data that is valid against a recursive XML Schema. I have got a table category that stores data as binary XML using Oracle 11g Rel 2 on Windows XP. The XML Schema is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="bold_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="keyword_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
                   <xs:element name="plain_text" type="xs:string"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="emph_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="text_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="parlist_type">
              <xs:sequence>
                   <xs:element name="listitem" minOccurs="0" maxOccurs="unbounded" type="listitem_type"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="listitem_type">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="parlist" type="parlist_type"/>
                   <xs:element name="text" type="text_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:element name="category">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name"/>
                        <xs:element name="description">
                                  <xs:complexType>
                                            <xs:choice>
                                                           <xs:element name="text" type="text_type"/>
                                                           <xs:element name="parlist" type="parlist_type"/>
                                            </xs:choice>
                                  </xs:complexType>
                        </xs:element>
                                                                </xs:sequence>
                                                                <xs:attribute name="id"/>
                                            </xs:complexType>
                        </xs:element>
    </xs:schema>I registered this schema and created the category table. Then I inserted a new row using the code below:
    insert into category_a values
    (XMlElement("category",
          xmlattributes('categoryAAA' as "id"),
          xmlforest ('ma categ' as "name"),
          (xmlelement("description", (xmlelement("text", 'find doors blest now whiles favours carriage tailor spacious senses defect threat ope willow please exeunt truest assembly <keyword> staring travels <bold> balthasar parts attach </bold> enshelter two <emph> inconsiderate ways preventions </emph> preventions clasps better affections comes perish </keyword> lucretia permit street full meddle yond general nature whipp <emph> lowness </emph> grievous pedro')))    
    The row is successfully inserted as witnessed by the results of row counting. However, I cannot extract data from the table. First, I tried using SqlPlus* which hangs up and quits after a while. I then tried to use SQL Developer, but haven't got any result. Here follow some examples of queries and their results in SQL Developer:
    Query 1
    select * from category
    Result : the whole row is returned
    Query 2
    select xmlquery('$p/category/description' passing object_value as "p" returning content) from category
    Result: "SYS.XMLTYPE"
    now I tried to fully respect the nested structure of description element in order to extract the text portion of <bold> using this query
    Query 3
    select  xmlquery('$p/category/description/text/keyword/bold/text()' passing object_value as "p" returning content) from  category_a
    Result: null
    and also tried to extract the text portion of element <text> using this query
    Query 4
    select  xmlquery('$p/category/description/text/text()' passing object_value as "p" returning content) from  category_a
    Result: "SYS.XMLTYPE".
    On the other hand, I noticed, from the result of query 1, that the opening tags of elements keyword and bold are encoded as the less than operator "&lt;". This explains why query 3 returns NULL. However, query 4 should display the text content of <text>, which is not the case.
    My questions are about
    1. How to properly insert the XML data while preserving the tags (especially the opening tag).
    2. How to display the data (the text portion of the main Element or of the nested elements).
    The problem about question 1 is that it is quite unfeasible to write a unique insert statement because the structure of <description> is recursive. In other words, if the structure of <description> was not recursive, it would be possible to embed the elements using the xmlelement function during the insertion.
    In fact, I need to insert the content of <description> from a source table (called category_a) into a target table (+category_b+) automatically .
    I filled category_a using the Saxloader utility from an flat XML file that I have generated from a benchmark. The content of <description> is different from one row to another but it is always valid with regards to the XML Schema. The data is properly inserted as witnessed by the "select * from category_a" instruction (500 row inserted). Besides, the opening tags of the nested elements under <description> are preserved (no "&lt;"). Then I wrote a PL/SQL procedure in which a cursor extracts the category id and category name into varchar2 variables and description into an XMLtype variable from category_a. When I try to insert the values into a category_b, I get the follwing error:
    LSX-00213: only 0 occurrences of particle "text", minimum is 1which tells that the <text> element is absent (actually it is present in the source table).
    So, my third question is why are not the tags recognized during the insertion?
    Can anyone help please?

    Hello,
    indded, I was using an old version of Sqlplus* (8.0.60.0.0) because I had a previous installation (oracle 10g XE). Instead, I used the Sqlplus* shipped with the 11g2database (version 11.2.0.1.0). All the queries that I wrote work fine and display the data correctly.
    I also used the XMLSERIALIZE function and can now display the description content in SQL Developer.
    Thank you very much.
    To answer your question Marco, I registered the XML Schema using the following code
    declare
      doc varchar2(4000) := '<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="bold_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="keyword_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
                   <xs:element name="plain_text" type="xs:string"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="emph_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="text_type" mixed="true">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="bold" type="bold_type"/>
                   <xs:element name="keyword" type="keyword_type"/>
                   <xs:element name="emph" type="emph_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:complexType name="parlist_type">
              <xs:sequence>
                   <xs:element name="listitem" minOccurs="0" maxOccurs="unbounded" type="listitem_type"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="listitem_type">
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                   <xs:element name="parlist" type="parlist_type"/>
                   <xs:element name="text" type="text_type"/>
              </xs:choice>
         </xs:complexType>
         <xs:element name="category">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name"/>
                        <xs:element name="description">
                                  <xs:complexType>
                                            <xs:choice>
                                                           <xs:element name="text" type="text_type"/>
                                                           <xs:element name="parlist" type="parlist_type"/>
                                            </xs:choice>
                                  </xs:complexType>
                        </xs:element>
                                                                </xs:sequence>
                                                                <xs:attribute name="id"/>
                                            </xs:complexType>
                        </xs:element>
    </xs:schema>';
    begin
      dbms_xmlschema.registerSchema('/xmldb/category_auction.xsd', doc,     LOCAL      => FALSE, 
            GENTYPES   => FALSE,  GENBEAN    => FALSE,   GENTABLES  => FALSE,
             FORCE      => FALSE,
             OPTIONS    => DBMS_XMLSCHEMA.REGISTER_BINARYXML,
             OWNER      => USER);
    end;then, I created the Category table as follows:
    CREATE TABLE category_a of XMLType XMLTYPE store AS BINARY XML
        XMLSCHEMA "xmldb/category_auction.xsd" ELEMENT "category";Now, there still remains a problem of how to insert the "description" content which I serialized as a CLOB data into another table as XML. To this purpose, I wrote a view over the Category_a table as follows:
    CREATE OR REPLACE FORCE VIEW "AUCTION_XWH"."CATEGORY_V" ("CATEGORY_ID", "CNAME", "DESCRIPTION") AS
      select category_v."CATEGORY_ID",category_v."CNAME",
      XMLSerialize(content ( xmlquery('$p/category/description/*' passing object_value as "p" returning content)) as clob) as "DESCRIPTION"
      from  auction.category_a p, 
    xmltable ('$a/category' passing p.Object_Value as "a"
    columns  category_id varchar2(15) path '@id',
              cname varchar2(20) path 'name') category_v;Then, I wrote a procedure to insert data into the Category_xwh table (the source and target tables are slightly different: the common elements are just copied wereas new elements are created in the target table). The code of the procedure is the following:
    create or replace PROCEDURE I_CATEGORY AS
    v_cname VARCHAR2(30);
    v_description clob ;
    v_category_id VARCHAR2(15);
    cursor mycursor is select category_id, cname, description from category_v;
    BEGIN
    open mycursor;
      loop
      /*retrieving the columns*/
      fetch mycursor into v_category_id, v_cname, v_description ;
      exit when mycursor%notfound;
      insert into category_xwh values
      (XMlElement("category",
          xmlattributes(v_category_id as "category_id"),
          xmlelement("Hierarchies", xmlelement("ObjHierarchy", xmlelement ("H_Cat"),
                                                               xmlelement ("Rollsup",
                                                                                  (xmlelement("all_categories",
                                                                                   xmlattributes('allcategories' as "all_category_id")))
        xmlforest (
                  v_cname as "cat_name",
                  v_description as "description")    
    end loop;
      commit;
      close mycursor;
    END I_CATEGORY;When I execute the procedure, I get the following error:
    LSX-00201: contents of "description" should be elements onlyso, I just wonder if this is because v_description is considered as plain text and not as XML text, even if its content is XML. Do I need to use a special function to cast the CLOB as XML?
    Thanks for your help.
    Doulkifli

  • How can I make a query by date with several TDMS files?

    Hi,
    I have a project that can write and read TDMS files everyday (a file for each day with date and time). There, I can import those files to excel (I choose a file and load it). But, I have a question: How can I make a query by date with those TDMS files? I'd like make a time stamp for start date and stop date, where I could compare the TDMS file dates and sum the values that are in the channels where these files are similar. For example, I save a file with "02/01/2013" name, in other day "03/01/2013", in other day "04/01/2013"... so, i'd like put in time stamp for start date "02/01/2013" file and to stop date "04/01/2013" file, than, sum all values that range with my TDMS files existing. How can I make that? 
    Thanks all,
    Val 

    Hello Val_Auto.
    You're Brazilian, no? Me too. = ^ - ^ =
    I converted VI to version of your LabVIEW (8.5). Is attached in this reply.
    This VI search all your TDMS in a range of dates and join them in a single TDMS. I hope this is what you wanted.
    Query TDMS is the main VI. The TDMS VI Search changes the date format that out from calendar control (which is DD / MM / YYYY) to DD-MM-YYYY. This is because you can't name files using "/". I chose "-" but, if necessary, you should change to keep the same format of your TDMS files.
    If you have any doubt as to its operation or how to make changes to adapt VI for your application, keep at your disposal.
    Thank you for your contact; I hope have helped you and succeed in your application.
    Wesley Rocha
    Application Engineer
    National Instruments Brazil
    Visite a nossa comunidade em PORTUGUÊS!!!
    Attachments:
    Query TDMS.vi ‏62 KB
    tdms search.vi ‏24 KB

Maybe you are looking for

  • Adobe/MS Access/Lotus Notes Integration

    Not sure if I'm in the right place, please feel free to let me know if not.  Have searched in Access and Lotus Notes forums but no answers yet. I am using MS Access to automatically send email from Lotus Notes and attach a PDF file that is located on

  • How to play videos 1 behind another?

    how do you play the videos in sequence?

  • I HAVE PROBLEM WITH IPHONE MIC

    I HAVE PROBLEM WITH IPHONE MIC

  • RSBBS settings : RRI : Report-Report Interface

    We have migrated several queries to version 7 for which RRI settings were created that enable a link to transaction code in ECC (Eg, FB03). Before migration, the link to FB03 would open an ECC session (a GUI session).  However, after migrating the qu

  • All import convert to symbol ??

    Is it best practice when importing, jpg and png to first import to stage then convert to symbol (MC) then delete and now you have it in the library to use?