Q. Write PL/SQL Program For Trim Method Of PL/SQL Table.
Output:
DECLARE
TYPE my_frnds IS TABLE OF VARCHAR2(100) ;
names my_frnds;
Begin
names :=my_frnds('ALLEN','SMITH','JOHN','LAKE','KING');
For i IN names.FIRST..names.LAST LOOP
DBMS_OUTPUT.PUT_LINE('My Friend Names Is '||names(i));
END LOOP;
DBMS_OUTPUT.PUT_LINE('Delete The Last Name !');
names.TRIM ;
FOR i IN names.FIRST..names.LAST LOOP
DBMS_OUTPUT.PUT_LINE('My Friend Names Is '||names(i) );
END LOOP;
End;
/
My Friend Names Is ALLEN
My Friend Names Is SMITH
My Friend Names Is JOHN
My Friend Names Is LAKE
My Friend Names Is KING
Delete The Last Name !
My Friend Names Is ALLEN
My Friend Names Is SMITH
My Friend Names Is JOHN
My Friend Names Is LAKE
PL/SQL procedure successfully completed.
Compatibility (Tested on):
Oracle Database 10g Express Edition Release 10.2.0.1.0 – Product

