Get the XSD of the report query

APEX 4.0.2
Oracle 11.2.0.1.0

Hello
We are trying to retrieve the XML schema for a report query.

The following code example works, but the "xsd" for p_document_format parameter is not documented.

Is "xsd" a taken parameter value supported for APEX_UTIL. GET_PRINT_DOCUMENT?

v_blob := APEX_UTIL.GET_PRINT_DOCUMENT (
    p_application_id      => NV('APP_ID'),
    p_report_query_name   => 'test', 
    p_report_layout_name => null,
    p_report_layout_type => null,  
    p_document_format     => 'xsd',
    p_print_server => null);
Thank you in advance!

Hi Eric,.

We have four different versions of apex_util.get_print_document, so depending on what you want to do, you can create PDF files and other types of documents based on your own style, your own XML data sheets or pre-defined SEO report queries SQL with predefined, or in custom arrangements. We support the output formats, as I listed previously for the four releases. However, the internal implementation of these APIs is different for the API that refer to report queries and those that refer to custom XML data. When you reference the report queries, APEX of the first loading and running queries and generates XML data and then passes the XML the print rendering engine. The analysis and execution of these queries can use the same internal functions that are also used on the edition of report request page, where you have buttons which allow to have downloaded representations XML and the XML schema for the query for your report. XML and XSD documents are intended for use with the plug-in of BI Publisher Word or design tools XSL of third parties to design presentations. Now as the same internal functions are used, you can actually generate documents from XML Schema (XSD) using the apex_util.get_print_document API, but only with versions that allow you to refer to a report query predefined. This is not officially supported, I can assure you that this behavior will not change in the future, but I don't see why we would change that. The main reason to support XML in APIs is really to test the printing functionality without requiring a print rendering engine. But it seems that there are other cases of use for those both output formats.

Hope the helps

Kind regards
Marc

Tags: Database

