SQLcl, select statement, resultant formatting of the data doesn't abide by the heading column width










0















I am using oracle SQLcl: Release 4.2.0.



When I issue this sort of select statement:



column COLUMN_A format a8
column COLUMN_B format a8
column COLUMN_C format a8
column COLUMN_D format a8
set linesize 1300
select * from table1 where rownum <= 10 order by 1;


I have the following issue:



COLUMN_A COLUMN_B COLUMN_C COLUMN_D
-------- -------- -------- --------
data1 text1 string1 date1
data2 text2 string2 date2
data3 text3 string3 date3


The data in the table output doesn't abide by the columns shown in the heading. Is there a setting that I can use so that the data in the columns fit properly in the table's columns?



I ssh into the machine that is running Oracle, via the Terminal app on a MacBook.










share|improve this question






















  • why format? try > set sqlformat ansiconsole

    – Kris Rice
    Nov 16 '18 at 2:47











  • Are you using a fixed format font?

    – Barry McGillin
    Nov 16 '18 at 12:19















0















I am using oracle SQLcl: Release 4.2.0.



When I issue this sort of select statement:



column COLUMN_A format a8
column COLUMN_B format a8
column COLUMN_C format a8
column COLUMN_D format a8
set linesize 1300
select * from table1 where rownum <= 10 order by 1;


I have the following issue:



COLUMN_A COLUMN_B COLUMN_C COLUMN_D
-------- -------- -------- --------
data1 text1 string1 date1
data2 text2 string2 date2
data3 text3 string3 date3


The data in the table output doesn't abide by the columns shown in the heading. Is there a setting that I can use so that the data in the columns fit properly in the table's columns?



I ssh into the machine that is running Oracle, via the Terminal app on a MacBook.










share|improve this question






















  • why format? try > set sqlformat ansiconsole

    – Kris Rice
    Nov 16 '18 at 2:47











  • Are you using a fixed format font?

    – Barry McGillin
    Nov 16 '18 at 12:19













0












0








0








I am using oracle SQLcl: Release 4.2.0.



When I issue this sort of select statement:



column COLUMN_A format a8
column COLUMN_B format a8
column COLUMN_C format a8
column COLUMN_D format a8
set linesize 1300
select * from table1 where rownum <= 10 order by 1;


I have the following issue:



COLUMN_A COLUMN_B COLUMN_C COLUMN_D
-------- -------- -------- --------
data1 text1 string1 date1
data2 text2 string2 date2
data3 text3 string3 date3


The data in the table output doesn't abide by the columns shown in the heading. Is there a setting that I can use so that the data in the columns fit properly in the table's columns?



I ssh into the machine that is running Oracle, via the Terminal app on a MacBook.










share|improve this question














I am using oracle SQLcl: Release 4.2.0.



When I issue this sort of select statement:



column COLUMN_A format a8
column COLUMN_B format a8
column COLUMN_C format a8
column COLUMN_D format a8
set linesize 1300
select * from table1 where rownum <= 10 order by 1;


I have the following issue:



COLUMN_A COLUMN_B COLUMN_C COLUMN_D
-------- -------- -------- --------
data1 text1 string1 date1
data2 text2 string2 date2
data3 text3 string3 date3


The data in the table output doesn't abide by the columns shown in the heading. Is there a setting that I can use so that the data in the columns fit properly in the table's columns?



I ssh into the machine that is running Oracle, via the Terminal app on a MacBook.







oracle format width heading sqlcl






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 15 '18 at 19:59









Steve TSteve T

178




178












  • why format? try > set sqlformat ansiconsole

    – Kris Rice
    Nov 16 '18 at 2:47











  • Are you using a fixed format font?

    – Barry McGillin
    Nov 16 '18 at 12:19

















  • why format? try > set sqlformat ansiconsole

    – Kris Rice
    Nov 16 '18 at 2:47











  • Are you using a fixed format font?

    – Barry McGillin
    Nov 16 '18 at 12:19
















why format? try > set sqlformat ansiconsole

– Kris Rice
Nov 16 '18 at 2:47





why format? try > set sqlformat ansiconsole

– Kris Rice
Nov 16 '18 at 2:47













Are you using a fixed format font?

– Barry McGillin
Nov 16 '18 at 12:19





Are you using a fixed format font?

– Barry McGillin
Nov 16 '18 at 12:19












2 Answers
2






active

oldest

votes


















2














Maybe upgrade?



Latest version (18.3)



drop table a8_format;
clear screen

create table a8_format (co11 varchar2(20), col2 varchar2(20), col3 varchar2(20), col4 varchar2(20));

insert into a8_format values ('data1', 'text1', 'string1', 'date1');
insert into a8_format values ('data2', 'text2', 'string2', 'date2');
insert into a8_format values ('data3', 'text3', 'string3', 'date3');
insert into a8_format values ('data4', 'text4', 'string4', 'date4');

col CO11 format a8
col col2 format a8
col col3 format a8
col col4 format a8

select * from a8_format;


Execute via F5



enter image description here



Also make sure you're using a fixed width font for the Code Editor






