473,323 Members | 1,551 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Not getting desired records

anurag275125
Hello..

I'm facing problem with a simple select query.
this my table structure.

Name Null? Type
USER_ID NOT NULL VARCHAR2(10)
USER_NAME NOT NULL VARCHAR2(30)
PASSWORD VARCHAR2(30)

I insert user_id, user_name but I left the password empty. Now when I run the following query:

select * from hrms_user_login where user_id='123' and user_name='anurag' and password='';

It's giving no output.
how can I get the output of this select query??

thanks
Apr 3 '10 #1

✓ answered by magicwand

One of the oldies but goodies in each ANSI committee meeting since the 90's is the battle over the defiition, how empty strings should be treated.

Whatever one might prefer:
Oracle treats empty strings as NULL values.

And comparing anything to to NULL with the <, >, =, and != operators results in FALSE (even NULL = NULL).

You have to use the IS and IS NOT operators when you work with NULL values in oracle.

So, you will get your data, when you execute:

select * from hrms_user_login where user_id='123' and user_name='anurag' and password is null;

1 1440
One of the oldies but goodies in each ANSI committee meeting since the 90's is the battle over the defiition, how empty strings should be treated.

Whatever one might prefer:
Oracle treats empty strings as NULL values.

And comparing anything to to NULL with the <, >, =, and != operators results in FALSE (even NULL = NULL).

You have to use the IS and IS NOT operators when you work with NULL values in oracle.

So, you will get your data, when you execute:

select * from hrms_user_login where user_id='123' and user_name='anurag' and password is null;
Apr 3 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: C Kirby | last post by:
I'm running a DB using MSDE (2000) that is interfaced by 2 different ades running on PCs with Access 2000 Runtime. One of the ADEs is a package accounting system that is very solid and stable, the...
5
by: Thelma Lubkin | last post by:
I have a form/subform with the common one-to-many relationship. The form allows user to display records and move to other records via the selector, to add,delete, and edit them, with the related...
3
by: VMI | last post by:
How can I get the bottom N records from an Access table and store them in my DataTable? For example, in my Access table with 2000 records, if I want to display records 151-200 (with ID as PK), my...
3
by: BrianDP | last post by:
I have a database with a split front end/back end. There is a key table in the back end called Catalog, and it is sort of a central key table for all sorts of things. It's a list of all the jobs...
1
by: sparks | last post by:
I have a form/table with an autoid it is linked to a table/form with and ID as a 1 to many. Under this form/table I need another table with many records for each on of the many in the previous...
1
by: lawton | last post by:
Source: this is an access 2003 question My knowledge level: reading books, internet, and trial & error; no formal training I'm trying to get a running sum of what's filtered in a subform which is...
1
by: hopi | last post by:
Hi, Using this condition: AND instructions NOT LIKE '%RESUBMIT%' I successfully exclude records where the 'instructions' field contains the word 'RESUBMIT' but it also excludes records...
2
by: hpbrothers | last post by:
#include<iostream.h> void main() { char mstr; char cstr; int c=1,k=0,i,j; cout<<"enter main string"; cin.getline(mstr,100); for(i=0;mstr!='\0';i++) {
2
by: srusskinyon | last post by:
I need some help getting unique records from our database! I work for a small non-profit homeless shelter. We keep track of guest information as well as what services we have offered for...
3
dmjpro
by: dmjpro | last post by:
I am testing the value of document.body.offsetWidth in Mozilla and IE. IE gets the desired value but Mozilla is not getting the desired value. Actually what happens, i want to position an element...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.