Similar Questions

  • How to avoid the report query needs a unique key to identify each line

    Hello

    How to avoid the error below

    The report query needs a unique key to identify each row. The supplied key cannot be used for this query. Please change the report attributes to define a unique key column.

    I have master-detail tables but without constraints, when I created a query as dept, emp table he gave me above the error.

    Select d.deptno, e.ename

    by d, e emp dept

    where e.deptno = d.deptno

    Thank you and best regards,

    Ashish

    Hi mickael,.

    Work on interactive report?

    You must set the column link (in the attributes report) to something other than "link to display single line." You can set it to 'Exclude the column link' or 'target link to Custom.

  • Get the report Monthwise

    Hi all,

    I need to get the report equipmentwise monthwise. Our application is used by the JCB rental company. If they want to profit each JCB monthwise.

    We are capturing the date range of which JCB is engaged. Here is my table structure. How to use the function of pivot or case to get this result

    ph_timesheet_details / / DESC

    Name of Type Null

    ------------------- -------- -------------

    ID NOT NULL NUMBER

    TSHDR_ID NOT NULL NUMBER

    NUMBER OF LINE_NO

    LINE_TYPE NOT NULL VARCHAR2 (1)

    NUMBER of EQUIP_ID - it is the need for material to use for the collection

    NUMBER OF ACC_ID

    NUMBER OF OPERATOR_ID

    From_date DATE - JCB engaged since

    To_date DATE - JCB engaed in

    NUMBER OF NO_OF_DAYS

    NUMBER OF CONT_HOURS

    ACT_HOURS NUMBER - these hours must be sum for every month equipmentwise

    RATE_PER_HOUR NUMBER (14.3)

    LINE_VALUE NUMBER (14.3)

    NUMBER OF OT_HOURS

    REMARKS VARCHAR2 (255)

    RECORD_CREATED_USER VARCHAR2 (50)

    DATE OF RECORD_CREATED_DATE

    LAST_MOD_USER VARCHAR2 (50)

    DATE OF LAST_MOD_DATE

    I need output like this

    jan Feb mar Apr... equipment dec

    ********************************************************************

    equip1 200 h...         100 h

    .

    .

    .

    equip the xx 500 h...                        300hrs

    Hello

    This with the assumption that you treat the lines where min (from_date) and max (to_date) are in the same year, and I don't consider fractions of day and all the days are considered as (holidays, weekends, etc.):

    with rng_dates as
    (
       select min(trunc(from_date)) min_dt
            , max(trunc(to_Date))   max_dt
         from ph_timesheet_details
        where from_date >= to_date('01.01.2015', 'dd.mm.yyyy')
          and to_date < to_date('01.01.2016', 'dd.mm.yyyy')
    )
    , got_dt_list as
    (
       select min_dt + level -1 dt
         from rng_dates
      connect by min_dt + level -1 <= max_dt
    )
    select td.equip_id
         , sum( case
                    when extract(month from dl.dt) = 1
                    then td.act_hours / (trunc(to_date) -  trunc(from_date) + 1)
                end
              ) jan
         , sum( case
                    when extract(month from dl.dt) = 2
                    then td.act_hours / (trunc(to_date) -  trunc(from_date) + 1)
                end
              ) feb
         , sum( case
                    when extract(month from dl.dt) = 3
                    then td.act_hours / (trunc(to_date) -  trunc(from_date) + 1)
                end
              ) mar
         , sum( case
                    when extract(month from dl.dt) = 4
                    then td.act_hours / (trunc(to_date) -  trunc(from_date) + 1)
                end
              ) apr
         , sum( case
                    when extract(month from dl.dt) = 5
                    then td.act_hours / (trunc(to_date) -  trunc(from_date) + 1)
                end
              ) may
         , sum( case
                    when extract(month from dl.dt) = 6
                    then td.act_hours / (trunc(to_date) -  trunc(from_date) + 1)
                end
              ) jun
         , sum( case
                    when extract(month from dl.dt) = 7
                    then td.act_hours / (trunc(to_date) -  trunc(from_date) + 1)
                end
              ) jul
         , sum( case
                    when extract(month from dl.dt) = 8
                    then td.act_hours / (trunc(to_date) -  trunc(from_date) + 1)
                end
              ) aug
         , sum( case
                    when extract(month from dl.dt) = 9
                    then td.act_hours / (trunc(to_date) -  trunc(from_date) + 1)
                end
              ) sep
         , sum( case
                    when extract(month from dl.dt) = 10
                    then td.act_hours / (trunc(to_date) -  trunc(from_date) + 1)
                end
              ) oct
         , sum( case
                    when extract(month from dl.dt) = 11
                    then td.act_hours / (trunc(to_date) -  trunc(from_date) + 1)
                end
              ) nov
         , sum( case
                    when extract(month from dl.dt) = 11
                    then td.act_hours / (trunc(to_date) -  trunc(from_date) + 1)
                end
              ) dec
      from ph_timesheet_details td
           join got_dt_list dl
             on dl.dt >= trunc(from_date)
            and dl.dt <= trunc(to_date)
    where from_date >= to_date('01.01.2015', 'dd.mm.yyyy')
       and to_date < to_date('01.01.2016', 'dd.mm.yyyy')
    group by td.equip_id;
    
      EQUIP_ID        JAN        FEB        MAR        APR        MAY        JUN        JUL        AUG        SEP        OCT        NOV        DEC
    ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
            14                               80
            81                              230         80
           119                              220         90
            75                              240          8
            74                                          20
            93                              136
            92                              176         72                                                                                      
    
    7 rows selected.
    

    Kind regards.

    Alberto

  • How to get the SQL query running of af: search?

    I use JDeveloper 11.1.2.3.0. I have a page where I've set up an af:query and an array of result. The problem is that I can't get the exact query that is used during the execution of this component in a managed bean method. Is it possible to get the query string that is run within the af: query?

    Thank you

    Hello

    Method of the ViewObject getQuery() returns what you need;

    You can replace the executeQueryForCollection(), and prior to calling super, you can print the result of getQuery() method:

    public void executeQueryForCollection (rowset Object,

    Object [] params,

    {int noUserParams)

    System.out.println ("SQL =" + getQuery());

    call the super method here...

    }

  • Need to get the report of last hour in ot txt CSV cluster

    Hi all

    Thanks in advance,

    I work for a script where I need to get the information from vms that was revived by HA during the restart of the host.

    or if we can get the report of last hour in csv or txt file cluster we can extract and find out how many virtual machines has been migirated to another host for host restarts.

    Please advice.

    SIV

    Try the following, this will give you all the VMS who have been restarted and the time when it happened.

    Connect-VIServer -Server yourserver
    
    $start = (Get-Date).AddDays(-5)
    Get-VIEvent -MaxSamples 1000000 -Start $start -Type warning | Where {$_.FullFormattedMessage -Match "vSphere HA restarted"} | Select ObjectName, CreatedTime, FullFormattedMessage
    
    Disconnect-VIServer -Confirm:$false
    
  • Race explain the plan on the report query

    I use the report queries/submissions to build my reports. My report query uses a package that creates collections and sets session elements of the State. I need to execute a plan to explain why it is slow, but I can't figure out how to get these my query will return the value. If I try to launch SQL workshop, he does not see my current session and the collections of the APEX. No idea how to do this?

    Hello

    You can enable the trace of your page process then

    run immediately "alter session set sql_trace = true";

    () apex_util.download_print_document
    p_file_name-online l_form,
    p_content_disposition-online "attachment."
    p_application_id =>: APP_ID,.
    p_report_query_name-online nvl (l_report_query_name, l_form),
    p_report_layout_name-online nvl (l_report_layout_name, l_form),
    p_report_layout_type-online "rtf"
    p_document_format =>: P507_OUTPUT_FORMAT);

    run immediately "alter session set sql_trace = false';"

    Check that the schema of analysis of the application has been granted the privilege of "alter session".

    CITY

  • How to get the report for the set items

    I created an element defined for all payments that are made to the employee. Now I would that these elements that are there in the element the value to display in a separate report and not in my payslip. How can I do this? Please can you tell me the names of the tables where I can get the required data?


    Appreciate all your help!

    Try this query

    SELECT ppf.employee_number "Employee Number",
              petf.element_name "Element Name",
              to_number(prrv.result_value) "Amount"
    FROM per_all_people_f ppf,
            per_all_assignments_f paf,
            pay_element_types_f petf,
            pay_assignment_actions paa,
            pay_payroll_actions ppa,
            pay_input_values_f pivf,
            pay_run_results prr,
            pay_run_result_values prrv,
               pay_element_type_rules petr,
               pay_element_sets pes
    WHERE  ppf.person_id = paf.person_id
    AND    petf.element_type_id = prr.element_type_id
    AND    pes.element_set_id = petr.element_set_id
    AND    pes.element_set_name = :Element_Set_Name
    AND    petr.include_or_exclude = 'I'
    AND    petf.element_type_id = petr.element_type_id
    AND    paf.assignment_id = paa.assignment_id
    AND    ppa.payroll_id = paf.payroll_id
    AND    paa.payroll_action_id = ppa.payroll_action_id
    AND    ((:pmon IS NULL AND :pyear IS NULL) OR TO_CHAR(ppa.date_earned,'MONYYYY') = TO_CHAR(UPPER(:pmon)||:pyear))
    AND     paa.assignment_action_id = prr.assignment_action_id
    AND    prr.run_result_id = prrv.run_result_id
    AND    pivf.element_type_id = petf.element_type_id
    AND    prr.element_type_id = petf.element_type_id
    AND    pivf.input_value_id = prrv.input_value_id
    AND    ppa.effective_date BETWEEN petf.effective_start_date AND petf.effective_end_date
    AND    ppa.effective_date BETWEEN pivf.effective_start_date AND pivf.effective_end_date
    AND    ppa.effective_date BETWEEN paf.effective_start_date AND paf.effective_end_date
    AND    ppa.effective_date BETWEEN (to_date('01-'||:pmon||'-'||:pyear,'DD-MON-YYYY') ) AND last_day(to_date('01-'||:pmon||'-'||:pyear,'DD-MON-YYYY') )
    AND    (to_date('01-'||:pmon||'-'||:pyear,'DD-MON-YYYY') ) between ppf.effective_start_date AND ppf.effective_end_date
    AND    pivf.name ='Pay Value'
    ORDER BY to_number(ppf.employee_number) ,ppf.person_id,petf.element_name
    

    This query gives the values of outcome performance of the elements in the set of elements.
    HTH

  • How to get the sql query result?

    Hello

    Currently I use LV2012 to connect to an Oracle database server. After the Oracle Express and Oracle ODBC driver facilities/settings made.

    I managed to use the SQL command to query the data through my command prompt window.

    Now the problem is, how to do the same task in Labview using database connectivity tools?

    I have build a VI to query as being attached, but I have no idea of what range to use to get the result of the query.

    Please help me ~ ~

    Here is a piece of code that I use to test the SQL commands, you can use the part that retrieves the results of sql.

    It is also possible to get the rear column headers, but it's for the next lesson!

    ;-)

  • Why bind variables/page items does not work in the report query?

    Hello world

    I am trying to use the page as a bind variable in the query of my report. I checked the box to state of Session and also added my page elements in the LIST of ITEMS in the SESSION STATE.

    but NO RECORD not DISPLAYED IN THE REPORT at RUN TIME.

    to see live please connect to

    http://Apex.Oracle.com/pls/Apex/f?p=52297:LOGIN_DESKTOP:8355343133792

    user name: [email protected]

    password: 123456

    Hello

    I looked at the application.

    Do you want to go to the report page after click on the report button? If it is, your button to submit the page. Then, you need a branch to access this URL. By submitting the page, your value should be set at the session.

    Kofi

  • How to get the inline query which is drawn from the TAB specific Application.

    Hi all I use 10.2.0.4.0 oracle version.

    I want to capture the sql that is raised in my prod database when an applicaton tab is hit as it takes about 5 minutes for the tab to be loaded. So is it possible, for the inline sql, which is the origin of the problem, directly from the prod environment.

    (Note: I looked through the browser session in PROD DB for the query, but there, I found a lot of meetings and a lot of requests, I do not know how to distinguish the session being created by the specific tab I hit).

    >

    Hello

    I want to capture the sql that is triggered to my database of prod
    When an applicaton tab is hit as it takes about 5 minutes so that the tab
    to be loaded. So is it possible to get the inline sql, which is
    the origin of the problem, directly from the prod environment.

    Please, please tell us that you have a Test environment? Log into that, then run a trace.
    No doubt you can either descend all test for a few miinutes and/or
    easily distinguish sessions on your Test System? That's exactly what the test
    the environments are for.

    The SQL execution will be the same - you can go try to find
    the root cause of the problem.

    HTH,

    Paul...

  • How to get the report of BI Publisher services BIEE presentation

    Hello everyone, I installed the POET and BI Publisher in the same host and I followed the configuration in the poet oracle installation documentation, but when I want to access the BI publisher company or get the BI Publisher report in presentation services, I get the error saying cannot access the PIF, I have to do additional configuration or do I need to install any component?

    Thanks in advance ~

    Check here:
    http://gerardnico.com/wiki/dat/BIP/configuration_bip
    All the steps are described.

    The stage of Oracle BI presentation integration Service is in this paragraph.
    http://gerardnico.com/wiki/dat/BIP/configuration_bip#integration_of_oracle_bi_presentation_service

    Success
    Nico

  • Special characters are not displayed using the report query

    I run my ad page APEX reports BI using apex_util.download_print_document (see below).

    Looks like it's stripping on the '+' in the report during the display. It displays correctly in the XML file.
    I even tried encoding with SELECT max (replace (I1.alpha_grade, ' + ', '% 2B')). This displays the '% 2B' instead of the ' + '.
    Any ideas?


    () apex_util.download_print_document
    p_file_name = > l_form_description,
    p_content_disposition = > 'attachment ',.
    p_application_id = > v ('APP_ID').
    p_report_query_name = > nvl (l_report_query_name, l_form).
    p_report_layout = > l_layout,
    p_report_layout_type = > 'rtf ',.
    p_document_format = > v ('P507_OUTPUT_FORMAT'));

    Bob,

    Try

    REGEXP_REPLACE ( i1.alpha_grade, '\&\#43;', '(+)' )
    

    Jeff

  • Get the dynamic query alias name

    Hi all

    I have a plsql function using a dynamic query.
    And the function takes an entire sql query as a parameter.

    The main problem is that the function must get what aliases or columns were interviewed.

    For example,.
    FUNCTION_GET_QUERY_ALIAS ('SELECT 1 AS col1, col2 FROM DUAL 2 AS')
    Inside the function, he must find the alias name COL1 and COL2.

    I would be grateful for any help.

    I modified print_table as fact and function to meet your needs.

    SQL> CREATE OR REPLACE TYPE my_column_object AS OBJECT(ruw_number integer, column_name VARCHAR2(1000), column_val VARCHAR2(1000))
      2  /
    
    Type created.
    
    SQL> CREATE OR REPLACE TYPE my_table_type AS TABLE OF my_column_object
      2  /
    
    Type created.
    
    SQL> CREATE OR REPLACE FUNCTION print_table( p_query in varchar2 ) RETURN my_table_type PIPELINED
      2  AS
      3      l_theCursor     INTEGER DEFAULT DBMS_SQL.OPEN_CURSOR;
      4      l_columnValue   VARCHAR2(4000);
      5      l_status        INTEGER;
      6      l_descTbl       DBMS_SQL.DESC_TAB;
      7      l_colCnt        NUMBER;
      8      l_rcount           INTEGER := 0;
      9  BEGIN
     10      DBMS_SQL.PARSE(  l_theCursor,  p_query, dbms_sql.native );
     11
     12      DBMS_SQL.DESCRIBE_COLUMNS( l_theCursor, l_colCnt, l_descTbl );
     13
     14      FOR i IN 1 .. l_colCnt
     15      LOOP
     16          DBMS_SQL.DEFINE_COLUMN(l_theCursor, i, l_columnValue, 4000);
     17      end loop;
     18
     19      l_status := DBMS_SQL.EXECUTE(l_theCursor);
     20
     21      WHILE ( DBMS_SQL.FETCH_ROWS(l_theCursor) > 0 )
     22      LOOP
     23             l_rcount := l_rcount + 1;
     24          FOR i IN 1 .. l_colCnt
     25          LOOP
     26              DBMS_SQL.COLUMN_VALUE( l_theCursor, i, l_columnValue );
     27
     28              PIPE ROW(my_column_object(l_rcount,l_descTbl(i).col_name,l_columnValue));
     29          END LOOP;
     30      END LOOP;
     31
     32     RETURN;
     33  end;
     34  /
    
    Function created.
    
    SQL> select * from table(print_table('select * from emp'))
      2  /
    
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
    ---------- -------------------- --------------------
             1 EMPNO                7369
             1 ENAME                SMITH
             1 JOB                  CLERK
             1 MGR                  7902
             1 HIREDATE             17-DEC-80
             1 SAL                  800
             1 COMM
             1 DEPTNO               20
             1 DIV                  10
             2 EMPNO                7499
             2 ENAME                ALLEN
    
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
    ---------- -------------------- --------------------
             2 JOB                  SALESMAN
             2 MGR                  7698
             2 HIREDATE             20-FEB-81
             2 SAL                  1600
             2 COMM                 300
             2 DEPTNO               30
             2 DIV                  10
             3 EMPNO                7521
             3 ENAME                WARD
             3 JOB                  SALESMAN
             3 MGR                  7698
    
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
    ---------- -------------------- --------------------
             3 HIREDATE             22-FEB-81
             3 SAL                  1250
             3 COMM                 500
             3 DEPTNO               30
             3 DIV                  10
             4 EMPNO                7566
             4 ENAME                JONES
             4 JOB                  MANAGER
             4 MGR                  7839
             4 HIREDATE             02-APR-81
             4 SAL                  2975
    
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
    ---------- -------------------- --------------------
             4 COMM
             4 DEPTNO               20
             4 DIV                  10
             5 EMPNO                7654
             5 ENAME                MARTIN
             5 JOB                  SALESMAN
             5 MGR                  7698
             5 HIREDATE             28-SEP-81
             5 SAL                  1250
             5 COMM                 1400
             5 DEPTNO               30
    
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
    ---------- -------------------- --------------------
             5 DIV                  10
             6 EMPNO                7698
             6 ENAME                BLAKE
             6 JOB                  MANAGER
             6 MGR                  7839
             6 HIREDATE             01-MAY-81
             6 SAL                  2850
             6 COMM
             6 DEPTNO               30
             6 DIV                  10
             7 EMPNO                7782
    
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
    ---------- -------------------- --------------------
             7 ENAME                CLARK
             7 JOB                  MANAGER
             7 MGR                  7839
             7 HIREDATE             09-JUN-81
             7 SAL                  2450
             7 COMM
             7 DEPTNO               10
             7 DIV                  10
             8 EMPNO                7788
             8 ENAME                SCOTT
             8 JOB                  ANALYST
    
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
    ---------- -------------------- --------------------
             8 MGR                  7566
             8 HIREDATE             19-APR-87
             8 SAL                  3000
             8 COMM
             8 DEPTNO               20
             8 DIV                  10
             9 EMPNO                7839
             9 ENAME                KING
             9 JOB                  PRESIDENT
             9 MGR
             9 HIREDATE             17-NOV-81
    
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
    ---------- -------------------- --------------------
             9 SAL                  5000
             9 COMM
             9 DEPTNO               10
             9 DIV                  10
            10 EMPNO                7844
            10 ENAME                TURNER
            10 JOB                  SALESMAN
            10 MGR                  7698
            10 HIREDATE             08-SEP-81
            10 SAL                  1500
            10 COMM                 0
    
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
    ---------- -------------------- --------------------
            10 DEPTNO               30
            10 DIV                  10
            11 EMPNO                7876
            11 ENAME                ADAMS
            11 JOB                  CLERK
            11 MGR                  7788
            11 HIREDATE             23-MAY-87
            11 SAL                  1100
            11 COMM
            11 DEPTNO               20
            11 DIV                  10
    
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
    ---------- -------------------- --------------------
            12 EMPNO                7900
            12 ENAME                JAMES
            12 JOB                  CLERK
            12 MGR                  7698
            12 HIREDATE             03-DEC-81
            12 SAL                  950
            12 COMM
            12 DEPTNO               30
            12 DIV                  10
            13 EMPNO                7902
            13 ENAME                FORD
    
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
    ---------- -------------------- --------------------
            13 JOB                  ANALYST
            13 MGR                  7566
            13 HIREDATE             03-DEC-81
            13 SAL                  3000
            13 COMM
            13 DEPTNO               20
            13 DIV                  10
            14 EMPNO                7934
            14 ENAME                MILLER
            14 JOB                  CLERK
            14 MGR                  7782
    
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
    ---------- -------------------- --------------------
            14 HIREDATE             23-JAN-82
            14 SAL                  1300
            14 COMM
            14 DEPTNO               10
            14 DIV                  10
    
    126 rows selected.
    
    SQL>
    

    Thank you
    Knani.

    Published by: Karthick_Arp on September 23, 2008 12:11 AM

  • How to get the sql query

    Hello

    I already set date value as below.
    SET THE VALUE OF START_TIME = 2011-08-12 09:00
    DEFINE END_TIME = 2011-08-12 10:00
    and executes the table based on the defined date as below,
    Select * from my_table
    where
    (to_date (Accounting_Start_Time,'yyyy-mm-dd HH24:MI:SS) > = to_date ('& start_time ',' yyyy-mm-dd HH24:MI:SS) and to_date (Accounting_Stop_Time,'yyyy-mm-dd HH24:MI:SS) < = to_date ('& end_time ',' yyyy-mm-dd HH24:MI:SS))
    GOLD to_date (Accounting_Start_Time,'yyyy-mm-dd HH24:MI:SS) > = to_date ('& start_time ',' yyyy-mm-dd HH24:MI:SS) and to_date (Accounting_Stop_Time,'yyyy-mm-dd HH24:MI:SS) > = to_date ('& end_time ',' yyyy-mm-dd HH24:MI:SS) and to_date (Accounting_Start_Time,'yyyy-mm-dd HH24:MI:SS) < = to_date ('& end_time ',' yyyy-mm-dd HH24:MI:SS)
    GOLD to_date (Accounting_Start_Time,'yyyy-mm-dd HH24:MI:SS) < = to_date ('& start_time ',' yyyy-mm-dd HH24:MI:SS) and to_date (Accounting_Stop_Time,'yyyy-mm-dd HH24:MI:SS) < = to_date ('& end_time ',' yyyy-mm-dd HH24:MI:SS) and to_date (Accounting_Stop_Time,'yyyy-mm-dd HH24:MI:SS) > = to_date ('& start_time ',' yyyy-mm-dd HH24:MI:SS)
    GOLD to_date (Accounting_Start_Time,'yyyy-mm-dd HH24:MI:SS) < = to_date ('& start_time ',' yyyy-mm-dd HH24:MI:SS) and to_date (Accounting_Stop_Time,'yyyy-mm-dd HH24:MI:SS) > = to_date ('& end_time ',' yyyy-mm-dd HH24:MI:SS));
    ) but now I want to query the table based on the time,

    Any help please,.

    Hello

    It is not very hard in SQL * more.

    First of all, put your query in a script file, like this one, called hour_query.sql:

    --     hour_query.sql          Show data from my_table for a given time period
    
    PROMPT     The data below shows the period from &1 to &2
    PROMPT
    
    SELECT     *
    FROM     my_table
    WHERE     accounting_start_time     <= '&2'
    AND     '&1'               <= accounting_stop_time
    ;
    

    Parameters & 1 and & 2 are beginning and end of time, for example "2011-08-12 09:00".
    Note that this does not use TO_DATE. If you have incorrect strings in columns that must be DATEs, no errors occur.

    Assuming that hour_query.sql is located on p:\some_dir\, you want another script that runs hour_query.sql 24 times, like this one, which I will call all_hours.sql:

    @p:\some_dir\hour_query  "2011-08-12 09:00:00"  "2011-08-12 10:00:00"
    @p:\some_dir\hour_query  "2011-08-12 10:00:00"  "2011-08-12 11:00:00"
    @p:\some_dir\hour_query  "2011-08-12 11:00:00"  "2011-08-12 12:00:00"
    ...
    

    (I just did 3 hours to test. You can easily make that 24 hours).

    The following code creates and then runs all_hours.sql:

    -- Turn off SQL*Plus features that interfere with raw output
    SET     FEEDBACK     OFF
    SET     PAGESIZE     0
    SET     VERIFY          OFF
    
    -- Write all_hours.sql
    SPOOL     p:\&some_dir\all_hours.sql
    
    WITH     got_start_time     AS
    (
         SELECT TO_DATE ( '2011-08-12 09:00:00'
                            , 'YYYY-MM-DD HH24:MI:SS'
                     ) AS start_time
         FROM    dual
    )
    SELECT     '@p:\some_dir\hour_query  "'
        ||  TO_CHAR ( start_time + ((LEVEL - 1) / 24)
              , 'YYYY-MM-DD HH24:MI:SS'
              )
        ||  '"  "'
        ||  TO_CHAR ( start_time + ( LEVEL      / 24)
              , 'YYYY-MM-DD HH24:MI:SS'
              )
        ||  '"'
    FROM    got_start_time
    CONNECT BY     LEVEL <= 3     -- You can make this 24, or any other number
    ;
    
    SPOOL     OFF
    
    -- Turn on SQL*Plus features turned off earlier
    SET     FEEDBACK     ON
    SET     PAGESIZE     50
    -- Except VERIFY.  leave that OFF while all_hours runs
    --SET     VERIFY          OFF
    
    -- Run all_hours.sql
    @p:\some_dir\all_hours.sql
    
    SET     VERIFY     ON
    
  • Building of transport returns using the report query

    I use report Querys and report layouts. I am trying to build in some carriage returns that will recognize in my rtf model. I tried to use "Chr (10)", br, etc, but it does not work. It prints the characters instead of the carriage return. Am something Imissing?

    < COMMENTS01 > MATHEMATICS (GEL, J): rarely hands duties in time rarely comes to the class at the time. Reasons for retention Possible William works well on chr (10) MEDIA (HATTER, M): doing well on tests shows a willingness to learn chr (10) READING (ANDERSON, L): doing well on tests done well on quizzes here are the notes for their ease, these are notes of understanding. Chr (10) SCIENCE (RESOURCES, M): Basic Code 1 has trouble with Jupiter. Chr (10) < / COMMENTS01 >

    Bob,

    The literal string "Chr (10)" won't help you much.

    select 'mystring'||'chr(10)'||'mystring' from dual; -- returns 'mystringchr(10)mystring'
    select 'mystring'|| chr(10) ||'mystring' from dual; -- returns 'mystring
    mystring'
    

    See you soon,.
    Janet Tyson

