Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Declare
- v_a_variable varchar2(10);
- Begin
- v_a_variable := '';
- --This should succeed but doesn't
- If v_a_variable = '' Then
- dbms_output.put_line('Is Empty String');
- else
- dbms_output.put_line('Is Not an Empty String');
- end if;
- --Oracle converts a value being set to '' to null
- --but Oracle didn't convert the if = '' to if is null which I think it should have done
- If v_a_variable is null Then
- dbms_output.put_line('Variable is null');
- else
- dbms_output.put_line('variable is not null');
- end if;
- End;
- if v_a_varable = '' Then
- if _va_variable is null Then
- Declare @v_a_variable varchar(10)
- set @v_a_variable = '';
- if @v_a_variable = ''
- print 'Is Empty String';
- else
- print 'Is not empty';
- if @v_a_variable is null
- print 'Is null String';
- else
- print 'Is not null';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement