user3761068 user3761068 - 5 months ago 41
SQL Question

In the following pl sql program what is the error ? Is it a compilation error?

Declare
a VARCHAR2(10);
b NUMBER;
BEGIN
a:=&empname;
b:=&empno;
DBMS_OUTPUT.PUT_LINE('WELCOME'a||','||b||);
END;


When I am running it on oracle sql developer, it is showing some some which I can not able to figure out.

Answer

'Welcome'a is wrong. Try this:

    Declare 
         a VARCHAR2(10);
         b NUMBER; 
      BEGIN 
        a:=&empname; 
        b:=&empno;
      DBMS_OUTPUT.PUT_LINE('WELCOME'||a||','||to_char(b) );
     END;