Write a PL/SQL program to Captalize all the first characters in a Sentence - Computer Programming

Latest

C C++ Java Python Perl Programs Examples with Output -useful for Schools & College Students

Thursday, October 5, 2017

Write a PL/SQL program to Captalize all the first characters in a Sentence

PL/SQL program to Captalize all the first characters in a Sentence

Program:

DECLARE

PROCEDURE capi_ini(n VARCHAR2)
IS
extract_str VARCHAR2(1);
chk NUMBER := 0;
BEGIN
FOR i IN 1 .. LENGTH(n)
LOOP
extract_str := SUBSTR(n,i,1);



--dbms_output.put_line('chk : ' || chk);
IF chk = 0 THEN
dbms_output.put(UPPER(extract_str));
ELSIF chk = 1 THEN
dbms_output.put(LOWER(extract_str));
END IF;

IF extract_str = ' ' THEN
chk := 0;
ELSE
chk := 1;
END IF;

END LOOP;
dbms_output.new_line;

END;


BEGIN
capi_ini('this IS a CHECK to SEE if every thing is working properly');

END;

No comments:

Post a Comment