Q:

Write a PL/SQL block to learn how to declare a character type variable

0

Write a PL/SQL block to learn how to declare a character type variable.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

PL/SQL Code:

DECLARE
  c VARCHAR2(8 CHAR);
BEGIN
  c := 'abc  ';
END;
/

if you declare like this and used to insert too long data, see an error message will appear.

DECLARE
  c VARCHAR2(3);
BEGIN
  c := 'abc  ';
END;
/

Sample Output:

DECLARE
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 4

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now