Maybe you are looking for

  • Is it possible to use my iPhone as a mouse and a keyboard officially from Apple?

    I know that there are 3rd party apps, but is there a way to use my iPhone as a keyboard or a mouse/trackpad? I mean, I mean, my iPhone can connect with my computer as my Apple Watch done with my iPhone? Is there a way that apple can enable constant c

  • Apple ID hacked over a month

    My apple ID has been hacked by a person out of China more than a month. Apple notified immediately when the e-mails started coming. I was told it would take about a week, but always when I call support they tell me that the engineering team haven't s

  • Problems with version 28

    From the moment where I updated the version 28 of Firefox a few days ago whenever I write a link in the toolbar and press 'go to address' or press enter, it refuses to load whatever it is and just stay where he is. At least I have go through the rese

  • Cursor button Lenovo Y570 GPU broke.

    The button that goes into the USB port, which transforms the on / off the GPU on my lenovo y570 broke. More acuratly little pin that goes between the cursor button, and the item itself on the motherboard broke. The only way to solve this problem is t

  • Question upgrade Ram M2N68 - narrated (5)

    I hope someone can help me here;  in any case, to start with, the motherboard M2N68 - THE has a Phenom II X 4 945 cpu and 4 GB PNY pc2-6400 optimima running at 1.8 volts on a Win 7 64 bit OS.  I want to do is increase the Ram up to 8 GB of ram (2 x 4