Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> NULL value
Hello,
I work on Oracle 10.1
I would like to delete line in a table where some fields can be "NULL"
EX :
DELETE T_NOTIFICATION
WHERE DOMAIN_SEQ=p_domain_seq
AND DATASET_SEQ = p_dataset_seq
AND COUNTRY_SEQ = p_country_seq
The parameters (p_...) can be NULL or not, if they are they must be
deleted.
Infortunatly, the test for the NULL value must be like that "myField
IS NULL" and that doesn't work if field has a value ....
Have you a good solution?
I have one but I find its not very good :
DELETE (SELECT NVL(DOMAIN_SEQ,0) DOMAIN_SEQ
,NVL(COUNTRY_SEQ,0) COUNTRY_SEQ
,NVL(DATASET_SEQ,0) DATASET_SEQ
FROM T_NOTIFICATION) N
This solution replace NULL with 0 to test in the table and in parameter.
Thank You!
In french
Bonjour,
Je developpe sur Oracle 10.1
Je voudrais supprimer des lignes dans une tables dont certains champs
peuvent être NULL.
EX :
DELETE T_NOTIFICATION
WHERE DOMAIN_SEQ=p_domain_seq
AND DATASET_SEQ = p_dataset_seq
AND COUNTRY_SEQ = p_country_seq
Les paramètres (p_...) peuvent être NULL ou pas, si ils le sont il faut les tester. Malheureusement, le test pour la valeur NULL doit être monchps IS NULL et ca ne va pas si il y a une valeur....
Avez vous une solution?
J'en ai trouvée une mais qui est "sale":
DELETE (SELECT NVL(DOMAIN_SEQ,0) DOMAIN_SEQ
,NVL(COUNTRY_SEQ,0) COUNTRY_SEQ
,NVL(DATASET_SEQ,0) DATASET_SEQ
FROM T_NOTIFICATION) N
Cette solution consite à remplacer les valeurs NULL par 0 dans les données à tester et dans le paramètres. Received on Wed Mar 28 2007 - 09:23:22 CDT
![]() |
![]() |