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!

Diff Between NULL and CAST (NULL AS VARCHAR2(10);

S567Jun 23 2020 — edited Jun 23 2020

Hi experts,

I am working on Oracle 11 g DB.I am trying to understand diff between NULL and CAST (NULL AS VARCHAR2(10);

So, does this mean, that in SQL '' is always NULL whereas in PL/SQL '' might not be NULL ?

I have a scenario where

I am creating a table using CTASk

1.create table B as select column1,column2,....columns10 from A.


2. Now i am inserting data from B to C using INSERT statement.

Out of  10 feilds few are VARCHAR, NUM and DATE which has data coming from table A.

Now while creating table B out of 10 fields say suppose 7 fields i have to carry NULL data and going forward that NULL values will move to table C.

Is there any difference if i assign the 7 feilds just to NULL in select statement instead CAST (NULL AS VARCHAR2(10);.

Thanks,

S

This post has been answered by L. Fernigrini on Jun 23 2020
Jump to Answer
Comments
Post Details
Added on Jun 23 2020
13 comments
17,180 views