Home » SQL & PL/SQL » SQL & PL/SQL » null data
null data [message #436612] Thu, 24 December 2009 08:11 Go to next message
anat1983
Messages: 6
Registered: December 2009
Junior Member
hello!
im trying to insert data and i have trigger. there is a lot of columns on the trigger from some tables. how can i make insert null data on some of column (if there is no data for this column). i want that the other data will insert.
thank you
Re: null data [message #436614 is a reply to message #436612] Thu, 24 December 2009 08:17 Go to previous messageGo to next message
Its_me_ved
Messages: 979
Registered: October 2009
Location: India
Senior Member
anat1983 wrote on Thu, 24 December 2009 08:11
hello!
im trying to insert data and i have trigger. there is a lot of columns on the trigger from some tables. how can i make insert null data on some of column (if there is no data for this column). i want that the other data will insert.
thank you



null data??

null means undefined, unknown

[Updated on: Thu, 24 December 2009 08:23]

Report message to a moderator

Re: null data [message #436615 is a reply to message #436614] Thu, 24 December 2009 08:26 Go to previous messageGo to next message
anat1983
Messages: 6
Registered: December 2009
Junior Member
i have a trigger after insert that insert values from 2 table to other table. when im insert data to one table, the second table dont have data ( no data found).

i want that when no data found it will be null.
Re: null data [message #436617 is a reply to message #436615] Thu, 24 December 2009 08:33 Go to previous messageGo to next message
Its_me_ved
Messages: 979
Registered: October 2009
Location: India
Senior Member
What you tried so far?


Create table test ( col1 number(3)not null, col2 number(3) null);
Hint:
--Inserting null values to nullable column
insert into test(col1) values(1);
select * from test;


Regards,
Ved

[EDITED by LF: fixed a typo as per OP's request ("non nullable" to "nullable")]

[Updated on: Thu, 24 December 2009 16:36] by Moderator

Report message to a moderator

Re: null data [message #436618 is a reply to message #436615] Thu, 24 December 2009 08:33 Go to previous messageGo to next message
BlackSwan
Messages: 24912
Registered: January 2009
Senior Member
>i want that when no data found it will be null.
Exactly what is "it" in statement above.

post DDL & show what you want
Re: null data [message #436675 is a reply to message #436615] Fri, 25 December 2009 03:46 Go to previous message
Michel Cadot
Messages: 63810
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
when im insert data to one table, the second table dont have data ( no data found).

Which is the correct behaviour, why would you have data ib a second table when you insert in a first one.

Quote:
i have a trigger after insert that insert values from 2 table to other table.

Have you? We haven't.
It seems you expect we debug some code you don't want to show.
Just a minute, wait my crystal ball is repaired.

Regards
Michel
Previous Topic: select last value without analytic function
Next Topic: INITCAP sql function and apostrophes
Goto Forum:
  


Current Time: Thu Sep 29 03:52:02 CDT 2016

Total time taken to generate the page: 0.13734 seconds