I am trying to generate a report using Oracle but am having some alignment problems. Is there a way to print values in particular columns? I am trying to achieve the following:
---------------------------------------------------------
ColA ColB ColC
----- --------- ---------
1 2 1
2 4 2
3 3 1
Currently, I am having some difficulty. I am writing the following PL/SQL command:
DECLARE
BEGIN
DBMS_OUTPUT.PUT_LINE('-');
DBMS_OUTPUT.PUT_LINE('----------------------------------------------------------------------------------------------------------------');
DBMS_OUTPUT.PUT_LINE('ColA ColB ColC');
DBMS_OUTPUT.PUT_LINE('----------- ------------ -------');
FOR record IN (SELECT * FROM TABLEA) LOOP
DBMS_OUTPUT.PUT_LINE(record.ID || ' ' || record.TAG || ' ' || record.TIP);
END LOOP;
END;
/
I am manually putting in eight spaces so my output is being messed up completely. Is there a better way to format the output?