String types:
Fixed-length strings
Variable-length strings
Character large objects (CLOBs)
Declaring Strings:
DECLARE
v_name varchar2(20);
v_company varchar2(30);
v_designation varchar2(20):='Consultant';
v_introduction clob;
v_display_flag char(1);
BEGIN
v_name := 'Hareesh Pothuguntla';
v_company := 'Ask Hareesh';
v_introduction := 'Hello! I''m' || v_name || 'working as ' || v_designation || ' for ' ||v_company
v_display_flag := 'Y';
IF v_display_flag = 'Y' THEN
dbms_output.put_line('Name: '||v_name);
dbms_output.put_line('Company: '||v_company);
dbms_output.put_line('Role: '||v_designation);
dbms_output.put_line('Introduction: '||v_introduction);
END IF;
END;
We can declare fixed-length string using CHAR datatype like below.
v_display_flag CHAR(1) := 'Y';
v_display_flag CHAR := 'Y';
No comments:
Post a Comment