Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Prevent inserting null into table

mikrimouseMay 4 2018 — edited May 7 2018

MERGE INTO PRIORITY_LEAGUES M

      USING  (

      SELECT DISTINCT COMP_NAME AS COMP_NAME FROM LIVE_MATCHES_TZ

      ) LM ON (LM.COMP_NAME=M.SUB_LIST)

      WHEN NOT MATCHED THEN

        INSERT

        (

          M.SUB_LIST,

          M.PRIORITY,

          M.SPORT,

          M.CREATED

        )

        VALUES

        (

          LM.COMP_NAME,

          P_PRIORITY,

          p_sport_s,

          SYSDATE

        );

        COMMIT;

I need to prevent inserting null if value M.SUB_LIST is null. I set m.sub_list is nullable , but how can i prevent to insert null.
Thanks !!

This post has been answered by Hans Steijntjes on May 4 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 4 2018
Added on May 4 2018
4 comments
1,024 views