Timezone query

I need to convert current date to alaska timezone.. wats the query in sql developer?

SQL> select systimestamp,systimestamp at time zone 'America/Anchorage' from dual
  2  /
SYSTIMESTAMP
SYSTIMESTAMPATTIMEZONE'AMERICA/ANCHORAGE'
26-MAR-12 06.27.00.984000 AM -04:00
26-MAR-12 02.27.00.984000 AM AMERICA/ANCHORAGE
SQL>  SY.

Similar Messages

  • Timezone effects on Date and Timestamp fields in af:query component

    Hello,
    I'm working on an ADF application where time zone is configured as follows:
    * Dynamic View Layer time zone is configured in trinidad-config.xml file and bound to a session scoped value:
    <trinidad-config>
      <skin-family>fusionFx</skin-family>
      <time-zone>#{sessionScope.tz}</time-zone>
    </trinidad-config>* ADF BC time zone is configured in adf-config.xml file and bound to View Layer time zone:
    <adf-config>
      <user-time-zone-config xmlns="http://xmlns.oracle.com/adf/usertimezone/config">
        <user-timezone expression="#{adfFacesContext.timeZone.ID}"/>
      </user-time-zone-config>
    </adf-config>The problem here is that Dates and Timestamp values work as expected all over the application except for the af:query component. When displayed as af:inputDate in af:form, Dates and Timestamp values are NOT getting converted to the time zone (TZ) configured in trinidad-config.xml file, whereas TimestampTz and TimestampLtz are. However, when displayed in af:query component, Dates and Timestamp values are automatically converted to View Layer TZ after a search has been performed.
    For example, say View Layer TZ = US/Pacific and we enter 01/jun/2011 as a search criteria of type Date and then click on the Search button. The displayed value automatically changes to 25/nov/2011, that is, it gets converted to the WLS JVM time zone, which is set to Europe/London.
    Is conversion of Date and Timestamps in af:query component the expected behaviour or could this be a bug?
    Is there any way to avoid this conversion?
    Thanks in advance
    Version:
    ADF Business Components 11.1.1.59.23
    Java(TM) Platform 1.6.0_21
    Oracle IDE 11.1.1.4.37.59.23
    PMD JDeveloper Extension 4.2.5.3.0
    Repost on 26-nov-2011 9:29
    Repost on 28-nov-2011 15:10
    Edited by: Barbara Gelabert on 26-nov-2011 9:29
    Edited by: Barbara Gelabert on 28-nov-2011 15:10

    Hi,
    Thanks for your reply. This certainly seems promising. However, I am getting a connection error now.
    The following...
    jar_loaded = require 'ojdbc14.jar'
    puts "Oracle jar loaded? #{jar_loaded}"
    puts "Starting active record"
    require 'rubygems'
    gem 'activerecord'
    gem 'activerecord-oracle_enhanced-adapter'
    require 'activerecord'
    puts "Connecting to MXGN"
    ActiveRecord::Base.establish_connection(
    :adapter => 'oracle_enhanced',
    :host => 'THEHOST',
    :port => '1550',
    :database => 'THEDB',
    :username => 'THEUSER',
    :password => 'THEPASSWORD'
    ... produces
    Oracle jar loaded? true
    Starting active record
    Connecting to MXGN
    ERROR: ActiveRecord oracle_enhanced adapter could not load Oracle JDBC driver. Please install ojdbc14.jar library.
    ERROR: ActiveRecord oracle_enhanced adapter could not load Oracle JDBC driver. Please install ojdbc14.jar library.
    C:/jruby/jruby-1.2.0/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:76:in `establish_connection': Please install the oracle_enhanced adapter: `gem install activerecord-oracle_enhanced-adapter` (LoadError) (RuntimeError)
    from H:\sandbox\DBPlay\lib\main_enhanced.rb:12
    I'm confused. Am I missing the driver, or have I failed to setup the enhanced Oracle adapter?
    I have tried moving the jar to $JRUBY_HOME/lib too, but the result was the same.
    All help would be greatly appreciated.
    Many Thanks
    Adrian

  • ORA-00604: error occurred at recursive SQL level 1 ORA-01882: timezone

    Hi
    I'm trying to config my base_domain for SOA11g but i'm getting the following error when connecting to my Oracle XE DB to configure SOA,
    please help thanks
    Software installed
    OS: Windows 7 64bit
    DB: Oracle XE 10g
    Oracle SOA 11.1.1.4.0
    Oracle RCU 11.1.1.4.0
    Oracle wls1034_generic
    Error Detials
    Component Schema=SOA Infrastructure
    Driver=oracle.jdbc.xa.client.OracleXADataSource
    URL=jdbc:oracle:thin:@127.0.0.1:1521/XE
    User=DEV_SOAINFRA
    Password=********
    SQL Test=select 1 from schema_version_registry where owner=(select user from dual) and mr_type='SOAINFRA' and version='11.1.1.4.0'
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01882: timezone region  not found
    CFGFWK-60850:  Test Failed!
    Component Schema=User Messaging Service
    Driver=oracle.jdbc.OracleDriver
    URL=jdbc:oracle:thin:@127.0.0.1:1521/XE
    User=DEV_ORASDPM
    Password=********
    SQL Test=select 1 from schema_version_registry where owner=(select user from dual) and mr_type='ORASDPM' and version='11.1.1.2.0'
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01882: timezone region  not found
    CFGFWK-60850:  Test Failed!
    Component Schema=OWSM MDS Schema
    Driver=oracle.jdbc.OracleDriver
    URL=jdbc:oracle:thin:@127.0.0.1:1521/XE
    User=DEV_MDS
    Password=********
    SQL Test=select 1 from schema_version_registry where
                        owner=(select user from dual) and mr_type='MDS' and
                        version='11.1.1.4.0'
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01882: timezone region  not found
    CFGFWK-60850:  Test Failed!
    Component Schema=SOA MDS Schema
    Driver=oracle.jdbc.OracleDriver
    URL=jdbc:oracle:thin:@127.0.0.1:1521/XE
    User=DEV_MDS
    Password=********
    SQL Test=select 1 from schema_version_registry where owner=(select user from dual) and mr_type='MDS' and version='11.1.1.4.0'
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01882: timezone region  not found
    CFGFWK-60850:  Test Failed!
    Component Schema=OSB JMS Reporting Provider
    Driver=org.apache.derby.jdbc.ClientDriver
    URL=jdbc:derby://127.0.0.1:1521/XE;create=true;ServerName=127.0.0.1;databaseName=XE
    User=DEV_SOAINFRA
    Password=********
    SQL Test=SELECT 1 FROM SYS.SYSTABLES
    Insufficient data while reading from the network - expected a minimum of 6 bytes and received only 0 bytes.  The connection has been terminated.
    CFGFWK-60850:  Test Failed!

    Hi,
    Please check the timezone set in your server where Weblogic is installed. Also ensure the timezone on which your weblogic is running, the same is present in in database by querying V$TIMEZONE_NAMES table. If it is not present then please change the timezone of the server. then try to execute the steps what you are doing, it will not throw any error.
    if this helps please mark.
    Thanks,
    Kishore

  • How can I replace the cursor in the below query?

    I have this below query which calls a stored procedure that takes only 1 item's attributes at a time. But because of performance problems we are
    required to remove the cursor. How can I replace the below cursor logic with set operations or CTE? Please advice.
    DECLARE db_cursor_ava CURSOR
    FOR
    SELECT t.[agent-id],
    t.[start-date],
    t.[end-date],
    t.[monitor-days],
    t.[monitor-start],
    t.[monitor-end],
    t.[timezone-offset]
    FROM @tmpAgentPeriodTimeRange t
    OPEN db_cursor_ava
    FETCH NEXT FROM db_cursor_ava INTO @agentID_ava,
    @stDateTime_ava,
    @endDateTime_ava,
    @monDays_ava,
    @monSt_ava,
    @monEnd_ava,
    @offset_ava
    WHILE @@FETCH_STATUS = 0
    BEGIN
    DELETE
    FROM @tmpMonitorPeriod
    DELETE
    FROM @tmpFinalResult
    SET @runID = 1
    IF(@endDateTime_ava>DATEADD(MI,@offset_ava, GETUTCDATE()))
    BEGIN
    SET @endDateTime_ava=DATEADD(MI,@offset_ava, GETUTCDATE())
    END
    INSERT INTO @tmpMonitorPeriod
    EXEC core.usp_GetMonitoringPeriod
    @startDate = @stDateTime_ava,
    @endDate = @endDateTime_ava,
    @monitoringDays = @monDays_ava,
    @monitoringStart = @monSt_ava,
    @monitoringEnd = @monEnd_ava
    SELECT @maxID = MAX(tm.id)
    FROM @tmpMonitorPeriod tm
    FETCH NEXT FROM db_cursor_ava INTO @agentID_ava,
    @stDateTime_ava,
    @endDateTime_ava,
    @monDays_ava,
    @monSt_ava,
    @monEnd_ava,
    @offset_ava
    END
    CLOSE db_cursor_ava
    DEALLOCATE db_cursor_ava
    mayooran99

    You've been down this path before  - and the response is exactly the same.
    how to replace cursor logic
    And I'll suggest that you post the entire code - since you repeatedly delete 2 table variables but only populate one. The setting of @maxID also seems to have no purpose. And perhaps the issue here isn't the cursor but the general approach.  Who knows
    - but it appears you may have prematurely assumed that the cursor is the problem.

  • Trying to query data from a view - ORA-01882 and ORA-02063 Errors

    Hey there,
    I tried to query data from a view that was provided by a colleague. This view works fine and gives correct data using PL/SQL Developer or SQLPLUS, but in SQL Developer, I get the following error:
    ORA-01882: Time zone region not found
    ORA-02063: preceding line from SYSTOOLS
    01882.00000 - "timezone region %s not found"
    * Cause: Specified reason name was not found
    * Action: Please contact Oracle Customer Support
    Vendor Code 1882
    Where comes this error message from?! SYSTOOLS is the database link.
    Can't see an obvious reason for this error.
    OS is Windows 2000 SP4, SQL Developer is v1.1.1.25 BUILD MAIN-25.14
    Regards,
    Thomas

    From Oracle Messages 'Cause and Action'
    http://www.oracle.com/technology/products/designer/supporting_doc/des9i_90210/cmnhlp72/messages/ora_messages.htm
    ORA-01882, 00000, "timezone region %s not found"
    Cause: The specified region name was not found.
    Action: Please contact Oracle Customer Support.
    Maybe invalid region in NLS_LANG?
    "select * from v$nls_parameters"
    Starting this script in all developer program and compared result...

  • Using a date field in a JDOQL query crashes

    Hello:
    I am trying to use a date field in a JDOQL filter. It appears from the
    log file that the date is not being substituted into the SQL.
    It is not clear from the JDOQL spec how to do date queries.... doing date
    queries in SQL involves several special operators, yet the
    JDOQL defines the ">" and "<" operators as working on dates....and there is
    no mention of date specific operators so I am hoping that I
    can do a filter where I compare a date to an input parameter date using the
    ">" and "<" operators...
    I have enclosed a copy of my driver code, followed by an except of my class
    that contains the date, followed by the kodo exception log
    I can't see where I am doing anything that violates the JDOQL spec and I
    don't see any other way of doing date comparisions.
    Brian
    Here is the driver code that I am attempting:
    public void getDateRange ()
    PersistenceManager pm = JDOFactory.getPersistenceManager ();
    String filter = "leafDates.contains (cdate) & cdate.statusName ==
    myStatus & cdate.datePhaseStarted > myDate";
    Date date = new Date ();
    Calendar calendar = new GregorianCalendar (TimeZone.getDefault ());
    calendar.set (2002, Calendar.DECEMBER, 26);
    date=calendar.getTime();
    Extent extent = pm.getExtent (LeafBase.class, false);
    Query query = pm.newQuery (LeafBase.class, filter);
    query.declareImports ("import aqueduct.*; import java.util.Date");
    query.declareVariables ("aqueduct.LeafDate cdate; Date myDate");
    query.declareParameters ("String myStatus");
    System.out.println ("dated used = " + date);
    Collection results = (Collection) query.execute ("closed", date);
    Iterator iter = results.iterator ();
    while (iter.hasNext () ) {
    LeafBase myLeaf = (LeafBase) iter.next ();
    System.out.println ("My leaf = " + myLeaf);
    pm.close ();
    Here is the class:
    public class LeafDate implements Serializable
    // *******The Attributes***************
    private Date datePhaseStarted = null;
    private boolean isEstimatedDate = false;
    //mark this as non-persistent in the JDO metadata
    private StatusType status = null;
    //put here to enable one-to-many mapping using a single table in JDO
    private LeafBase parent = null;
    Here is the error I am getting:
    C:\bcs\jdo\kodo-jdo-2.4.0\aqueduct>java aqueduct.DealMaint dated used = Thu
    Dec 26 08:47:33 CST 2002
    Exception in thread "main" javax.jdo.JDODataStoreException:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=SELECT DISTINCT t0.ID, t0.JDOCLASS, t0.IS_CONFLICT, t0.CURRENCYX,
    t0.DEALPARENTX, t0.PARENTX, t0.PRODUCTKIND, t0.T_SIZE, t0.STATUSNAME FROM
    JDO_DATE t1, JDO_LEAF t0 WHERE ((t1.STATUSNAME = 'closed' AND t1.DATESTARTED
    *variable*) AND t0.ID = t1.PARENTX) PRE=SELECT DISTINCT t0.ID,
    t0.JDOCLASS, t0.IS_CONFLICT, t0.CURRENCYX, t0.DEALPARENTX, t0.PARENTX,
    t0.PRODUCTKIND, t0.T_SIZE, t0.STATUSNAME FROM JDO_DATE t1, JDO_LEAF t0 WHERE
    ((t1.STATUSNAME = ? AND t1.DATESTARTED > *variable*) AND t0.ID =
    t1.PARENTX)
    ORA-00936: missing expression
    [code=936;state=42000]
    NestedThrowables:com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=SELECT DISTINCT t0.ID, t0.JDOCLASS, t0.IS_CONFLICT, t0.CURRENCYX,
    t0.DEALPA RENTX, t0.PARENTX, t0.PRODUCTKIND, t0.T_SIZE, t0.STATUSNAME FROM
    JDO_DATE t1, JD O_LEAF t0 WHERE ((t1.STATUSNAME = 'closed' AND
    t1.DATESTARTED > *variable*) AND t0.ID = t1.PARENTX)] [PRE=SELECT DISTINCT
    t0.ID, t0.JDOCLASS, t0.IS_CONFLICT, t0.CURRENCYX, t0.DEALPA RENTX,
    t0.PARENTX, t0.PRODUCTKIND, t0.T_SIZE, t0.STATUSNAME FROM JDO_DATE t1, JD
    O_LEAF t0 WHERE ((t1.STATUSNAME = ? AND t1.DATESTARTED > *variable*) AND
    t0.ID = t1.PARENTX)]
    ORA-00936: missing expression
    at
    com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.throwDataStore(SQLExcep
    tions.java:23)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
    reManager.java:742)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.executeQuery(JDBCQuery.java
    :92)
    at com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:792)
    at com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:668)
    at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:623)
    at aqueduct.DealMaint.getDateRange(DealMaint.java:523)
    at
    aqueduct.DealMaint.main(DealMaint.java:35)NestedThrowablesStackTrace:java.sq
    l.SQLException:
    ORA-00936: missing expression
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:643)
    at
    oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:1819)
    at
    oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java
    :2015)
    at
    oracle.jdbc.driver.OraclePreparedStatement.doScrollPstmtExecuteUpdate(Oracle
    PreparedStatement.java:3021)
    at
    oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedState
    ment.java:416)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePrepare

    Oh, thanks for pointing this out.... I got caught up in trying to figure out
    the date issues, I missed the obvious.
    Brian
    "Patrick Linskey" <[email protected]> wrote in message
    news:[email protected]...
    Brian,
    The problem is that you're declaring myDate as a variable instead of a
    parameter. Yes, we should be doing better error checking. But that's the
    problem.
    So, change your declareVariables() and declareParameters() statements
    accordingly, and all should work out.
    -Patrick
    Brian Smith wrote:
    Here is the driver code that I am attempting:
    public void getDateRange ()
    PersistenceManager pm = JDOFactory.getPersistenceManager ();
    String filter = "leafDates.contains (cdate) & cdate.statusName ==
    myStatus & cdate.datePhaseStarted > myDate";
    Date date = new Date ();
    Calendar calendar = new GregorianCalendar (TimeZone.getDefault
    >>
    calendar.set (2002, Calendar.DECEMBER, 26);
    date=calendar.getTime();
    Extent extent = pm.getExtent (LeafBase.class, false);
    Query query = pm.newQuery (LeafBase.class, filter);
    query.declareImports ("import aqueduct.*; importjava.util.Date");
    >>
    query.declareVariables ("aqueduct.LeafDate cdate; Date myDate");
    query.declareParameters ("String myStatus");
    System.out.println ("dated used = " + date);
    Collection results = (Collection) query.execute ("closed", date);
    Iterator iter = results.iterator ();
    while (iter.hasNext () ) {
    LeafBase myLeaf = (LeafBase) iter.next ();
    System.out.println ("My leaf = " + myLeaf);
    pm.close ();
    >
    Here is the class:
    public class LeafDate implements Serializable
    // *******The Attributes***************
    private Date datePhaseStarted = null;
    private boolean isEstimatedDate = false;
    //mark this as non-persistent in the JDO metadata
    private StatusType status = null;
    //put here to enable one-to-many mapping using a single table in JDO
    private LeafBase parent = null;
    >
    Here is the error I am getting:
    C:\bcs\jdo\kodo-jdo-2.4.0\aqueduct>java aqueduct.DealMaint dated used
    = Thu
    Dec 26 08:47:33 CST 2002
    Exception in thread "main" javax.jdo.JDODataStoreException:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=SELECT DISTINCT t0.ID, t0.JDOCLASS, t0.IS_CONFLICT, t0.CURRENCYX,
    t0.DEALPARENTX, t0.PARENTX, t0.PRODUCTKIND, t0.T_SIZE, t0.STATUSNAMEFROM> > JDO_DATE t1, JDO_LEAF t0 WHERE ((t1.STATUSNAME = 'closed' AND> > t1.DATESTARTED> >> > >*variable*) AND t0.ID = t1.PARENTX) [PRE=SELECT DISTINCT t0.ID,
    >
    ORA-00936: missing expression
    [code=936;state=42000]
    NestedThrowables:com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=SELECT DISTINCT t0.ID, t0.JDOCLASS, t0.IS_CONFLICT, t0.CURRENCYX,
    t0.DEALPA RENTX, t0.PARENTX, t0.PRODUCTKIND, t0.T_SIZE, t0.STATUSNAMEFROM
    JDO_DATE t1, JD O_LEAF t0 WHERE ((t1.STATUSNAME = 'closed' AND
    t1.DATESTARTED > variable) AND t0.ID = t1.PARENTX)] [PRE=SELECTDISTINCT
    t0.ID, t0.JDOCLASS, t0.IS_CONFLICT, t0.CURRENCYX, t0.DEALPA RENTX,
    t0.PARENTX, t0.PRODUCTKIND, t0.T_SIZE, t0.STATUSNAME FROM JDO_DATE t1,JD
    O_LEAF t0 WHERE ((t1.STATUSNAME = ? AND t1.DATESTARTED > variable) AND
    t0.ID = t1.PARENTX)]
    ORA-00936: missing expression
    at
    com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.throwDataStore(SQLExcep
    tions.java:23)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
    reManager.java:742)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.executeQuery(JDBCQuery.java
    :92)
    atcom.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:792)
    >>
    at
    com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:668)
    >>
    at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:623)
    at aqueduct.DealMaint.getDateRange(DealMaint.java:523)
    at
    aqueduct.DealMaint.main(DealMaint.java:35)NestedThrowablesStackTrace:java.sq
    l.SQLException:
    ORA-00936: missing expression
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
    at
    oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:643)
    >>
    at
    oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:1819)
    >>
    at
    oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java
    :2015)
    at
    oracle.jdbc.driver.OraclePreparedStatement.doScrollPstmtExecuteUpdate(Oracle
    PreparedStatement.java:3021)
    at
    oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedState
    ment.java:416)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePrepare
    Patrick Linskey [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Timezone problem in XML from data template

    The xml returned from one of my data templates seems to be randomly applying timezones of +00:00 or +01:00 to the dates.
    This is causing a problem in the PDF output from the report where the timezone is processed and some of the dates are showing as the day before that held in the database. The sql in the data template is just returning the raw column, no extra processing there. What's going on, is this a known bug?
    Appreciate any help you can provide.
    Cheers,
    Dave
    XML extract:
    - <G_TRX>
    <EXPENSE_TEMPLATE>N/AMiscellaneous Expenses</EXPENSE_TEMPLATE>
    <TEMPLATE_DATE_CREATED>2007-09-13T11:51:46.000+01:00</TEMPLATE_DATE_CREATED>
    <TEMPLATE_DATE_INACTIVATED>2008-06-05T00:00:00.000+01:00</TEMPLATE_DATE_INACTIVATED>
    <EXPENSE_ITEM>Evening Dress Hire</EXPENSE_ITEM>
    <ITEM_DATE_CREATED>2007-09-13T12:24:54.000+01:00</ITEM_DATE_CREATED>
    <ITEM_DATE_INACTIVATED />
    <TAX_CATEGORY>PAY</TAX_CATEGORY>
    <ASSIGNMENT_DATE>2007-09-28T00:00:00.000+01:00</ASSIGNMENT_DATE>
    <TAXCAT_DATE_INACTIVATED>2007-11-07T00:00:00.000+00:00</TAXCAT_DATE_INACTIVATED>
    </G_TRX>
    - <G_TRX>
    <EXPENSE_TEMPLATE>N/AMiscellaneous Expenses</EXPENSE_TEMPLATE>
    <TEMPLATE_DATE_CREATED>2007-09-13T11:51:46.000+01:00</TEMPLATE_DATE_CREATED>
    <TEMPLATE_DATE_INACTIVATED>2008-06-05T00:00:00.000+01:00</TEMPLATE_DATE_INACTIVATED>
    <EXPENSE_ITEM>Evening Dress Hire</EXPENSE_ITEM>
    <ITEM_DATE_CREATED>2007-09-13T12:24:54.000+01:00</ITEM_DATE_CREATED>
    <ITEM_DATE_INACTIVATED />
    <TAX_CATEGORY>P11D</TAX_CATEGORY>
    <ASSIGNMENT_DATE>2007-11-08T00:00:00.000+00:00</ASSIGNMENT_DATE>
    <TAXCAT_DATE_INACTIVATED>4712-12-31T00:00:00.000+00:00</TAXCAT_DATE_INACTIVATED>
    </G_TRX>
    - <G_TRX>
    <EXPENSE_TEMPLATE>N/AMiscellaneous Expenses</EXPENSE_TEMPLATE>
    <TEMPLATE_DATE_CREATED>2007-09-13T11:51:46.000+01:00</TEMPLATE_DATE_CREATED>
    <TEMPLATE_DATE_INACTIVATED>2008-06-05T00:00:00.000+01:00</TEMPLATE_DATE_INACTIVATED>
    <EXPENSE_ITEM>Evening Dress Purchase</EXPENSE_ITEM>
    <ITEM_DATE_CREATED>2007-09-13T12:24:54.000+01:00</ITEM_DATE_CREATED>
    <ITEM_DATE_INACTIVATED />
    <TAX_CATEGORY>PAY</TAX_CATEGORY>
    <ASSIGNMENT_DATE>2007-01-01T00:00:00.000+00:00</ASSIGNMENT_DATE>
    <TAXCAT_DATE_INACTIVATED>4712-12-31T00:00:00.000+00:00</TAXCAT_DATE_INACTIVATED>
    </G_TRX>
    SQL from data template:
    - <sqlStatement name="Q_TRX">
    - <![CDATA[
    select aer.REPORT_TYPE "EXPENSE_TEMPLATE"
    ,aer.CREATION_DATE "TEMPLATE_DATE_CREATED"
    ,aer.INACTIVE_DATE "TEMPLATE_DATE_INACTIVATED" 
    ,aerp.PROMPT "EXPENSE_ITEM"
    ,aerp.CREATION_DATE "ITEM_DATE_CREATED"
    ,aerp.END_DATE "ITEM_DATE_INACTIVATED"
    ,xaetl.TAX_CATEGORY "TAX_CATEGORY"
    ,xaetl.EFFECTIVE_START_DATE "ASSIGNMENT_DATE"
    ,xaetl.EFFECTIVE_END_DATE "TAXCAT_DATE_INACTIVATED"
    from ap_expense_reports aer
    ,ap_expense_report_params aerp
    ,xx_ap_expense_tax_lines_f xaetl
    where aer.EXPENSE_REPORT_ID = aerp.EXPENSE_REPORT_ID
    and aerp.PARAMETER_ID = xaetl.expense_report_parameter_id
    AND &p_exp_item_lines_where
    AND &p_tax_category_where
    AND &p_exp_template_where
    ORDER BY aer.REPORT_TYPE
    ,aerp.PROMPT
    ,xaetl.EFFECTIVE_START_DATE
      ]]>
    </sqlStatement>

    Tim
    Is is a sample record from the sql query. Sorry it's not the same as the XML above but the data has changed on the instance so some of the fields weren't populated on those records.
    EXPENSE_TEMPLATE,TEMPLATE_DATE_CREATED,TEMPLATE_DATE_INACTIVATED,EXPENSE_ITEM,ITEM_DATE_CREATED,ITEM_DATE_INACTIVATED,TAX_CATEGORY,ASSIGNMENT_DATE,TAXCAT_DATE_INACTIVATED
    "Long Term Detached Duty",12/09/2007 14:45:57,null,"LTDD:Air Travel
    Domestic",13/09/2007 11:45:08,null,"PSA",01/01/2007,31/12/4712
    First row is column names for ease of understanding :-)
    Appreciate any info you can provide on this.
    Cheers,
    Dave

  • Timezone issue

    Hi,
    I am based in Sydney, Australia and have the database with APEX runing here and Database timezone set to AEST (Australian Eastern Standard Time).
    Now, In one of the fields in my form, which links to a timestamp with local timezone column, 23/11/2010 (23rd November 2010) comes up as 22/11/2010, a day earlier when page is rendered.
    If I query that particular row, I get the correct value in SQL developer and SQL Plus.
    I have set Automatic Timezone on for the application which was supposed to extract users timezone in browser but no luck.
    Anyone ran into this problem? Any suggestions appreciated.
    My settings:
    Apex 4.2.2
    Theme 26.
    Oracle Database 11GR2

    Hi xarg-Xrc,
    Did you read this?
    (YABAOAE) Yet Another Blog About Oracle Application Express: Automatic Time Zone support in Application Express
    Regards
    Mahmoud

  • Bug report - OOB site column ArticleStartDate is crawled according to GMT0 not user/server timezone

    This issue can be reproduced easily on any SP2013 farm (on-premise) and I heard Sharepoint online do not have this problem.
    Issue: Site column "Article Date" with fieldname "ArticleStartDate" is crawled as GMT 0 regardless what timezone your web application, site setting, user setting and OS are set. Also when you submit a search you need to use GMT 0
    otherwise you will get wrong result. I believe it is bug because other datetime columns like "Modified" have handled timezone issue very well.
    To reproduce: On a SP2013 farm (on-premise), check your timezone settings (in my environment it is GMT+8). Then create a site collection and enable its Publishing Infrastructure feature. Then you will see some site columns are setup including "Article
    Date" (field name "ArticleStartDate"). Now create a custom content type and add some columns including "Article Date" to it. Create some sample items using the custom content type and remember fill in the value for "Article Date".
    By default it should allow you pick a "Date" only. After save the change you should see "Article Date" is saved like "2014-06-18 00:00:00" if check with powershell.
    After create some sample items start a full crawl. You will see find two crawled property "ows_q_DATE_ArticleStartDate" and "ows_ArticleStartDate" appear in Search Service Application -> Search Schema. There are some existing managed
    properties mapping to those crawled properties like "ArticleStartDateOWSDATE" (which is TEXT datatype).
    Here you can create some new managed property or use existing. Apply search using those properties to test. In my lab, I created "NewsArticleDate" as managed property and mapping to ows_ArticleStartDate. Then I create a blank
    page and add a "Search result" and "refinement panel" webpart and start some search. In the refinement panel added in the managed properties setup in previous steps. In the querystring I typed in something like /search.aspx?k=newsarticledate=YYYY/MM/dd
    It is what I see:
    1. As you can see in the refinement panel, because I am at GMT+8 and crawled index at GMT 0, the sample data "2014-06-18 00:00:00" will become "2014-06-17 16:00:00".
    2. Hence, in order to search out "2014-06-18 00:00:00"  item I have to input "2014-06-17" in search query! (in SP2013 the time part are ignored)
    3. By using the powershell provided by Ivan Josipovic (http://gallery.technet.microsoft.com/office/Get-Crawled-Property-names-9e8fc5e0), I can see the items
    ows_ArticleStartDate is "2014-06-18 00:00:00".
    I hope it is actually not a bug. Please let me know if my setting is wrong. Thank you!

    Hi Mark,
    According to your description, my understanding is that the Article Date column displayed with the value based on GMT0 in the Refinement web part.
    Microsoft SharePoint stores date and time values in Coordinated Universal Time (UTC, but also named GMT or Zulu) format, and almost all date and time values that are returned by members of the object model are in UTC format. So the value
    of the Article Date column stores the date and time in UTC format in the database, and the search indexes the UTC value of the Article Date column after crawling the database so that it displays the UTC value in Refinement web part.
    The list column values displayed in the lists that are obtained through the indexer for the SPListItem class are already formatted in the local time for the site so if you’re working on current context list item and fetch a datetime field
    like so SPContext.Current.ListItem["Your-DateTime-Field"] you’ll retrieve a DateTime object according the specified time zone in the regional settings.
    More references:
    http://francoisverbeeck.wordpress.com/2012/05/24/sharepoint-tip-of-the-day-be-careful-when-wor/
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • Database adapter - timezone value not being picked up

    We are using Oracle SOA suite v 11.1.1.6, along with database adapter to connect to different Oracle database - D1 and D2. All 3 system - SOA suite, D1 and D2 are set to different timezones. Within the SOA composite, we are using Database adapter to
    query data from Oracle database
    execute pl/sql stored procedure in Oracle database.
    In all cases we noticed that the date time data seen in the SOA EM console is same as in the respective database system, but surprisingly the timezone value in the data field is constant and it does matches with that of SOA suite.
    <D1_DATE>2013-08-15T01:10:00.000-06:00</D1_DATE>
    <D2_DATE>2013-08-15T02:10:00.000-06:00</D2_DATE>
    Ideally the timezone value should match with that of respective database, from where the date value is being picked up. Did we miss any set up or this a known issue ?
    Thanks.

    The database column is of "Date" data type. Was just checking, if the DB adapter can be configured to look into the timezone set at the Oracle data base and use that along with the actual data in the "Date" type column
    Am aware that, if i use the "Timestamp with Timezone" it works good.
    Thanks.

  • TIMEZONE question on 10.2.0.1.0

    Hi Experts,
    Env: Sun Solaris 8
    DB 10.2.0.1.0 -- Single instance
    a) I did set env variable as TZ=UTC
    b) When I check SQLPLUS from server, it is fine. i.e. It shows time in GMT
    SQL> select to_char(sysdate,'DD-MON-YYYY HH24:MI:SS') from dual ;
    TO_CHAR(SYSDATE,'DD-
    14-MAR-2007 18:51:23
    c) However, when I try from SQLPLUS client, it is NOT showing correctly.
    What I mean, it is still showing LOCAl time.
    SQL> select to_char(sysdate,'DD-MON-YYYY HH24:MI:SS') from dual ;
    TO_CHAR(SYSDATE,'DD-
    14-MAR-2007 12:59:08
    d) We use LDAP for connectyions.
    HOW TO FIX THIS?
    Thanks for help
    Regards
    Natrajan

    Get the current timezone
    SQL> SELECT DBTIMEZONE FROM DUAL;
    DBTIME
    +00:00
    Use the SET TIME_ZONE clause to set the time zone of the database. You can specify the time zone in two ways:
    1.By specifying a displacement from UTC (Coordinated Universal Time--formerly Greenwich Mean Time). The valid range of hh:mm is -12:00 to +14:00.
    ALTER DATABASE SET TIME_ZONE = '+02:00';
    OR
    2. By specifying a time zone region. To see a listing of valid region names, query the TZNAME column of the V$TIMEZONE_NAMES dynamic performance view.
    SELECT TZNAME FROM V$TIMEZONE_NAMES
    http://www.oracleabc.com/forums/viewthread.php?tid=30&extra=page%3D1

  • Error executing a query using a DB-Link

    Hi all,
    I'm trying to execute a query on a DB using a connection. I created a DB-LINK on the DB. executing the select:
    select sysdate from dual@lnk_db_prod;
    I get the following error:
    Error starting at line 1 in command:
    select sysdate from dual@lnk_db_prod
    Error at Command Line:1 Column:19
    Error report:
    SQL Error: ORA-01882: timezone region not found
    ORA-02063: preceding line from lnk_db_prod
    The error will be return executing any query on a db-link.
    It appens if I create a db-link using syntax referencing the SID and using the sintax with the complete connection string. Below the two example of db-link DDL commands:
    1.
    CREATE DATABASE LINK lnk_db_prod
    CONNECT TO prod IDENTIFIED BY prod
    USING 'DBPROD';
    2.
    create database link lnk_db_prod2
    connect to prod
    identified by prod
    using '(DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS =
    (PROTOCOL = TCP)
    (Host = 10.41.54.156)
    (Port = 1521)
    (CONNECT_DATA = (SID = DBPROD)
    Can you help me, please?
    bye,
    Ivan

    Hi,
    You would be better off posting / searching on other Oracle forums that deal more specifically with Application Servers. I googled "WebLogic set time_zone" and the first three hits were from our forums:
    Default TimeZone
    How to fix msg=ORA-01882: timezone region  not found
    http://kr.forums.oracle.com/forums/thread.jspa?messageID=9400587
    I hope one of the these is what you are looking for.
    Regards,
    Gary Graham
    SQL Developer Team

  • Help with SQL query invloving time operations

    I have created 2 tables in my SQL. One is the user_info table which stores the time of login and timezone of login for each user. The other is the post_table which stores the postid, user who makes the post, time of post and timezone for each posts.
    CREATE TABLE user_info
    user_id VARCHAR(20),
    login_date DATE,
    login_time_zone VARCHAR(20),
    PRIMARY KEY (user_id)
    CREATE TABLE post_table
    post_id VARCHAR(20), 
    user_id VARCHAR(20),
    datepost DATE, 
    time_zone VARCHAR(20),
    PRIMARY KEY (post_id),
    FOREIGN KEY (user_id) REFERENCES user_info(user_id) ON DELETE CASCADE
    ) ;Some sample data for my tables is as below -
    INSERT INTO user_info VALUES( 'u1', to_date('9/17/2009 20:00','MM/DD/YYYY mi:ss'), -2 );
    INSERT INTO user_info VALUES( 'u2', to_date('9/17/2009 19:55','MM/DD/YYYY mi:ss'), -4 );
    INSERT INTO post_table VALUES( 'p1', 'u1', to_date('9/17/2009 20:50','MM/DD/YYYY mi:ss'), 6 );
    INSERT INTO post_table VALUES( 'p2', 'u2', to_date('9/17/2009 20:30','MM/DD/YYYY mi:ss'), -5 );
    INSERT INTO post_table VALUES( 'p3', 'u2', to_date('9/18/2009 6:00','MM/DD/YYYY mi:ss'), 2 );
    INSERT INTO post_table VALUES( 'p4', 'u1', to_date('9/17/2009 21:00','MM/DD/YYYY mi:ss'), -3 );I need to write an SQL query which - finds the user(s) whose time difference between the login time and the latest time when he/she writes a post is the smallest. I need to consider the timezones here as well.
    I am unsure if time_zone should be of type VARCHAR or TIMESTAMP so have created it as VARCHAR in my tables.
    Someone please help me form this query.
    PS : How do I user <code> tags in this forum to write sql statements.
    Edited by: user11994430 on Oct 9, 2009 5:59 PM

    I tried with the following test data
    INSERT INTO user_info VALUES( 'u1', to_date('9/17/2009 20:00','MM/DD/YYYY mi:ss'), 1 );
    INSERT INTO user_info VALUES( 'u2', to_date('9/16/2009 13:00','MM/DD/YYYY mi:ss'), 1 );
    INSERT INTO user_info VALUES( 'u3', to_date('9/18/2009 15:00','MM/DD/YYYY mi:ss'), 0 );
    INSERT INTO user_info VALUES( 'u4', to_date('9/20/2009 17:00','MM/DD/YYYY mi:ss'), 0 );
    INSERT INTO user_info VALUES( 'u5', to_date('9/14/2009 3:00','MM/DD/YYYY mi:ss'), -3 );
    INSERT INTO user_info VALUES( 'u6', to_date('9/15/2009 6:00','MM/DD/YYYY mi:ss'), -3 );
    INSERT INTO user_info VALUES( 'u7', to_date('9/16/2009 7:00','MM/DD/YYYY mi:ss'), 0 );
    INSERT INTO user_info VALUES( 'u8', to_date('9/17/2009 8:00','MM/DD/YYYY mi:ss'), -8 );
    INSERT INTO user_info VALUES( 'u9', to_date('9/18/2009 9:00','MM/DD/YYYY mi:ss'), 0 );
    INSERT INTO user_info VALUES( 'u10', to_date('9/19/2009 10:00','MM/DD/YYYY mi:ss'), 1 );
    INSERT INTO user_info VALUES( 'u11', to_date('9/20/2009 11:00','MM/DD/YYYY mi:ss'), -5 );
    INSERT INTO user_info VALUES( 'u12', to_date('9/21/2009 19:00','MM/DD/YYYY mi:ss'), -8 );
    INSERT INTO user_info VALUES( 'u13', to_date('9/1/2009 4:00','MM/DD/YYYY mi:ss'), -3 );
    INSERT INTO user_info VALUES( 'u14', to_date('9/22/2009 7:00','MM/DD/YYYY mi:ss'), 1 );
    INSERT INTO user_info VALUES( 'u15', to_date('9/24/2009 23:00','MM/DD/YYYY mi:ss'), 1 );
    INSERT INTO user_info VALUES( 'u16', to_date('9/25/2009 11:00','MM/DD/YYYY mi:ss'), 1 );
    INSERT INTO user_info VALUES( 'u17', to_date('9/26/2009 18:00','MM/DD/YYYY mi:ss'), -4 );
    INSERT INTO user_info VALUES( 'u18', to_date('9/27/2009 13:00','MM/DD/YYYY mi:ss'), -8 );
    INSERT INTO user_info VALUES( 'u19', to_date('9/17/2009 18:00','MM/DD/YYYY mi:ss'), -5 );
    INSERT INTO user_info VALUES( 'u20', to_date('9/29/2009 22:00','MM/DD/YYYY mi:ss'), -8 );
    INSERT INTO user_info VALUES( 'u21', to_date('9/30/2009 5:00','MM/DD/YYYY mi:ss'), -8 );
    INSERT INTO user_info VALUES( 'u22', to_date('9/15/2009 7:00','MM/DD/YYYY mi:ss'), -4 );
    INSERT INTO user_info VALUES( 'u23', to_date('9/16/2009 17:00','MM/DD/YYYY mi:ss'), -8 );
    INSERT INTO user_info VALUES( 'u24', to_date('9/17/2009 19:00','MM/DD/YYYY mi:ss'), 0 );
    INSERT INTO user_info VALUES( 'u25', to_date('9/18/2009 22:00','MM/DD/YYYY mi:ss'), -5 );
    INSERT INTO user_info VALUES( 'u26', to_date('9/19/2009 15:00','MM/DD/YYYY mi:ss'), 1 );
    INSERT INTO user_info VALUES( 'u27', to_date('9/20/2009 23:00','MM/DD/YYYY mi:ss'), 1 );
    INSERT INTO post_table VALUES('p1', 'u26', to_date('9/14/2009 18:00','MM/DD/YYYY mi:ss'), -5 ) ;
    INSERT INTO post_table VALUES('p2', 'u2',  to_date('7/1/2009 15:00','MM/DD/YYYY mi:ss'), 1 ) ;
    INSERT INTO post_table VALUES('p3',  'u2',  to_date('7/20/2009 20:00','MM/DD/YYYY mi:ss'), 1  );
    INSERT INTO post_table VALUES('p4', 'u5',  to_date('7/20/2009 22:00','MM/DD/YYYY mi:ss'), 1) ;
    INSERT INTO post_table VALUES( 'p5',  'u2', to_date('7/21/2009 10:00','MM/DD/YYYY mi:ss'), 1  );
    INSERT INTO post_table VALUES(  'p6',  'u8',  to_date('8/1/2009 20:00','MM/DD/YYYY mi:ss'), -8  );
    INSERT INTO post_table VALUES( 'p7',  'u10', to_date('5/3/2009 15:00','MM/DD/YYYY mi:ss'), -3 ) ;
    INSERT INTO post_table VALUES( 'p8',  'u25', to_date('9/15/2009 20:00','MM/DD/YYYY mi:ss'), -5 ) ;
    INSERT INTO post_table VALUES(  'p9',  'u6', to_date('9/7/2009 19:00','MM/DD/YYYY mi:ss'), -3 ) ;
    INSERT INTO post_table VALUES( 'p10',  'u10', to_date('7/22/2009 10:00','MM/DD/YYYY mi:ss'), 1 ) ;
    INSERT INTO post_table VALUES( 'p11',  'u9',  to_date('7/7/2009 13:00','MM/DD/YYYY mi:ss'), 0) ;
    INSERT INTO post_table VALUES(  'p12', 'u2',  to_date('7/30/2009 11:00','MM/DD/YYYY mi:ss'), 1  );
    INSERT INTO post_table VALUES(  'p13', 'u10',  to_date('7/22/2009 8:00','MM/DD/YYYY mi:ss'), 1  );
    INSERT INTO post_table VALUES(  'p14',  'u6', to_date('5/30/2009 23:00','MM/DD/YYYY mi:ss'), 1  );
    INSERT INTO post_table VALUES(  'p15', 'u3',  to_date('5/31/2009 2:00','MM/DD/YYYY mi:ss'), 0 ) ;
    INSERT INTO post_table VALUES( 'p16', 'u12',  to_date('6/20/2009 7:00','MM/DD/YYYY mi:ss'), -8 ) ;
    INSERT INTO post_table VALUES(  'p17', 'u20',  to_date('6/20/2009 9:00','MM/DD/YYYY mi:ss'), -8) ;
    INSERT INTO post_table VALUES(  'p18','u27',  to_date('9/15/2009 11:00','MM/DD/YYYY mi:ss'), -5 );
    INSERT INTO post_table VALUES(  'p19','u26', to_date('7/1/2009 20:00','MM/DD/YYYY mi:ss'), 0 ) ;
    INSERT INTO post_table VALUES(  'p20', 'u25',  to_date('7/2/2009 17:00','MM/DD/YYYY mi:ss'), -5 );
    INSERT INTO post_table VALUES(  'p21', 'u27',  to_date('7/3/2009 20:00','MM/DD/YYYY mi:ss'), 1) ;
    INSERT INTO post_table VALUES( 'p22',  'u2',  to_date('9/15/2009 13:00','MM/DD/YYYY mi:ss'), 1 ) ;
    INSERT INTO post_table VALUES( 'p23',  'u21',  to_date('5/30/2009 17:00','MM/DD/YYYY mi:ss'), -8  );
    INSERT INTO post_table VALUES( 'p24',  'u25', to_date('8/30/2009 20:00','MM/DD/YYYY mi:ss'), -5  );
    INSERT INTO post_table VALUES(  'p25',  'u18', to_date('9/13/2009 18:00','MM/DD/YYYY mi:ss'), -8  );
    INSERT INTO post_table VALUES(  'p26',  'u11',  to_date('9/9/2009 13:00','MM/DD/YYYY mi:ss'), -8  );
    INSERT INTO post_table VALUES( 'p27',  'u23',  to_date('9/10/2009 1:00','MM/DD/YYYY mi:ss'), -5  );
    INSERT INTO post_table VALUES( 'p28',  'u22', to_date('9/10/2009 14:00','MM/DD/YYYY mi:ss'), -4  );The output I get is
    USER_ID
    u25
    u9
    u20
    u5
    u27
    u8
    u21
    u23
    u22
    u26
    u10
    USER_ID
    u3
    u12
    u18
    u2
    u6
    u11
    17 rows selected.

  • Oracle ODBC driver and TIMESTAMP with timezone

    Does anyone know if it is possible to return data from a "TIMESTAMP WITH TIMEZONE" column using the Oracle ODBC driver and an ADO Recordset?
    I am using the Oracle driver version 10.2.0.2 and TIMESTAMP fields work fine.
    I can call Recordset->Open() with a query like "SELECT * FROM TABLE" when the table contains a column of type timestamp with timezone but when I execute a statement to see if there are results as in
    if (!(srcRecsetPtr->BOF && srcRecsetPtr->EndOfFile))
    my application throws an unhandled exception and exits. The exception is not a COM exception and I'm not sure how to get back additional information if that's possible.
    The only information I've been able to find in searching TechNet and MetaLink is that a workaround is to wrap the columns in a TO_CHAR or TO_DATE conversion first but that's not a good solution for my problem since I am executing user specified SQL which may join multiple tables.
    I've found one other note that says the documentation should be corrected and that these fields are NOT supported period (Bug #4011640).
    I've experimented with the Bind Timestamp as Date option in the ODBC connection and with various ALTER SESSION settings to attempt to change the NLS_TIMESTAMP_TZ_FORMAT but I have been unable to get past the problem.
    Any ideas are greatly appreciated.
    Thanks,
    Troy

    Hi Justin
    Thanks for your help.
    I tried what you mentioned and I could connect myself via SQL*Plus without passing a password and a login, Extern authentification seems to work and my user seems to be right configurated.
    But he problem goes on via ODBC. When I test connection in the ODBC Data Source Administrator of Windows XP, test fails and seems to forbid connection without userID and password. When I try to connect via ODBC in my program the same problem appears : "Unable to connect SQLSTATE=28000 [Oracle][ODBC][ORA]Ora-01017: Invalid username/password;logon denied" I could not connect in this way.. What's wrong ?

  • View query execution taking more time

    hi all,
    what would be the reason that my event view is still not getting executed for around 24 hours.
    actually i created 2 event views one is like ora1 and another is like ora1_1 both are having the same data.
    the first view ora1 executed by 14 hours.
    but my second view still not get executed it is still running for last 30 hours.
    very urgent.
    plz tell me the reason for the delay
    and if possible provide me a solution too
    thanks in advance
    suresh

    Dear sir,
    Please find the Scripts & Explain Plan for the Scripts in the attachment (ABC.zip)
    ABCReports51_new.sql - Fetching values from EVENT_T_VIEW
    ABCReports51_new_1.sql - Fetching values from EVENT_T
    create_event_view.sql - Command executed to create EVENT_T_VIEW
    ExplainPlan4event_t.txt - Explain Plan for the Query fetching values from event_t table
    ExplainPlan4event_t_view.txt - Explain Plan for the Query fetching values from event_t_view
    indexed_columns.txt - Indexed columns in event_t
    TableDesc.txt - Table description for event_t, event_bal_impacts_t, event_session_dialup_t
    SQL> desc event_bal_impacts_t;
    Name Null? Type
    OBJ_ID0 NUMBER(38)
    REC_ID NUMBER(38)
    ACCOUNT_OBJ_DB NUMBER(38)
    ACCOUNT_OBJ_ID0 NUMBER(38)
    ACCOUNT_OBJ_TYPE VARCHAR2(255)
    ACCOUNT_OBJ_REV NUMBER(38)
    AMOUNT NUMBER
    AMOUNT_DEFERRED NUMBER
    AMOUNT_ORIG NUMBER
    DISCOUNT NUMBER
    GL_ID NUMBER(38)
    IMPACT_CATEGORY VARCHAR2(255)
    IMPACT_TYPE NUMBER(38)
    ITEM_OBJ_DB NUMBER(38)
    ITEM_OBJ_ID0 NUMBER(38)
    ITEM_OBJ_TYPE VARCHAR2(255)
    ITEM_OBJ_REV NUMBER(38)
    PERCENT NUMBER
    PRODUCT_OBJ_DB NUMBER(38)
    PRODUCT_OBJ_ID0 NUMBER(38)
    PRODUCT_OBJ_TYPE VARCHAR2(255)
    PRODUCT_OBJ_REV NUMBER(38)
    QUANTITY NUMBER
    RATE_OBJ_DB NUMBER(38)
    RATE_OBJ_ID0 NUMBER(38)
    RATE_OBJ_TYPE VARCHAR2(255)
    RATE_OBJ_REV NUMBER(38)
    RATE_TAG VARCHAR2(255)
    RESOURCE_ID NUMBER(38)
    RESOURCE_ID_ORIG NUMBER(38)
    TAX_CODE VARCHAR2(255)
    NODE_LOCATION VARCHAR2(255)
    LINEAGE VARCHAR2(255)
    SQL> desc event_session_dialup_t;
    Name Null? Type
    OBJ_ID0 NUMBER(38)
    ANI VARCHAR2(120)
    BYTES_IN NUMBER(38)
    BYTES_OUT NUMBER(38)
    DESCR VARCHAR2(255)
    DNIS VARCHAR2(60)
    IPADDR RAW(30)
    LOGIN VARCHAR2(255)
    NETWORK VARCHAR2(30)
    PACKETS_IN NUMBER(38)
    PACKETS_OUT NUMBER(38)
    SPEED NUMBER(38)
    STATUS NUMBER(38)
    TERM_CAUSE NUMBER(38)
    TERMSERV_ID VARCHAR2(60)
    TERMSERV_PORT VARCHAR2(60)
    TIMEZONE NUMBER(38)
    TRANS_ID VARCHAR2(60)
    TYPE NUMBER(38)
    UNITS NUMBER(38)
    SQL> desc event_t;
    Name Null? Type
    POID_DB NUMBER(38)
    POID_ID0 NUMBER(38)
    POID_TYPE VARCHAR2(255)
    POID_REV NUMBER(38)
    CREATED_T NUMBER(38)
    MOD_T NUMBER(38)
    READ_ACCESS VARCHAR2(1)
    WRITE_ACCESS VARCHAR2(1)
    ACCOUNT_OBJ_DB NUMBER(38)
    ACCOUNT_OBJ_ID0 NUMBER(38)
    ACCOUNT_OBJ_TYPE VARCHAR2(255)
    ACCOUNT_OBJ_REV NUMBER(38)
    ARCHIVE_STATUS NUMBER(38)
    CURRENCY NUMBER(38)
    DESCR VARCHAR2(255)
    EFFECTIVE_T NUMBER(38)
    END_T NUMBER(38)
    EARNED_START_T NUMBER(38)
    EARNED_END_T NUMBER(38)
    EARNED_TYPE NUMBER(38)
    EVENT_NO VARCHAR2(60)
    FLAGS NUMBER(38)
    GROUP_OBJ_DB NUMBER(38)
    GROUP_OBJ_ID0 NUMBER(38)
    GROUP_OBJ_TYPE VARCHAR2(255)
    GROUP_OBJ_REV NUMBER(38)
    ITEM_OBJ_DB NUMBER(38)
    ITEM_OBJ_ID0 NUMBER(38)
    ITEM_OBJ_TYPE VARCHAR2(255)
    ITEM_OBJ_REV NUMBER(38)
    NAME VARCHAR2(255)
    PROGRAM_NAME VARCHAR2(60)
    PROVIDER_DESCR VARCHAR2(255)
    PROVIDER_ID_DB NUMBER(38)
    PROVIDER_ID_ID0 NUMBER(38)
    PROVIDER_ID_TYPE VARCHAR2(255)
    PROVIDER_ID_REV NUMBER(38)
    PROVIDER_IPADDR RAW(30)
    RUM_NAME VARCHAR2(255)
    TOD_MODE NUMBER(38)
    TIMEZONE_MODE NUMBER(38)
    MIN_QUANTITY NUMBER
    MIN_UNIT NUMBER(38)
    INCR_QUANTITY NUMBER
    INCR_UNIT NUMBER(38)
    ROUNDING_MODE NUMBER(38)
    NET_QUANTITY NUMBER
    UNRATED_QUANTITY NUMBER
    SERVICE_OBJ_DB NUMBER(38)
    SERVICE_OBJ_ID0 NUMBER(38)
    SERVICE_OBJ_TYPE VARCHAR2(255)
    SERVICE_OBJ_REV NUMBER(38)
    SESSION_OBJ_DB NUMBER(38)
    SESSION_OBJ_ID0 NUMBER(38)
    SESSION_OBJ_TYPE VARCHAR2(255)
    SESSION_OBJ_REV NUMBER(38)
    START_T NUMBER(38)
    SYS_DESCR VARCHAR2(255)
    TAX_LOCALES VARCHAR2(1024)
    TAX_SUPPLIER_ID_DB NUMBER(38)
    TAX_SUPPLIER_ID_ID0 NUMBER(38)
    TAX_SUPPLIER_ID_TYPE VARCHAR2(255)
    TAX_SUPPLIER_ID_REV NUMBER(38)
    USERID_DB NUMBER(38)
    USERID_ID0 NUMBER(38)
    USERID_TYPE VARCHAR2(255)
    USERID_REV NUMBER(38)
    INVOICE_DATA VARCHAR2(4000)
    RATED_TIMEZONE_ID VARCHAR2(64)
    TIMEZONE_ADJ_START_T NUMBER(38)
    TIMEZONE_ADJ_END_T NUMBER(38)
    TIMEZONE_ID VARCHAR2(64)
    UNIT NUMBER(38)
    RERATE_OBJ_DB NUMBER(38)
    RERATE_OBJ_ID0 NUMBER(38)
    RERATE_OBJ_TYPE VARCHAR2(255)
    RERATE_OBJ_REV NUMBER(38)
    select index_name, column_name, column_position from all_ind_columns where table_name like upper('event_t')
    INDEX_NAME COLUMN_NAME COLUMN_POSITION
    I_EVENT_CREATED_T CREATED_T 1
    I_EVENT_EVENT__NO EVENT_NO 1
    I_EVENT_ITEM_OBJ__ID ITEM_OBJ_ID0 1
    I_EVENT_NDX CREATED_T 1
    I_EVENT_NDX POID_ID0 2
    I_EVENT_PROVIDER__ID PROVIDER_ID_ID0 1
    I_EVENT__ACCTOBJ_END_T ACCOUNT_OBJ_ID0 1
    I_EVENT__ACCTOBJ_END_T END_T 2
    I_EVENT__END_T END_T 1
    I_EVENT__ID POID_ID0 1
    I_EVENT__SERVOBJ_END_T SERVICE_OBJ_ID0 1
    I_EVENT__SERVOBJ_END_T END_T 2
    explain plan for select 'Technical Building' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t_view a
    where
    end_t between date2unix(20060101000000) and date2unix(20060501000000) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('62.231.255.21','62.231.255.22','62.231.255.23','62.231.255.24','62.231.255.25','62.231.255.26','62.231.255.27','62.231.255.28','62.231.255.29','62.231.255.30','62.231.255.31','62.231.255.32','62.231.255.33','62.231.255.34','62.231.255.35','62.231.255.36','62.231.255.37','62.231.255.38','62.231.255.39','62.231.255.40','62.231.255.43','62.231.255.44','62.231.255.255','ADSL-7301-Test','AKO2_ERX700','AZA1_ERX700','GHA1_ERX700','GMU4_ERX700','HMR1_ERX700','HMSQ_ERX700','KWR1_ERX700','MUS','MUS1_ERX700','MUT','MUT1_ERX700','MUTRAH-ERX','OMAN-ADSL-Test','QUR2_ERX700','Qur','SEB2_ERX700','TECH_BLDG','WAT1_ERX700','WKB1_ERX700','azaiba','TB-C10K-ADSL') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    select
    substr (lpad(' ', level-1) || operation || ' (' || options || ')',1,30 ) "Operation",
    object_name "Object",
    partition_start, partition_stop
    from
    plan_table
    start with id = 0
    connect by prior id=parent_id;
    Operation Object PARTITION_START PARTITION_STOP
    SELECT STATEMENT ()
    SORT (AGGREGATE)
    FILTER ()
    NESTED LOOPS ()
    NESTED LOOPS ()
    PARTITION RANGE (ALL) 1 41
    TABLE ACCESS (BY LOCAL I EVENT_T 1 41
    INDEX (RANGE SCAN) I_EVENT__END_T 1 41
    PARTITION RANGE (ITERATOR KEY KEY
    TABLE ACCESS (BY LOCAL I EVENT_BAL_IMPACTS_T KEY KEY
    INDEX (RANGE SCAN) I_EVENT_BAL_IMPACTS__ID KEY KEY
    PARTITION RANGE (ITERATOR) KEY KEY
    TABLE ACCESS (BY LOCAL IN EVENT_SESSION_DIALUP_T KEY KEY
    INDEX (UNIQUE SCAN) I_EVENT_SESSION_DIALUP__ID KEY KEY
    TABLE ACCESS (FULL) PRODUCT_T
    explain plan for select 'Technical Building' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t a
    where
    end_t between date2unix(20060101000000) and date2unix(20060501000000) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('62.231.255.21','62.231.255.22','62.231.255.23','62.231.255.24','62.231.255.25','62.231.255.26','62.231.255.27','62.231.255.28','62.231.255.29','62.231.255.30','62.231.255.31','62.231.255.32','62.231.255.33','62.231.255.34','62.231.255.35','62.231.255.36','62.231.255.37','62.231.255.38','62.231.255.39','62.231.255.40','62.231.255.43','62.231.255.44','62.231.255.255','ADSL-7301-Test','AKO2_ERX700','AZA1_ERX700','GHA1_ERX700','GMU4_ERX700','HMR1_ERX700','HMSQ_ERX700','KWR1_ERX700','MUS','MUS1_ERX700','MUT','MUT1_ERX700','MUTRAH-ERX','OMAN-ADSL-Test','QUR2_ERX700','Qur','SEB2_ERX700','TECH_BLDG','WAT1_ERX700','WKB1_ERX700','azaiba','TB-C10K-ADSL') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    select
    substr (lpad(' ', level-1) || operation || ' (' || options || ')',1,30 ) "Operation",
    object_name "Object",
    partition_start, partition_stop
    from
    plan_table
    start with id = 0
    connect by prior id=parent_id;
    Operation Object PARTITION_START PARTITION_STOP
    SELECT STATEMENT ()
    SORT (AGGREGATE)
    FILTER ()
    NESTED LOOPS ()
    NESTED LOOPS ()
    PARTITION RANGE (ALL) 1 41
    TABLE ACCESS (BY LOCAL I EVENT_T 1 41
    INDEX (RANGE SCAN) I_EVENT__END_T 1 41
    PARTITION RANGE (ITERATOR KEY KEY
    TABLE ACCESS (BY LOCAL I EVENT_BAL_IMPACTS_T KEY KEY
    INDEX (RANGE SCAN) I_EVENT_BAL_IMPACTS__ID KEY KEY
    PARTITION RANGE (ITERATOR) KEY KEY
    TABLE ACCESS (BY LOCAL IN EVENT_SESSION_DIALUP_T KEY KEY
    INDEX (UNIQUE SCAN) I_EVENT_SESSION_DIALUP__ID KEY KEY
    TABLE ACCESS (FULL) PRODUCT_T
    spool create_event_view.lst
    set timing on
    create view event_t_view as (select * from event_t where end_t between date2unix('20060701000000') and date2unix('20061001000000'))
    spool off
    set serveroutput on size 1000000
    set timing on
    set linesize 132
    spool ABCReports51_new_1.lst
    declare
    m_report_year number(8);
    v_start varchar(38);
    v_end varchar(38);
    -- Fetch all Session Events for Non CyberCafe (Only IP Service) Product Events
    cursor SessionUsagePOP1(v_start varchar, v_end varchar) is
    select 'Technical Building' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('62.231.255.21','62.231.255.22','62.231.255.23','62.231.255.24','62.231.255.25','62.231.255.26','62.231.255.27','62.231.255.28','62.231.255.29','62.231.255.30','62.231.255.31','62.231.255.32','62.231.255.33','62.231.255.34','62.231.255.35','62.231.255.36','62.231.255.37','62.231.255.38','62.231.255.39','62.231.255.40','62.231.255.43','62.231.255.44','62.231.255.255','ADSL-7301-Test','AKO2_ERX700','AZA1_ERX700','GHA1_ERX700','GMU4_ERX700','HMR1_ERX700','HMSQ_ERX700','KWR1_ERX700','MUS','MUS1_ERX700','MUT','MUT1_ERX700','MUTRAH-ERX','OMAN-ADSL-Test','QUR2_ERX700','Qur','SEB2_ERX700','TECH_BLDG','WAT1_ERX700','WKB1_ERX700','azaiba','TB-C10K-ADSL') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    cursor SessionUsagePOP2(v_start varchar, v_end varchar) is
    select 'Training Center' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('62.231.255.224','62.231.255.225','62.231.255.226','62.231.255.227','62.231.255.228','TRG-10K-ADSL') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    cursor SessionUsagePOP3(v_start varchar, v_end varchar) is
    select 'Al-Khuwair' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('62.231.255.208') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    cursor SessionUsagePOP4(v_start varchar, v_end varchar) is
    select 'Sallalah' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('62.231.192.20','62.231.192.21','62.231.192.22','62.231.255.132','62.231.255.133','62.231.255.134','SAL-10K-ADSL') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    cursor SessionUsagePOP5(v_start varchar, v_end varchar) is
    select 'Sohar' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('62.231.200.20','62.231.200.21','62.231.255.148','62.231.255.149','SOH-10K-ADSL') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    cursor SessionUsagePOP6(v_start varchar, v_end varchar) is
    select 'Nizwa' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('62.231.216.20','62.231.255.180','62.231.255.181','NIZ-10K-ADSL') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    cursor SessionUsagePOP7(v_start varchar, v_end varchar) is
    select 'Masirah' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('212.72.13.41') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    cursor SessionUsagePOP8(v_start varchar, v_end varchar) is
    select 'Ibri' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('62.231.224.20') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    cursor SessionUsagePOP9(v_start varchar, v_end varchar) is
    select 'Sur' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('62.231.255.164','SUR-10K-ADSL') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    cursor SessionUsagePOP10(v_start varchar, v_end varchar) is
    select 'Buraimi' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('BR-10K-ADSL') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    begin
    m_report_year := 2006;
    v_start:='20060701000000';
    v_end:='20061001000000';
    /** Dialup Accounts Usage on each month **/
    dbms_output.put_line('Dialup Accounts Usage on each month during the Year ' || m_report_year);
    dbms_output.put_line('POP Name MM-YYYY No. of Seconds Avg. No. of Seconds');
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP1(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP2(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP3(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP4(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP5(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP6(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP7(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP8(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP9(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP10(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    end;
    spool off
    Dialup Accounts Usage on each month during the Year 2006
    POP Name MM-YYYY No. of Seconds Avg. No. of Seconds
    Technical Building 07-2006 1,468,439,634 1,985.848
    Technical Building 08-2006 1,476,030,818 1,954.927
    Technical Building 09-2006 1,385,143,427 1,917.764
    Training Center 07-2006 19,481,275 2,193.343
    Training Center 08-2006 7,368,849 2,317.977
    Training Center 09-2006
    Al-Khuwair 07-2006 327,753,498 1,929.392
    Al-Khuwair 08-2006 326,043,930 1,867.751
    Al-Khuwair 09-2006 314,307,853 1,884.758
    Sallalah 07-2006 297,238,088 2,127.765
    Sallalah 08-2006 291,646,501 2,049.130
    Sallalah 09-2006 256,812,968 2,050.403
    Sohar 07-2006 499,669,759 2,002.588
    Sohar 08-2006 517,602,784 1,996.208
    Sohar 09-2006 460,677,766 1,965.760
    Nizwa 07-2006 313,445,474 1,804.896
    Nizwa 08-2006 336,749,026 1,820.708
    Nizwa 09-2006 279,534,466 1,809.074
    Masirah 07-2006 17,417,301 2,315.822
    Masirah 08-2006 20,053,961 2,791.087
    Masirah 09-2006 17,225,347 2,656.593
    Ibri 07-2006
    Ibri 08-2006
    Ibri 09-2006
    Sur 07-2006 146,555,060 1,765.681
    Sur 08-2006 148,694,745 1,710.157
    Sur 09-2006 138,260,990 1,687.962
    Buraimi 07-2006
    Buraimi 08-2006
    Buraimi 09-2006
    PL/SQL procedure successfully completed.
    Elapsed: 14:27:26.17
    set serveroutput on size 1000000
    set timing on
    set linesize 132
    spool ABCReports51_new.lst
    declare
    m_report_year number(8);
    v_start varchar(38);
    v_end varchar(38);
    -- Fetch all Session Events for Non CyberCafe (Only IP Service) Product Events
    cursor SessionUsagePOP1(v_start varchar, v_end varchar) is
    select 'Technical Building' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t_view a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('62.231.255.21','62.231.255.22','62.231.255.23','62.231.255.24','62.231.255.25','62.231.255.26','62.231.255.27','62.231.255.28','62.231.255.29','62.231.255.30','62.231.255.31','62.231.255.32','62.231.255.33','62.231.255.34','62.231.255.35','62.231.255.36','62.231.255.37','62.231.255.38','62.231.255.39','62.231.255.40','62.231.255.43','62.231.255.44','62.231.255.255','ADSL-7301-Test','AKO2_ERX700','AZA1_ERX700','GHA1_ERX700','GMU4_ERX700','HMR1_ERX700','HMSQ_ERX700','KWR1_ERX700','MUS','MUS1_ERX700','MUT','MUT1_ERX700','MUTRAH-ERX','OMAN-ADSL-Test','QUR2_ERX700','Qur','SEB2_ERX700','TECH_BLDG','WAT1_ERX700','WKB1_ERX700','azaiba','TB-C10K-ADSL') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    cursor SessionUsagePOP2(v_start varchar, v_end varchar) is
    select 'Training Center' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t_view a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('62.231.255.224','62.231.255.225','62.231.255.226','62.231.255.227','62.231.255.228','TRG-10K-ADSL') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    cursor SessionUsagePOP3(v_start varchar, v_end varchar) is
    select 'Al-Khuwair' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t_view a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('62.231.255.208') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    cursor SessionUsagePOP4(v_start varchar, v_end varchar) is
    select 'Sallalah' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t_view a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('62.231.192.20','62.231.192.21','62.231.192.22','62.231.255.132','62.231.255.133','62.231.255.134','SAL-10K-ADSL') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    cursor SessionUsagePOP5(v_start varchar, v_end varchar) is
    select 'Sohar' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t_view a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('62.231.200.20','62.231.200.21','62.231.255.148','62.231.255.149','SOH-10K-ADSL') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    cursor SessionUsagePOP6(v_start varchar, v_end varchar) is
    select 'Nizwa' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t_view a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('62.231.216.20','62.231.255.180','62.231.255.181','NIZ-10K-ADSL') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    cursor SessionUsagePOP7(v_start varchar, v_end varchar) is
    select 'Masirah' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t_view a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('212.72.13.41') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    cursor SessionUsagePOP8(v_start varchar, v_end varchar) is
    select 'Ibri' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t_view a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('62.231.224.20') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    cursor SessionUsagePOP9(v_start varchar, v_end varchar) is
    select 'Sur' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t_view a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('62.231.255.164','SUR-10K-ADSL') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    cursor SessionUsagePOP10(v_start varchar, v_end varchar) is
    select 'Buraimi' PopName, sum(end_t - start_t) UsageSec, avg(end_t - start_t) AvgSec
    from event_bal_impacts_t c, event_session_dialup_t b, event_t_view a
    where
    end_t between date2unix(v_start) and date2unix(v_end) and
    b.obj_id0 = a.poid_id0 and
    c.obj_id0 = a.poid_id0 and
    c.rec_id = 0 and
    a.service_obj_type = '/service/ip' and
    a.poid_type = '/event/session/dialup' and
    b.termserv_id in ('BR-10K-ADSL') and
    c.product_obj_id0 not in
    select poid_id0 from product_t
    where name like '%Cyber%'
    begin
    m_report_year := 2006;
    v_start:='20060701000000';
    v_end:='20061001000000';
    /** Dialup Accounts Usage on each month **/
    dbms_output.put_line('Dialup Accounts Usage on each month during the Year ' || m_report_year);
    dbms_output.put_line('POP Name MM-YYYY No. of Seconds Avg. No. of Seconds');
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP1(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP2(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP3(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP4(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP5(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP6(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP7(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP8(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP9(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    for c1 in 7..9
    loop <<c1_loop>>
    for c11 in SessionUsagePOP10(
    m_report_year || lpad(c1, 2, '0') || '01000000',
    m_report_year || lpad(c1 + 1, 2, '0') || '01000000'
    loop <<c11_loop>>
    dbms_output.put_line(
    rpad(c11.PopName,25, ' ') || ' ' ||
    to_char(c1, '00') || '-' ||
    m_report_year || ' ' ||
    to_char(c11.UsageSec,'999,999,999,999') || ' ' ||
    to_char(c11.AvgSec,'999,999,999.999')
    end loop c11_loop;
    end loop c1_loop;
    end;
    spool off

Maybe you are looking for

  • Labview 6.0 cannot call ActiveX functions after upgrading to Teststand 2

    I'm running on Win2K on my development system. I have been running fine with Teststand ver 1.0.3 and Labview 6.0 with several VI's using ActiveX to work with the TestStand engine. I tried installing TestStand 2.0 (dated Aug 2001) next to 1.03 (not on

  • Trigger of Import Declaration (Work List) for SO based inbound flows in ECC

    Hello Experts, I am running a feasability study for GTS Customs managment Import. My client is using SO based flows for the return flows (SO-Delivery-Mtrl Document). In order to use local clearance (to avoid VAT and Customs Fee) we need to set this f

  • NullPointerException in JFileChooser.showOpenDialog() JRE 1.7

    Hi all, In my application, i have used JFileChooser to select a file. When i try to open JFileChooser.showOpenDialog() it throws the following exception. Not sure where i am wrong. Please help me. Exception: #Exception in thread "AWT-EventQueue-0" ja

  • Battery Health after 13 cycles?

    I recently downloaded istate pro to check my battery and to my suprise my battery health is currently at 96% after 13 cycles. Yesterday I calibrated the battery and it was at 98% health.  Could be battery by obsolete? And I just got my mbp 1 week ago

  • Apple reps having a hard time deploying mac notebooks on windows 2003 netwo

    Here are the issues we are having any help would be appreciated, we had a few laptops imaged, but we came to find out that the Macbooks were not able to print to any of the printers in the school. We then moved onto testing the internet and networkin