Home » SQL & PL/SQL » SQL & PL/SQL » NO ENTRY : No entry to be made in a cell, but SQL is not accepting it....What to do...!!?
NO ENTRY : No entry to be made in a cell, but SQL is not accepting it....What to do...!!? [message #218693] Fri, 09 February 2007 06:01 Go to next message
suzane
Messages: 6
Registered: February 2007
Location: Mumbai
Junior Member
Hi,

I have created a table 'EMP' with columns E_no, E_name....Commision. While inserting values into the columns, there shudn't be any entry made for one employee in 'COMMISSION' column as he do not receives any commission. That particular cell shud be empty. BUT, SQL is not accepting neither an empty space nor '_', except '0'.

Now, this is creating a problem for me while executing

> select * from emp where commision is not null;
( My idea is to select employee details who receive commission)

How to go about it.

Can you PLEASE help me.

Thanks & Regards,
Suzane.
Re: NO ENTRY : No entry to be made in a cell, but SQL is not accepting it....What to do...!!? [message #218694 is a reply to message #218693] Fri, 09 February 2007 06:10 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,

is this what you meant,if not do let us know.

insert into emp(empno,ename,sal,deptno)
values(1111,'somename',2000,10);


then,
select * from emp where comm is not null


regards,
Re: NO ENTRY : No entry to be made in a cell, but SQL is not accepting it....What to do...!!? [message #218702 is a reply to message #218693] Fri, 09 February 2007 06:56 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
When you say
SQL is not accepting neither an empty space nor '_'
, what exactly is SQL (I presume you mean Sql*Plus) doing?
Is it giving you an error message?
Is it crashing?
Is is causing the spontaneous creation of 3 inch high bluetac dinosaurs that drive you away from the computer with drawing pins?

If you don't tell us what the problem is, it's quite hard for us to fix it.

Did you try insertint a Null into the column (seeing as that's what you look for in the query you provided, it seems like a good idea:
INSERT INTO emp ( E_no, E_name, Commision) values (12, 'Employee',NULL)
Re: NO ENTRY : No entry to be made in a cell, but SQL is not accepting it....What to do...!!? [message #218703 is a reply to message #218694] Fri, 09 February 2007 07:01 Go to previous messageGo to next message
Littlefoot
Messages: 20897
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If 'commission' is to be empty, do not insert empty space, underscore _ or anything like that - insert NULL (see JRowbottom's example).

If you can NOT insert NULL, it means that this column is created as NOT NULL. Then you'll have to decide: do you want to keep it NOT NULL and insert zeros (0) into it (so your query will be ... "WHERE commission = 0" instead of "WHERE commission IS NULL"), or will you ALTER the table and set the column so that it can accept NULL values.
Re: NO ENTRY : No entry to be made in a cell, but SQL is not accepting it....What to do...!!? [message #218708 is a reply to message #218702] Fri, 09 February 2007 07:41 Go to previous message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Quote:
Is is causing the spontaneous creation of 3 inch high bluetac dinosaurs that drive you away from the computer with drawing pins?


I have heard that that specific bug has been fixed in one of the later patches after much customer complaints.

It seems a big group of disgruntled users even gathered in Redwood Shores with pitchforks and torches.
Previous Topic: Help with linking tables and grouping values into columns
Next Topic: Do joins really improve query performance?
Goto Forum:
  


Current Time: Wed Dec 07 08:52:46 CST 2016

Total time taken to generate the page: 0.09099 seconds