Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 558079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:05:39+00:00 2026-05-13T12:05:39+00:00

Client compiled with OCI: 10.2.0.4.0 Server: Oracle9i Enterprise Edition Release 9.2.0.4.0 The problematic query

  • 0

Client compiled with OCI: 10.2.0.4.0
Server: Oracle9i Enterprise Edition Release 9.2.0.4.0

The problematic query is:

SELECT CODIGO FROM LOG WHERE TEL = :telnumber AND DATE_PROC = '05-JUL-08'

Table description:

SQL>describe LOG;

TEL NOT NULL VARCHAR2(15)
CODIGO NOT NULL VARCHAR2(20)
DATE_PROC NOT NULL DATE

As simple as it might look, when executed directly on the server with SQLPlus, it returns a result, but when executed from the app that uses OCI, this query returns OCI_NO_DATA always. In the beginning, the date value was also a placeholder, but I found out that even giving a literal like '05-JUL-08' didn’t work. I have tried the following:

  • I’ve tried the basics: querying the DB from the client does work. It’s this one that gives me trouble
  • The following does work:

    SELECT CODIGO FROM LOG WHERE TEL = :telnumber
    
  • Executing ALTER SESSION SET NLS_DATE_FORMAT="DD-MM-YYYY"; before the query in both the server and the client. Same result: server returns data, client OCI_NO_DATA

  • Tried changing DATE_PROC format, combining this with the use of TO_DATE(). Same result.
  • Searched, searched, searched. No answer

I’m a bit desperate to find an answer, would appreciate any help and can provide as many further details as needed. Thanks.

— Further info —

update log set DATE_PROC = TO_DATE('20080705162918', 'YYYYMMDDHH24MISS') where CODIGO='BancoOne';

I have tried different combinations using trunc() and “alter session set nls_date_format”… and this is what I get:

SELECT CODIGO FROM LOG WHERE TEL = 11223344 AND DATE_PROC = TO_DATE('20080705162918', 'YYYYMMDDHH24MISS');

In server: Returns: “BancoOne” (good value)
In OCI app: Returns OCI_NO_DATA

SELECT CODIGO FROM LOG WHERE TEL = 11223344 AND trunc(DATE_PROC) = TO_DATE('20080705', 'YYYYMMDD');

In server: Returns: “BancoOne”
In OCI app: Returns “BancoOne”

So the point is, why is the OCI app giving different results if both are accessing the same DB server?

Also, to clarify the purpose of the OCI app: it has a query to be configured by the user. The idea is that the user will adapt the query as desired to fit with the Date field present in the destination DB, that’s why I should not include “alter session set nls_date_format” statements in my code, as I will not know the date format. This way I want to provide flexibility to the user, and don’t rely on specific date formats. Does this make sense? Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:05:40+00:00Added an answer on May 13, 2026 at 12:05 pm

    your column DATE_PROC is a DATE, you should always compare it to a date and never rely on the implicit data conversion.

    Try this:

    SELECT CODIGO FROM LOG WHERE TEL = :telnumber AND DATE_PROC = DATE '2008-07-05'
    

    or this:

    SELECT CODIGO 
      FROM LOG 
     WHERE TEL = :telnumber 
       AND DATE_PROC = to_date('05-JUL-08', 'DD-MON-RR')
    

    If you can, refrain from using a date format in your code that uses letters for months (because the code will fail when you change the default language) and only two chars for years (ambiguity of century). I like to use 'YYYY/MM/RR' because this format will be sorted as the original date.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

1. Compiled Assembly from JSC I've compiled what is intended to be client-side JavaScript
I've compiled my Python program using Py2Exe, and on the client's computer we've satisfied
The client connects to the server using GenuineChannels (we are considering switching to DotNetRemoting).
My client has a compiled ASP.NET 2.0 application that was compiled & deployed a
I have a socket server which I am writing in C++ and a client
Ive written and compiled a server program that is meant to echo onto the
i have a deployed grails apps on tomcat6 in my client server machine, but
A client of mine has asked me to integrate a 3rd party API into
My client has a multi-page PDF file. They need it split by page. Does
A client of mine uses Oracle 9i's utl_smtp to send mails out notifications to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.