share|improve this answer






























    0














    1.Increase the column width in format command
    Or
    2. Use LPAD with expr2 as 12 (Or more depending upon the format spaces)






    share|improve this answer























    • SQLcl should format in columnar format. LPAd is just forcing it unnesscessarily

      – Barry McGillin
      Nov 16 '18 at 12:17











    • Yes, but just that it could be used as an option.

      – Namandeep_Kaur
      Nov 17 '18 at 0:12










    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53327085%2fsqlcl-select-statement-resultant-formatting-of-the-data-doesnt-abide-by-the-h%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    Maybe upgrade?



    Latest version (18.3)



    drop table a8_format;
    clear screen

    create table a8_format (co11 varchar2(20), col2 varchar2(20), col3 varchar2(20), col4 varchar2(20));

    insert into a8_format values ('data1', 'text1', 'string1', 'date1');
    insert into a8_format values ('data2', 'text2', 'string2', 'date2');
    insert into a8_format values ('data3', 'text3', 'string3', 'date3');
    insert into a8_format values ('data4', 'text4', 'string4', 'date4');

    col CO11 format a8
    col col2 format a8
    col col3 format a8
    col col4 format a8

    select * from a8_format;


    Execute via F5



    enter image description here



    Also make sure you're using a fixed width font for the Code Editor






    share|improve this answer



























      2














      Maybe upgrade?



      Latest version (18.3)



      drop table a8_format;
      clear screen

      create table a8_format (co11 varchar2(20), col2 varchar2(20), col3 varchar2(20), col4 varchar2(20));

      insert into a8_format values ('data1', 'text1', 'string1', 'date1');
      insert into a8_format values ('data2', 'text2', 'string2', 'date2');
      insert into a8_format values ('data3', 'text3', 'string3', 'date3');
      insert into a8_format values ('data4', 'text4', 'string4', 'date4');

      col CO11 format a8
      col col2 format a8
      col col3 format a8
      col col4 format a8

      select * from a8_format;


      Execute via F5



      enter image description here



      Also make sure you're using a fixed width font for the Code Editor






      share|improve this answer

























        2












        2








        2







        Maybe upgrade?



        Latest version (18.3)



        drop table a8_format;
        clear screen

        create table a8_format (co11 varchar2(20), col2 varchar2(20), col3 varchar2(20), col4 varchar2(20));

        insert into a8_format values ('data1', 'text1', 'string1', 'date1');
        insert into a8_format values ('data2', 'text2', 'string2', 'date2');
        insert into a8_format values ('data3', 'text3', 'string3', 'date3');
        insert into a8_format values ('data4', 'text4', 'string4', 'date4');

        col CO11 format a8
        col col2 format a8
        col col3 format a8
        col col4 format a8

        select * from a8_format;


        Execute via F5



        enter image description here



        Also make sure you're using a fixed width font for the Code Editor






        share|improve this answer













        Maybe upgrade?



        Latest version (18.3)



        drop table a8_format;
        clear screen

        create table a8_format (co11 varchar2(20), col2 varchar2(20), col3 varchar2(20), col4 varchar2(20));

        insert into a8_format values ('data1', 'text1', 'string1', 'date1');
        insert into a8_format values ('data2', 'text2', 'string2', 'date2');
        insert into a8_format values ('data3', 'text3', 'string3', 'date3');
        insert into a8_format values ('data4', 'text4', 'string4', 'date4');

        col CO11 format a8
        col col2 format a8
        col col3 format a8
        col col4 format a8

        select * from a8_format;


        Execute via F5



        enter image description here



        Also make sure you're using a fixed width font for the Code Editor







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 15 '18 at 21:28









        thatjeffsmiththatjeffsmith

        8,00211445




        8,00211445























            0














            1.Increase the column width in format command
            Or
            2. Use LPAD with expr2 as 12 (Or more depending upon the format spaces)






            share|improve this answer























            • SQLcl should format in columnar format. LPAd is just forcing it unnesscessarily

              – Barry McGillin
              Nov 16 '18 at 12:17











            • Yes, but just that it could be used as an option.

              – Namandeep_Kaur
              Nov 17 '18 at 0:12















            0














            1.Increase the column width in format command
            Or
            2. Use LPAD with expr2 as 12 (Or more depending upon the format spaces)






            share|improve this answer























            • SQLcl should format in columnar format. LPAd is just forcing it unnesscessarily

              – Barry McGillin
              Nov 16 '18 at 12:17











            • Yes, but just that it could be used as an option.

              – Namandeep_Kaur
              Nov 17 '18 at 0:12













            0












            0








            0







            1.Increase the column width in format command
            Or
            2. Use LPAD with expr2 as 12 (Or more depending upon the format spaces)






            share|improve this answer













            1.Increase the column width in format command
            Or
            2. Use LPAD with expr2 as 12 (Or more depending upon the format spaces)







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 15 '18 at 20:21









            Namandeep_KaurNamandeep_Kaur

            12017




            12017












            • SQLcl should format in columnar format. LPAd is just forcing it unnesscessarily

              – Barry McGillin
              Nov 16 '18 at 12:17











            • Yes, but just that it could be used as an option.

              – Namandeep_Kaur
              Nov 17 '18 at 0:12

















            • SQLcl should format in columnar format. LPAd is just forcing it unnesscessarily

              – Barry McGillin
              Nov 16 '18 at 12:17











            • Yes, but just that it could be used as an option.

              – Namandeep_Kaur
              Nov 17 '18 at 0:12
















            SQLcl should format in columnar format. LPAd is just forcing it unnesscessarily

            – Barry McGillin
            Nov 16 '18 at 12:17





            SQLcl should format in columnar format. LPAd is just forcing it unnesscessarily

            – Barry McGillin
            Nov 16 '18 at 12:17













            Yes, but just that it could be used as an option.

            – Namandeep_Kaur
            Nov 17 '18 at 0:12





            Yes, but just that it could be used as an option.

            – Namandeep_Kaur
            Nov 17 '18 at 0:12

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53327085%2fsqlcl-select-statement-resultant-formatting-of-the-data-doesnt-abide-by-the-h%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Top Tejano songwriter Luis Silva dead of heart attack at 64

            政党

            天津地下鉄3号線