DECLARE
emp_name_c CHAR(32);
emp_name_v VARCHAR(32);
BEGIN
emp_name_c := 'sateesh.bagadhi';
emp_name_v := 'sateesh.bagadhi';
IF emp_name_c = emp_name_v THEN
DBMS_OUTPUT.PUT_LINE('The names are the same');
ELSE
DBMS_OUTPUT.PUT_LINE('The names are NOT the same');
END IF;
END;
/
output:
Thursday, 28 July 2011
Writing and Running PL/SQL Program in windows
Step1) Write the PL/SQL code in the note pad and save it as with extension name .sql
ex: "test.sql"
DECLARE
x NUMBER;
BEGIN
x := 72600;
dbms_output.put_line('The variable X = ');
dbms_output.put_line(x);
END;
/
step 2) oracle sql*plus
type
SET SERVEROUTPUT ON
@ c:\orabook\test.sql
OUTPUT:
SQL> set serveroutput on
SQL> @ c:\orabook\test.sql
The variable X =
72600
PL/SQL procedure successfully completed.
ex: "test.sql"
DECLARE
x NUMBER;
BEGIN
x := 72600;
dbms_output.put_line('The variable X = ');
dbms_output.put_line(x);
END;
/
step 2) oracle sql*plus
type
SET SERVEROUTPUT ON
@ c:\orabook\test.sql
OUTPUT:
SQL> set serveroutput on
SQL> @ c:\orabook\test.sql
The variable X =
72600
PL/SQL procedure successfully completed.
Subscribe to:
Posts (Atom)
SQL Interview Questions and Answers
There is given sql interview questions and answers that has been asked in many companies. For PL/SQL interview questions, visit our next...
-
1) PL/SQL PROGRAM TO CUALCULATE THE NET SALARY IF DA IS 30% OF BASIC,HRA IS 10% OF BASIC AND PF IS 7% IF BASIC SALARY IS LESS THAN 8000 ,PF...
-
1.Write a program to print the following format WELCOME TO PL/SQL PROGRAMMING BEGIN DBMS_OUTPUT.PUT_LINE('WELCOME TO PL/SQL PROGRAMMING...
-
A DBMS that is based on relational model is called as RDBMS. Relation model is most successful mode of all three models. Designed by E.F. C...