Joins with columns being joined have different lengths
Suppose I have two tables,
- emp(empId number(1),empName varchar2(50)) and - manager(manId number(5),managerName varchar2(100))
And I fire a query -
select * from emp e,manager m where e.empId = m.manId; update emp set empName= (select managerName from manager where manId='2');
Will there be any problem in this sql as length of empName and managerName is different?
First will work (well, not raise an error), second will raise an error if length of managerName > 50.
It would work with substr(managerName, 0, 50) and
WHERE empId = 2
at the end.
By the way, you could have tried !