sql - Oracle9i: Filter Expression Fails to Exclude Data at Runtime -


I have a relatively simple selection statement in the VB6 program that I have to maintain (to suppress its natural tendency; I have inherited this thing, I have not written it.)

This statement is clear (reproduced for clarity):

  Choose different Code_table A , Place B to b.ip_address where a.code_item = b.which_id and a.location_type_code = '15' and a.code_status = 'R'  

The table in question gives one List of IP addresses Number is a key pillar in question code_status . Some time ago, we realized that one of the IP addresses was no longer valid, so we changed its status to exclude I (invalid) from appearing in the results of the query.

When you execute the query in SQL Plus or SQL Developer above, then everything is fine. But when you execute it from VB6, then the check against code_status is ignored, and the invalid IP address appears in the result set.

My first estimate was that the results were cached somewhere. But, due to not being an Oracle expert, I do not know where to look for me

This is ancient code VB6. SQL is embedded in the application. At the moment, I do not have the time to re-write this as a stored procedure. (I will be given a chance for a few days.) But, I have to know what is the reason for this inequality in practice and how to eliminate it. If this is happening, then it's probably happening elsewhere.

If someone can suggest looking at a good place, then I would greatly appreciate it.

some random thoughts:

  • Are you sure Did you make changes that invalidate the IP address? Can anyone see the converted code_status (using another DB connection / user)?

  • Are you sure that results can not be modified after returning from the database?

  • Are you sure that you are using "same" database connection in SQLPlus as code (database, user etc.)?

  • Are you sure you have been sent to the SQL database? (You can check by tracing the Oracle server or debugging the VB code). Reformating may have changed "something".

Above my head, I can not think of any "caching" which could rejoin unwanted IPs. Hopefully some of the above will tell you where to think about.


Comments