Inconsistent results from to_char(systimestamp,'D')

If I run
select systimestamp ,
to_char(systimestamp,'DAY') DAY,
to_char(systimestamp,'D') DAY_OF_WEEK
from dual
thru SQL Developer or the SQL Workshop I get
20/APR/07 03:45:42.261382000 PM +10:00 FRIDAY 5
If I run the same query from within an APEX application I get
20/APR/07 03:45:42.261382000 PM +10:00 FRIDAY 6
In the same three environments I ran
select value from sys.adam_tmp_view
where name = 'nls_territory'
(by creating the view adam_tmp_view as select * from v$parameter and granting select to public)
and it gave me AMERICA
Any ideas why this might be happening ...

I believe there is a setting somewhere where you can specify whether your calender week starts on a Sunday or a Monday.
Perhaps there is a setting in your application than changes the default calender week start date when you run your app that doesn't apply in SQL dev.

Similar Messages

  • Inconsistent Results from dbms_output.get_lines

    Hi,
    I am getting inconsistent results from using dbms_output.get_lines.
    I'm using get_lines in a procedure A that executes a function B to test if the function returns 0 or > 0 to indicate validity of my data. In that function, I use dbms_output.put_lines to communicate data points that I want to use. My procedure A does a get_lines after executing function B then either logs the lines into a table or sends an email.
    Right now, get_lines is behaving sporadically for me. Sometimes I the chararr returns some lines while other times it doesn't. The strange thing is numlines does return a value, and it's the value that I expected.
    Can someone please help?
    Thanks.

    Use parameters or even global package variables to transport data from one procedure to the other. dbms_output is not meant for this, it will not work.

  • Inconsistent results from CallableStatement

    We are getting inconsistent results from a call to an Oracle database. We have a CallableStatement that returns 4 INTEGERs.
    It runs perfectly if I run the Oracle procedure directly from the sql command line and then call it from the java code.
    However if I recompile the Oracle stored procedures and execute the Callable Statement (without first running it from sql) then I am getting incorrect results...1,2,1,1 is being returned instead of 1,2,0,3. Are these results being cached somewhere???
    We are using Oracle 8.1.7, JDK 1.3.1, and Oracle thin driver 8.1.7.
    The code is as follows:
    <pre>
    private CallableStatement autoLBNumbersNeeded;
    private void prepareStatements(){
         autoLBNumbersNeeded=dbConnection.prepareCall("{CALL
         pkg_scheduler.pr_auto_lb_nos(?,?,?,?)}");
         autoLBNumbersNeeded.clearParameters();
         autoLBNumbersNeeded.registerOutParameter(1, java.sql.Types.INTEGER);
         autoLBNumbersNeeded.registerOutParameter(2, java.sql.Types.INTEGER);
         autoLBNumbersNeeded.registerOutParameter(3, java.sql.Types.INTEGER);
         autoLBNumbersNeeded.registerOutParameter(4, java.sql.Types.INTEGER);
    public UserNumber[] doAutoLoadBalancing () throws SQLException {
    autoLBNumbersNeeded.clearParameters();
    autoLBNumbersNeeded.execute();
    mwFF = autoLBNumbersNeeded.getLong(1);
    mwHF = autoLBNumbersNeeded.getLong(2);
    wmFF = autoLBNumbersNeeded.getLong(3);
    wmHF = autoLBNumbersNeeded.getLong(4);
    autoLBNumbersNeeded.clearParameters();
    </pre>
    The Oracle procedure is
    <pre>
    PROCEDURE proc1( p_parm_1 OUT NUMBER, p_parm_2 OUT NUMBER, p_parm_3
    OUT NUMBER, p_parm_4 OUT NUMBER)
    AS
    BEGIN
    -- Get Counts
    SELECT COUNT(*)
    INTO p_parm_1
    FROM blah ......
    SELECT COUNT(*)
    INTO p_parm_2
    FROM blah ......
    SELECT COUNT(*)
    INTO p_parm_3
    FROM blah ......
    SELECT COUNT(*)
    INTO p_parm_4
    FROM blah ......
    EXCEPTION
    blah .......
    END proc1;
    </pre>
    Can anyone help?
    Many thanks
    Fionnuala

    Hi
    Yes I have a debug line that prints them out in the doAutoLoadBalancing method - this is the point where I am diagnosing the problem. It only prints the correct results after I have already run the procedure from the SQL command line.
    public UserNumber[] doAutoLoadBalancing () throws SQLException {
    autoLBNumbersNeeded.clearParameters();
    autoLBNumbersNeeded.execute();
    mwFF = autoLBNumbersNeeded.getLong(1);
    mwHF = autoLBNumbersNeeded.getLong(2);
    wmFF = autoLBNumbersNeeded.getLong(3);
    wmHF = autoLBNumbersNeeded.getLong(4);
    autoLBNumbersNeeded.clearParameters();
    if (m_cat.isDebugEnabled()) {m_cat.debug("mwFF: "+mwFF+"; mwHF: " +mwHF+"; wmFF: "+wmFF+"; wmHF: "+wmHF);}
    </pre>

  • Inconsistent results from rpm

    Hi Oracle Forums,
         I am installing packages required for Oracle Database 11gR2, and am having problems with rpm responses.
         When I query rpm about a package, it tells me that the package is not installed. When I go to install the package, rpm informs me that the package is already installed. An example is shown below:
    [root@OELVM02 Server]# uname -a
    Linux OELVM02.localdomain 2.6.32-300.10.1.el5uek #1 SMP Wed Feb 22 17:37:40 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
    [root@OELVM02 Server]#
    [root@OELVM02 Server]# pwd
    /media/OL5.8 x86_64 dvd 20120229/Server
    [root@OELVM02 Server]#
    [root@OELVM02 Server]# ls -alrt binutils-2.17.50.0.6-20.el5.x86_64.rpm
    -rw-r--r-- 1 root root 3069914 Dec 28  2011 binutils-2.17.50.0.6-20.el5.x86_64.rpm
    [root@OELVM02 Server]#
    [root@OELVM02 Server]#  rpm -q ./binutils-2.17.50.0.6-20.el5.x86_64.rpm
    package ./binutils-2.17.50.0.6-20.el5.x86_64.rpm is not installed
    [root@OELVM02 Server]#
    [root@OELVM02 Server]# rpm -ivh ./binutils-2.17.50.0.6-20.el5.x86_64.rpm
    warning: ./binutils-2.17.50.0.6-20.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
    Preparing...                ########################################### [100%]
            package binutils-2.17.50.0.6-20.el5.x86_64 is already installed
    [root@OELVM02 Server]#
    [root@OELVM02 Server]# rpm -q ./binutils-2.17.50.0.6-20.el5.x86_64.rpm
    package ./binutils-2.17.50.0.6-20.el5.x86_64.rpm is not installed
    [root@OELVM02 Server]#     I do not understand the inconsistent results that rpm is giving me.
         Any help would be greatly appreciated
         Thanks
         Gavin

    Hi Avi,
         Thanks for your quick response!!
         The Oracle documentation requires that both the 32 and 64 bit rpm's be installed for some packages. In the below scenario, is rpm telling me that both 32 and 64 bit packages are installed?
    [root@OELVM02 Server]# uname -a
    Linux OELVM02.localdomain 2.6.32-300.10.1.el5uek #1 SMP Wed Feb 22 17:37:40 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
    [root@OELVM02 Server]#
    [root@OELVM02 Server]# pwd
    /media/OL5.8 x86_64 dvd 20120229/Server
    [root@OELVM02 Server]#
    [root@OELVM02 Server]# ls -alrt *glibc-2*
    -rw-r--r-- 1 root root 1544040 Nov 18  2010 compat-glibc-2.3.4-2.26.x86_64.rpm
    -rw-r--r-- 1 root root 1069214 Nov 18  2010 compat-glibc-2.3.4-2.26.i386.rpm
    -rw-r--r-- 1 root root 5607577 Feb 26  2012 glibc-2.5-81.i686.rpm
    -rw-r--r-- 1 root root 4997627 Feb 26  2012 glibc-2.5-81.x86_64.rpm
    [root@OELVM02 Server]#
    [root@OELVM02 Server]# rpm -q glibc-2.5-81.i686
    glibc-2.5-81
    [root@OELVM02 Server]#
    [root@OELVM02 Server]#  rpm -q glibc-2.5-81.x86_64
    glibc-2.5-81
    [root@OELVM02 Server]#
    [root@OELVM02 Server]#     Thanks heaps
         Gavin

  • Inconsistent results from database calls

    Hi all I was wondering if anyone would be able to come up with some possible ideas as to why my application is inconsistently retrieving data from a database. I have an application that is pulling information from a database. These calls can be made repetitively pulling the same information over and over again. The quandry that I am faced with is why the application would pull the right data most of the time, but occasionally not pull the correct values.
    I have consided the following:
    blocking - all of the calls are read only and scroll insensitive so I doubt this is the case
    Limited number of connections
    Seems like apossibility but then I would expect an error to be thrown.
    Actions happening to fast
    I was thinking perhaps the cycle is completing before everything has had a chance to finish the last set - is that a possibility ?
    I can't post the code, so I am just looking for any general thoughts or ideas on the topic, if nothing thanks anyways.

    Thank you both for your thoughts. The transactions is definately not a possibility (at least as I understand) as this is on read information only, there is no commits nor any updates being completed by this method.
    I will continue to hunt down this little bugger. The biggest issue is that it is one behemoth of a method that should not exist, but unfortunately does.

  • Inconsistent results from AlphaComposite and AffineTransform

    I'm developing a game using Java, and I've run into a fairly major issue. On my primary development machine, I can use combinations of AlphaComposite.SRC_IN and AffineTransforms with rotation just fine (I'm using the composite to create a lighting overlay for the game by drawing light beams onto the alpha channel of an all-black image buffer). On my other computer, while the image itself rotates and draws on the alpha channel fine, the computer also completely clears a bounding rectangle around the rotated image.
    The first computer (the one for which this works) has a GeForce 8800GTS video card, while the second has an older Radeon 9700. The first computer also has the most recent version of the JDK (6). Could either of these factors make the difference?
    edit: Upgrading to JDK 6 fixed it. Will need to include a notice about upgrading to JDK 6 with the game, probably.
    Message was edited by:
    Hyouko

    Hi
    Yes I have a debug line that prints them out in the doAutoLoadBalancing method - this is the point where I am diagnosing the problem. It only prints the correct results after I have already run the procedure from the SQL command line.
    public UserNumber[] doAutoLoadBalancing () throws SQLException {
    autoLBNumbersNeeded.clearParameters();
    autoLBNumbersNeeded.execute();
    mwFF = autoLBNumbersNeeded.getLong(1);
    mwHF = autoLBNumbersNeeded.getLong(2);
    wmFF = autoLBNumbersNeeded.getLong(3);
    wmHF = autoLBNumbersNeeded.getLong(4);
    autoLBNumbersNeeded.clearParameters();
    if (m_cat.isDebugEnabled()) {m_cat.debug("mwFF: "+mwFF+"; mwHF: " +mwHF+"; wmFF: "+wmFF+"; wmHF: "+wmHF);}
    </pre>

  • Getting Inconsistent Results from Web Service

    We have a web service that provides Qty Available for several item numbers (current 252 item numbers). It takes in an array of item numbers to be checked. It returns an xml file with those item numbers and the qty available, which is drawn directly from a single table that is repopulated every fifteen minutes. Our customer said that his system shows a different number of records returned each time with consecutive polls.
    I tested the service using the endpoint testing web page. (I hope that's the correct term - I am fairly new to this.) I manually entered 175 item numbers.
    The first result set had a block of 74 item numbers missing from the middle. The second result set returned everything.
    Sample data excerpt:
       <ns0:result>
        <ROWSET>
         <ROW
           num="1">
          <ITEM_NBR>K5-8PE-RD</ITEM_NBR>
          <QTY_AVAILABLE>442</QTY_AVAILABLE>
         </ROW>
        </ROWSET>
       </ns0:result>
       <ns0:result>
        <ROWSET>
         <ROW
           num="1">
          <ITEM_NBR>K5-8PE-WH</ITEM_NBR>
          <QTY_AVAILABLE>5650</QTY_AVAILABLE>
         </ROW>
        </ROWSET>
       </ns0:result>
       <ns0:result
         xsi:nil="1"/>
       <ns0:result
         xsi:nil="1"/>
       <ns0:result
         xsi:nil="1"/>Does this make sense?
    Thanks,
    Gregory

    Turns out the problem was in the Java method. It seems it was opening a new connection for each item number and not closing them.
    Changed code to open the connection once, run through the item list, then close the connection.

  • Inconsistent results from "Create an iMix"

    Hi,
    I'm trying to create an iMix. I have about 2 dozen iMixes currently published, but I haven't done it in awhile. Today I tried to publish a large playlist and I was stunned when the iTunes store showed only two hits in the resulting iMix. I tried again without changing the playlist and got an iMix with about a dozen results. I figured it was a glitch, but then I tried publishing another one and the first time yielded 2 hits, the next four, and the one after that: 6! What the heck?! Anyone run into this problem before? How do I ensure I'm getting all possible songs in my iMix? I tried two methods of creating the iMixes: once using the arrow icon next to the playlist and the rest via the file menu.
    Rob

    Sorry to hear you're having this problem, this would appear to indicate my problem is on Apple's end, not mine.
    I have 100 songs in the iMix I'd like to publish, and every time I try, I get a different number of songs- usually between 10 and 50, but a few times it's been more than 60. I have previously (last year and earlier this year) been able to get many more than that, and consistently the same number.
    Please Apple, get this working correctly! Or anyone else with an idea... ?
    It is not due to slow connection on my end, I have very fast internet service.
    Thanks. Joel.

  • Inconsistent Results from Transport Rule to reset SCL

    I have a client who has multiple sites. Their exchange server receives "scan to email" emails from a Canon C2020 Digital Multifunction on a different site. To stop the Exchange 2013 Spam filter blocking the emails, I set up a Transport Rule.
    The rule has the following properties
    If the Sender Address matches [email protected]
    Set the SCL to 3
    Generate an incident report and email to the system admin, and inlcude the original email
    Is the 3rd of 3 rules (the prior 2 add Disclaimers to outgoing emails depending on who the sender is)
    Simple enough right.
    Wrong - some staff scan to email repeatedly and the scan arrives ok in their inbox.  Others, it simply will not let the email thru, and instead places the email into the Spam Mailbox.  I open the blocked email, click on Send Again and
    it arrives for the user.
    Is the Transport Rule functionality buggy or prone to odd behaviour.  I have sat and read through the Rule so many times it is tattooed onto my retina.
    The Email addresses for all users are created by an Email address policy so all are a consistent format = Firstname + Surname 1st Initial@contoso .com.
    There have been times where I have wondered if the rules are case sensitive when assessing the email addresses.
    Any thoughts to put me out of my misery, please show me where I have done wrong....
    Get-TransportRule returns
    [PS] C:\Windows\system32>Get-TransportRule "[Cust-sos-IN] Reset SCL on Scanner emails" | Format-List
    RunspaceId                                   : 7f9c4f6e-7d35-409e-acf9-cbb272720b8c
    Priority                                     : 2
    DlpPolicy                                    :
    DlpPolicyId                                  : 00000000-0000-0000-0000-000000000000
    Comments                                     :
    ManuallyModified                             : False
    ActivationDate                               :
    ExpiryDate                                   :
    Description                                  : If the message:
    Is sent to '[email protected]' or
    '[email protected]' or
    '[email protected]' or
    '[email protected]' or
    '[email protected]' or
    '[email protected]' or
    '[email protected]'or...
    and Includes these patterns in the From address:
    '[email protected]'
    Take the following actions:
    Set the spam confidence level (SCL) to '3'
    and Send the incident report to [email protected], Include
    original mail
    RuleVersion                                  : 15.0.2.0
    Conditions                                   : {SentTo, FromAddressMatches}
    Exceptions                                   :
    Actions                                      : {SetSCL, GenerateIncidentReport}
    State                                        : Enabled
    Mode                                         : Enforce
    RuleSubType                                  : None
    UseLegacyRegex                               : False
    From                                         :
    FromMemberOf                                 :
    FromScope                                    :
    SentTo                                       :
    {[email protected],
    [email protected],
    [email protected],
    [email protected],
    [email protected],
    [email protected],
    [email protected],
    [email protected], [email protected],
    [email protected],
    [email protected], [email protected],
    [email protected],
    [email protected], [email protected],
    [email protected]...}
    SentToMemberOf                               :
    SentToScope                                  :
    BetweenMemberOf1                             :
    BetweenMemberOf2                             :
    ManagerAddresses                             :
    ManagerForEvaluatedUser                      :
    SenderManagementRelationship                 :
    ADComparisonAttribute                        :
    ADComparisonOperator                         :
    SenderADAttributeContainsWords               :
    SenderADAttributeMatchesPatterns             :
    RecipientADAttributeContainsWords            :
    RecipientADAttributeMatchesPatterns          :
    AnyOfToHeader                                :
    AnyOfToHeaderMemberOf                        :
    AnyOfCcHeader                                :
    AnyOfCcHeaderMemberOf                        :
    AnyOfToCcHeader                              :
    AnyOfToCcHeaderMemberOf                      :
    HasClassification                            :
    HasNoClassification                          : False
    SubjectContainsWords                         :
    SubjectOrBodyContainsWords                   :
    HeaderContainsMessageHeader                  :
    HeaderContainsWords                          :
    FromAddressContainsWords                     :
    SubjectMatchesPatterns                       :
    SubjectOrBodyMatchesPatterns                 :
    HeaderMatchesMessageHeader                   :
    HeaderMatchesPatterns                        :
    FromAddressMatchesPatterns                   :
    {[email protected]}
    AttachmentNameMatchesPatterns                :
    AttachmentExtensionMatchesWords              :
    HasSenderOverride                            : False
    MessageContainsDataClassifications           :
    SenderIpRanges                               :
    SCLOver                                      :
    AttachmentSizeOver                           :
    MessageSizeOver                              :
    WithImportance                               :
    MessageTypeMatches                           :
    RecipientAddressContainsWords                :
    RecipientAddressMatchesPatterns              :
    SenderInRecipientList                        :
    RecipientInSenderList                        :
    AttachmentContainsWords                      :
    AttachmentMatchesPatterns                    :
    AttachmentIsUnsupported                      : False
    AttachmentProcessingLimitExceeded            : False
    AttachmentHasExecutableContent               : False
    AnyOfRecipientAddressContainsWords           :
    AnyOfRecipientAddressMatchesPatterns         :
    ExceptIfFrom                                 :
    ExceptIfFromMemberOf                         :
    ExceptIfFromScope                            :
    ExceptIfSentTo                               :
    ExceptIfSentToMemberOf                       :
    ExceptIfSentToScope                          :
    ExceptIfBetweenMemberOf1                     :
    ExceptIfBetweenMemberOf2                     :
    ExceptIfManagerAddresses                     :
    ExceptIfManagerForEvaluatedUser              :
    ExceptIfSenderManagementRelationship         :
    ExceptIfADComparisonAttribute                :
    ExceptIfADComparisonOperator                 :
    ExceptIfSenderADAttributeContainsWords       :
    ExceptIfSenderADAttributeMatchesPatterns     :
    ExceptIfRecipientADAttributeContainsWords    :
    ExceptIfRecipientADAttributeMatchesPatterns  :
    ExceptIfAnyOfToHeader                        :
    ExceptIfAnyOfToHeaderMemberOf                :
    ExceptIfAnyOfCcHeader                        :
    ExceptIfAnyOfCcHeaderMemberOf                :
    ExceptIfAnyOfToCcHeader                      :
    ExceptIfAnyOfToCcHeaderMemberOf              :
    ExceptIfHasClassification                    :
    ExceptIfHasNoClassification                  : False
    ExceptIfSubjectContainsWords                 :
    ExceptIfSubjectOrBodyContainsWords           :
    ExceptIfHeaderContainsMessageHeader          :
    ExceptIfHeaderContainsWords                  :
    ExceptIfFromAddressContainsWords             :
    ExceptIfSubjectMatchesPatterns               :
    ExceptIfSubjectOrBodyMatchesPatterns         :
    ExceptIfHeaderMatchesMessageHeader           :
    ExceptIfHeaderMatchesPatterns                :
    ExceptIfFromAddressMatchesPatterns           :
    ExceptIfAttachmentNameMatchesPatterns        :
    ExceptIfAttachmentExtensionMatchesWords      :
    ExceptIfSCLOver                              :
    ExceptIfAttachmentSizeOver                   :
    ExceptIfMessageSizeOver                      :
    ExceptIfWithImportance                       :
    ExceptIfMessageTypeMatches                   :
    ExceptIfRecipientAddressContainsWords        :
    ExceptIfRecipientAddressMatchesPatterns      :
    ExceptIfSenderInRecipientList                :
    ExceptIfRecipientInSenderList                :
    ExceptIfAttachmentContainsWords              :
    ExceptIfAttachmentMatchesPatterns            :
    ExceptIfAttachmentIsUnsupported              : False
    ExceptIfAttachmentProcessingLimitExceeded    : False
    ExceptIfAttachmentHasExecutableContent       : False
    ExceptIfAnyOfRecipientAddressContainsWords   :
    ExceptIfAnyOfRecipientAddressMatchesPatterns :
    ExceptIfHasSenderOverride                    : False
    ExceptIfMessageContainsDataClassifications   :
    ExceptIfSenderIpRanges                       :
    PrependSubject                               :
    SetAuditSeverity                             :
    ApplyClassification                          :
    ApplyHtmlDisclaimerLocation                  :
    ApplyHtmlDisclaimerText                      :
    ApplyHtmlDisclaimerFallbackAction            :
    ApplyRightsProtectionTemplate                :
    SetSCL                                       : 3
    SetHeaderName                                :
    SetHeaderValue                               :
    RemoveHeader                                 :
    AddToRecipients                              :
    CopyTo                                       :
    BlindCopyTo                                  :
    AddManagerAsRecipientType                    :
    ModerateMessageByUser                        :
    ModerateMessageByManager                     : False
    RedirectMessageTo                            :
    RejectMessageEnhancedStatusCode              :
    RejectMessageReasonText                      :
    DeleteMessage                                : False
    Disconnect                                   : False
    Quarantine                                   : False
    SmtpRejectMessageRejectText                  :
    SmtpRejectMessageRejectStatusCode            :
    LogEventText                                 :
    StopRuleProcessing                           : False
    SenderNotificationType                       :
    GenerateIncidentReport                       :
    [email protected]
    IncidentReportOriginalMail                   : IncludeOriginalMail
    RouteMessageOutboundConnector                :
    RouteMessageOutboundRequireTls               : False
    Identity                                     : [Cust-sos-IN] Reset SCL on Scanner
    emails
    DistinguishedName                            : CN=[Cust-sos-IN] Reset SCL on Scanner
    emails,CN=TransportVersioned,CN=Rules,CN=Transport
    Settings,CN=Contoso,CN=Microsoft
    Exchange,CN=Services,CN=Configuration,DC=CONTOSO,DC=LOCAL
    Guid                                         : 5d1dbc9b-3718-4874-9552-296e8b98d874
    ImmutableId                                  : 5d1dbc9b-3718-4874-9552-296e8b98d874
    OrganizationId                               :
    Name                                         : [Cust-sos-IN]
    Reset SCL on Scanner emails
    IsValid                                      : True
    WhenChanged                                  : 17/03/2015 2:37:06 PM
    ExchangeVersion                              : 0.1 (8.0.535.0)
    ObjectState                                  : Unchanged

    Hi MBKITMGR,
    Agree with Zammit, you should use the BypassedSenders parameter to specifies the SMTP address values of senders.
    After that, the Content Filter agent doesn't process any content filtering for messages received from the addresses listed on this parameter.
    Best regards,
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]
    Niko Cheng
    TechNet Community Support

  • Inconsistent results from sql DB 11.2.0.2

    can anyone see why the statement below would return no data?
    SELECT CUSTOMER_NAME,
         CUSTOMER_NUMBER,
         CUSTOMER_ID
    FROM APPS.RA_CUSTOMERS
    WHERE (UPPER(CUSTOMER_NAME) LIKE 'B%'
    AND      (CUSTOMER_NAME LIKE 'b%'
    OR          CUSTOMER_NAME LIKE 'B%'))
    ORDER BY CUSTOMER_NAME
    when this one does
    SELECT CUSTOMER_NAME,
         CUSTOMER_NUMBER,
         CUSTOMER_ID
    FROM APPS.RA_CUSTOMERS
    WHERE (CUSTOMER_NAME LIKE 'b%'
    OR          CUSTOMER_NAME LIKE 'B%')
    ORDER BY CUSTOMER_NAME
    Thanks

    Both the queries seem to be the same,
    Both of them should return same data. Please double check(any un committed data etc). Post the table data here.
    why dont you just use this?
    SELECT CUSTOMER_NAME, CUSTOMER_NUMBER, CUSTOMER_ID
      FROM APPS.RA_CUSTOMERS
    WHERE UPPER (CUSTOMER_NAME) LIKE 'B%'
    ORDER BY CUSTOMER_NAMEG.

  • Inconsistent results from hostname Unix command via ARD

    I sometimes get the DNS name and sometimes get the local sharing name.
    Some one pointed out to me
    % scutil --set HostName DNS-name
    as root will do the job.
    So the next question is can one get the Mac to cough up its DNS name or
    IP address without major acrobatics.
    For example
    % ifconfig en0 inet
    gives the IP address but you have to parse it out and
    % host IP-address
    will give the DNS name but again you have to parse it out.

    We have a bunch of machines that are all named via the Sharing panel in System Preferences. Our network is giving them a different DNS name. We'd like to be able to access the Sharing name via the command-line (hostname gives DNS name). I assume this is possible because Remote Desktop seems to get it somehow.

  • Inconsistent results returned from the same query

    Hi,
    My company has a oracle 8i DB as backend for the website it is currently hosting. I wrote a plain SQL select query to retrive results from a table. Usually the query returns 50 to 100 records. We build an xml based on the results and cache the xml for subsequent user hits.
    But atleast once or twice a day we get a problem where it returns almost no records. So the resulting xml will be blank and from there on until we delete the cached xml the user sees the page as blank.
    I wonder why this happens, does this happen because of more hits to the oracle database?. Or is it because of the indexes created on the table?. Is oracle not able to handle multiple user requests?. We get mostly like 10 to 20 people clicking at the same time. I don't know what is causing the failure.
    Does any of you have this inconsistency problems with Oracle?
    Thanks in advance
    sony

    Please ask questions on Oracle Text (formerly InterMedia text) in the Oracle Text forum, you will get a quicker, more expert answer there.

  • Inconsistent results with localtimestamp and current_timestamp

    Running XE on Windows XP with the system timezone to GMT rebooted, restarted XE)
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE     10.2.0.1.0     Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    I'm getting incorrect and inconsistent results with current_timestamp and localtimestamp:
    With SQL, localtimestamp computes the wrong offset (appears to use 1987-2006 DST rules):
    select
    dbtimezone
    , sessiontimezone
    , current_timestamp
    , current_timestamp + numtodsinterval(18,'day') as current_timestamp18
    , localtimestamp
    from dual;
    +00:00     
    US/Eastern     
    17-MAR-10 10.27.17.376000000 AM US/EASTERN     
    04-APR-10 10.27.17.376000000 AM US/EASTERN     
    17-MAR-10 09.27.17.376000000 AM
    however, in PL/SQL, both current_timestamp and localtimestamp return the wrong hour value, and adding 18 to current_timestamp shows it is using 1987-2006 DST rules (1st sunday of april)/ note that this happens in straight PL/SQL and in embedded SQL (same results selecting from tables other than DUAL):
    begin
    for r1 in (
    select
    dbtimezone
    , sessiontimezone
    , current_timestamp
    , current_timestamp + numtodsinterval(18,'day') as current_timestamp18
    , localtimestamp
    from dual
    loop
    dbms_output.put_line('SQL dbtimezone = ' || r1.dbtimezone);
    dbms_output.put_line('SQL sessiontimezone = ' || r1.sessiontimezone);
    dbms_output.put_line('SQL current_timestamp = ' || r1.current_timestamp);
    dbms_output.put_line('SQL current_timestamp +18 = ' || r1.current_timestamp18);
    dbms_output.put_line('SQL localtimestamp = ' || r1.localtimestamp);
    end loop;
    dbms_output.put_line('dbtimezone = ' || dbtimezone);
    dbms_output.put_line('sessiontimezone = ' || sessiontimezone);
    dbms_output.put_line('systimestamp = ' || systimestamp);
    dbms_output.put_line('current_timestamp = ' || current_timestamp);
    dbms_output.put_line('current_timestamp +18 = ' || (current_timestamp + numtodsinterval(18,'day')));
    dbms_output.put_line('localtimestamp = ' || localtimestamp);
    end;
    SQL dbtimezone = +00:00
    SQL sessiontimezone = US/Eastern
    SQL current_timestamp = 17-MAR-10 09.29.32.784000 AM US/EASTERN
    SQL current_timestamp +18 = 04-APR-10 10.29.32.784000000 AM US/EASTERN
    SQL localtimestamp = 17-MAR-10 09.29.32.784000 AM
    dbtimezone = +00:00
    sessiontimezone = US/Eastern
    systimestamp = 17-MAR-10 02.29.32.784000000 PM +00:00
    current_timestamp = 17-MAR-10 09.29.32.784000000 AM US/EASTERN
    current_timestamp +18 = 04-APR-10 10.29.32.784000000 AM US/EASTERN
    localtimestamp = 17-MAR-10 09.29.32.784000000 AM
    dbtimezone = +00:00
    sessiontimezone = US/Eastern
    systimestamp = 17-MAR-10 02.16.21.366000000 PM +00:00
    current_timestamp = 17-MAR-10 09.16.21.366000000 AM US/EASTERN
    current_timestamp +18 = 04-APR-10 10.16.21.366000000 AM US/EASTERN
    localtimestamp = 17-MAR-10 09.16.21.366000000 AM
    is this a known bug?
    is there a patch or a work-around for XE?
    are other datasbase versions affected?

    Can't patch XE, unfortunately it comes with pre-2007 DST rules.
    There is a metalink note describing how to fix the DST changes, and while it's not really a "supported" method, neither is XE- if you can get updated timezone files from a later patch set for the same release, 10gR2, on the right operating system, shutdown/startup the database the updated DST rules will be in place. The timezone files are in $ORACLE_HOME/oracore/zoneinfo.
    Another unfortunately, any values already stored in the database using timestamp with local timezone datatypes for the affected period of the DST changes won't be correct, i.e. there is no 2010-03-14 02:01 (?) but with older timezone rules in place that would be a valid timestamp. The data has to be saved before updating the timezone file, and re-translated to timestamp w/local tz datatypes after the update.
    IMHO storing literal timezone info isn't an ideal practice, let the client settings do the time interpretation, time is always changing. Its the interpretation of the time that gets changed. From time to time. :(

  • Need HELP to pass results from procedure

    Hey Gurus,
    I need your help. I got a package (test) and inside the package two procedures (step1, step2). Now I want to pass the results from the procedure step1 (stat_rec.lev, stat_rec.chi_sq, stat_rec.chi_sig) to the other procedure step2 and make a select with where-clause. How can I manage this?? Got someone a idea??
    Here my package:
    CREATE OR REPLACE PACKAGE test1
    AS
    PROCEDURE step1(table_in IN VARCHAR2, column1 IN VARCHAR2,column2 IN VARCHAR2);
    TYPE stat_tab_rec IS RECORD(lev NUMBER, chi_sq NUMBER, chi_sig NUMBER, rank NUMBER);
    stat_rec stat_tab_rec;
    PROCEDURE step2(table_in IN VARCHAR2, column1 IN VARCHAR2,column2 IN VARCHAR2);
    END test1;
    Thanks for your help!!
    CREATE OR REPLACE PACKAGE BODY test1
    AS
    PROCEDURE step1(table_in IN VARCHAR2, column1 IN VARCHAR2,column2 IN VARCHAR2,column3 IN VARCHAR2,column4 IN VARCHAR2,column5 IN VARCHAR2)
    IS
    TYPE cur_crosstab IS REF CURSOR;
    cur_cross cur_crosstab;
    BEGIN
    OPEN cur_cross FOR 'WITH '
    ||'att_grp AS '
    ||'(SELECT '||column1||' as x1 , lev AS lev, '||column2||', '
    ||' CASE'
    ||' WHEN '||column2||' <= lev '
    ||' THEN 1 '
    ||' ELSE 2 '
    ||'END attribute_group '
    ||'FROM '||table_in||', '
    ||'(SELECT level AS lev '
    ||'FROM dual '
    ||'WHERE level >= (SELECT MIN('||column2||') FROM '||table_in||') CONNECT BY level <= (SELECT MAX('||column2||') FROM '||table_in||'))) '
    ||'SELECT lev, '
    ||'ROUND(STATS_CROSSTAB(x1,attribute_group,''CHISQ_OBS''),4) AS chi_square, '
    ||'ROUND(STATS_CROSSTAB(x1,attribute_group,''CHISQ_SIG''),4) AS significance, '
    ||'dense_rank() over (order by ROUND(STATS_CROSSTAB(x1,attribute_group,''CHISQ_OBS'' ),4) DESC) AS rank '
    ||'FROM att_grp '
    ||'GROUP BY lev '
    ||'ORDER BY lev';
    LOOP
    FETCH cur_cross INTO stat_rec;
    EXIT WHEN cur_cross%NOTFOUND;
    IF stat_rec.rank = 1 THEN
    DBMS_OUTPUT.put_line(column2);
    DBMS_OUTPUT.put_line(stat_rec.lev|| ' = ' || TO_CHAR(stat_rec.chi_sq,'99.99') || TO_CHAR(stat_rec.chi_sig,'99.99'));
    END IF;
    END LOOP;
    CLOSE cur_cross;
    END step1;
    PROCEDURE step2
    IS
    BEGIN
    END step2;
    END test1;

    Thank you Massimo. I tried your example but I recieve an error: PLS-00306: wrong number or types of arguments in call to "procedure1"
    Here my Codes:
    CREATE OR REPLACE TYPE stat_obj IS OBJECT(zeilen NUMBER,lev NUMBER, chi_sq NUMBER, chi_sig NUMBER);
    CREATE OR REPLACE TYPE stat_tab IS TABLE OF stat_obj;
    CREATE OR REPLACE PROCEDURE procedure1(table_in IN VARCHAR2,column1 IN VARCHAR2,column2 IN VARCHAR2, v OUT stat_tab)
    IS
    TYPE cur_crosstab IS REF CURSOR;
    cur_cross cur_crosstab;
    TYPE stat_tab_rec IS RECORD(lev NUMBER, chi_sq NUMBER, chi_sig NUMBER);
    stat_rec stat_tab_rec;
    BEGIN
    OPEN cur_cross FOR 'WITH '
    ||'att_grp AS '
    ||'(SELECT '||column1||' as x1 , lev AS lev, '||column2||', '
    ||' CASE'
    ||' WHEN '||column2||' <= lev '
    ||' THEN 1 '
    ||' ELSE 2 '
    ||'END attribute_group '
    ||'FROM '||table_in||', '
    ||'(SELECT level AS lev '
    ||'FROM dual '
    ||'WHERE level >= (SELECT MIN('||column2||') FROM '||table_in||') CONNECT BY level <= (SELECT MAX('||column2||') FROM '||table_in||'))) '
    ||'SELECT lev, '
    ||'ROUND(STATS_CROSSTAB(x1,attribute_group,''CHISQ_OBS''),4) AS chi_square, '
    ||'ROUND(STATS_CROSSTAB(x1,attribute_group,''CHISQ_SIG''),4) AS significance, '
    ||'dense_rank() over (order by ROUND(STATS_CROSSTAB(x1,attribute_group,''CHISQ_OBS'' ),4) DESC) AS ranking '
    ||'FROM att_grp '
    ||'GROUP BY lev '
    ||'ORDER BY lev';
    LOOP
    FETCH cur_cross INTO v;
    EXIT WHEN cur_cross%NOTFOUND;
    --IF v_stat_tab.rank = 1 THEN
    --DBMS_OUTPUT.put_line(v_stat_tab.lev || '=' || TO_CHAR(v_stat_tab.chi_sq,'99.99') || TO_CHAR (v_stat_tab.chi_sig,'99.99'));
    --END IF;
    END LOOP;
    CLOSE cur_cross;
    END;
    CREATE OR REPLACE PROCEDURE procedure2
    IS
    v_zeilen NUMBER;
    v_lev NUMBER;
    v_chi_sq NUMBER;
    v_chi_sig NUMBER;
    v stat_tab;
    BEGIN
    procedure1(v);
    SELECT zeilen,lev,chi_sq,chi_sig INTO v_zeilen,v_lev,v_chi_sq,v_chi_sig
    from table(v);
    DBMS_OUTPUT.put_line(v_zeilen||v_lev||v_chi_sq||v_chi_sig);
    END;
    Hope u can help me!!

  • Highly frustrated with Outlook 2013 Search People box bugs - Multiple Name Results for Same Contact & Inconsistent Results

    The Outlook 2013 "Search People" box does not function properly. It frequently displays incorrect results or a mess of duplicate results. I've reported previous issues about this and consolidating my posts into one (with screenshots this
    time). Hopefully this message will be forwarded to or seen by the Outlook programmers. It really needs to be fixed.
    Outlook 2010 and other prior versions worked perfectly. You search for name, you get ONE result with the info you're looking for. FAST AND EASY. But with Outlook 2013 Microsoft has created a heck of a mess resulting in huge frustration and productivity loss
    with such simple but important tasks.
    I have hundreds of contacts stored in my Outlook address book, and they all have COMPLETE contact info added. 
    One major issue that I'm experiencing in the new Outlook 2013 is that I now get average of 4 or more duplicate name results appearing for the same contact. And each result contains different and incomplete contact info, making it impossible for me to quickly
    find the basic info I'm looking for. The cause of this issue is that Outlook 2013 now provides results from not only your local address book(s), but it also shows results based  on your email history and social media accounts setup.
    And there's no way to turn this off, or at least specify what folders and/or accounts the People Search box should use.
    To make matters worse, the Microsoft developers conveniently forgot to add some form of an indicator (like a small icon besides each name result in the list)  that clearly indicates what result is from what source. So you must manually click on each
    result one at a time and repeat the search until you locate the correct one.
    For one specific example, I have a contact stored in my local address book called
    Infusionsoft. When I type "Infusionsoft" in the People Search box to quickly find a phone number, Outlook  2013 shows me 7 results with the same name. See the screenshot below:
    As you can see in the screenshot above, every result just says "Infusionsoft", so I have to manually click on each name result one at a time and repeat the process until I find the correct one from my address book. This same thing happens with other
    random contacts.
    From what I can tell, Outlook is pulling results based on  based on recent emails I've received from different people with "@infusionsoft.com" in their email address. So the first result shows "[email protected]" (just the email
    address), the second result shows "[email protected]", the third result shows "[email protected]" and so forth. I don't want Outlook to show all of that. I just want what's in my address book!
    And you would think that the last result would be the correct one from my address book, but no. Sometimes its the 5th result, and other times it's the 3rd or 7th result. So there's no freaking order of things here.
    We simply need the ability to turn off searching of email history and other accounts when using the People Search box. Problem fixed.
    (And please don't tell me that I need to "link" every incorrect result to one main contact. You shouldn't expect everyone to have to tediously link any and all results that appear to a record. ESPECIALLY when 5+ results for each contact appear regularly.)
    ISSUE 2: Some names must be typed in a different way for the Search People to locate them
    Another big issue I'm having with the Search People box is that some name searches don’t show the correct result, unless I search for their names in a different way.
    For one specific example, I have a contact stored in my address book named "Dave Johnson". When I type "Dave Johnson" in the Search People box, one result appears, but it's just his email address, only. It's not the result that's stored in my Outlook address
    book with his phone number, addresses, etc. Screen shot below:
    If I type in Dave's name reverse order (Johnson Dave),  no results are found at all.
    Now if I just type in just"Johnson" all by itself, it finds Dave's correct result (the one stored in my Outlook Address Book). Along with everybody else that has "Johnson" in their name (see screenshot below)...
    I double-checked how I have Dave's name programed in my address book, and it's in there as "Dave Johnson" for both the Full Name and File As fields. 
    Also, the name order shouldn't make any difference when using the People Search Box anyway. Sometimes I can find people by Last Name, First Name or First Name, Last Name. Only with random contacts does it get difficult finding  their info and
    I have to do strange things like this to find them from the People Search box.
    ISSUE 3: Some Search People results only yield an email address only.
    For other random contacts, some search results only yield an email address with no other contact details. But I can open the persons contact card from the address book manually, with the same email address shown! Screenshot below...
    In the screenshot above, I have outlined the Search People box results in red, and the Address Book results in green. You can clearly see that "Robert White" is a contact stored in my local address book with full contact details, but the Search People result
    only shows his email address! Again, it's not consitent. It's hit or miss with different people.
    ISSUE 4: Some results just don't appear at all, but they are in the address book
    Another issue I'm experiencing with the People Search Box is that some people simply  cannot be found. But I can see their contact info just fine if I click on the "People" tab down at the bottom of the page and type in their name in the "Search Contacts"
    field. Why can't the People Search box find certain people? I opened up their contact details and cannot find a single thing  that would prevent them from showing up in results.
    These are clearly serious bugs that need to be fixed. And I'm shocked as to how this got missed--or ignored during alpha and beta testing. I see the "idea" behind the developers having the Search People box search everything outside of the
    address book, but in real world application this causes a heck of a lot of problems & confusion, and it needs to be fixed ASAP.
    For technical details, I have Outlook 2013 running on two computers using hosted Exchange 2010. One system is Windows 7 and other is Windows 8. The same problems occur on BOTH computers. As far as my Outlook account setup, I have all contacts stored in the
    main address book (no sub-folders or other folders).
    Can someone help communicate this message to the Outlook developers??? The "Frown" button limits me to 100 characters and one image. There's no way I can communicate this level of detail and steps to duplicate in 100 characters!

    Thanks for your reply.
    1) The instant search boxes in each individual page work just fine. If I am on the People page and type in a name in the "Search Contacts" field, it searches my contacts and displays the results that I want. But I should not have to leave whatever screen
    I'm in to find people now. In Outlook 2010 and earlier versions, I could be on the calendar page and then search for a contact without clicking off the calendar completely. For productivity-sake, it's a huge waste of time and hassle now.
    2) I'm familiar with how contact linking works, and quite frankly it's a huge mess in general. I NEVER create multiple contacts for the same person. I get that Outlook 2013 get confused now when it detects a LinkedIn or Facebook account for the same person
    already in my Outlook address book, but we need to have options that allow us to turn off results from some or all social networks. This is a big part of the problem.
    Think about it this way - The average person has 150+ LinkedIn connections, and more for Facebook. Many people today have accounts for both and they are setup with the same email address. When Outlook 2013 has to scan all the networks IN ADDITION to your
    local address book(s), it's a no brainer that it can get very confused trying to display results.
    Another big part of the problem is that Outlooks new search system also scans your email history. I receive emails from people who use multiple email addresses, or emails from companies with multiple reps or ticket systems that send you a unique
    ticket ID # ending in the same email address domain. Now Outlook displays people search results based on everything under the sun in my email history. This is beyond frustrating (see my "Infusionsoft" screenshot above in the first post).
    Again, I want to stress that for the search examples I referenced, I only have one entry in my Outlook address book for each person. And that's all I want to find when I search for people--what's already in my own address book! 
    In summary:
    We need an OPTION to turn off searching external networks when using the People Search box
    We need an option to tell Outlook to not scan email history for people search results (I think this needs to be disabled entirely actually. It's not helpful at all)
    There should be a fixed priority for displaying people search results, with local address book results FIRST, followed by social network results.
    There should be a clear icon/indicator next to each result that gives you a clue as to where the result is coming from. Your address book? Facebook? LinkedIn? We should not need to click on each result to get a hint as to where it's coming from.
    Work out the bugs in general with the new search system.
    One other thing that I didn't mention is that the Search People box also shows results for people I'm not even "friends" or connected with on the different social networks. But I've noticed that some people use the same email address for those networks that
    I already have programmed for them in my address book, which is why Outlook sometimes shows me these results. Does that make sense?
    I'll try rebuilding the index, but after testing Outlook 2013 on 3 different machines so far and seeing the same results (all slightly different results on each machine and very inconsistent), I doubt this will address the issue.

Maybe you are looking for