Question on the definition of the width of column in SQL * more with information recovered w SQL

Hello

Is there a way to tell SQL * more to set the width of a column with the largest width of the items in the column? (as opposed to the default which is declared in the DDL width)

In other words, I would like to do something functionally equivalent to this:

COL < columname > format [select max (length (< columnname >)) < thetablethatcontainscolumname >]

I do above manually in two steps

1. select max (length (columnname)) of...

2 col columnname format a [resultofstep1]

Is it possible to do in one step?

Thank you for your help,

John.

Hi John

I don't think that there is a way to do this, because this information is not known at run time (as you proved it, you must run a separate SQL query first to calculate that information - also, what happens if there are predicates, this could affect the defined result so the request will actually be performed twice). You may decide an arbitrary width for each column and set it as being wrapped/word_wrapped/truncated.

Other that that, you should consider whther you are using the right tool for the job, SQLplus is not exactly ideal for the presentation layer stuff. Something like APEX would give you much more control over the layout and formatting.

See you soon

Ben

Tags: Database

Similar Questions

  • How can I incease the width of column in the google search results?

    The search results show all the words and the URL so I want to be able to increase the width of column - I can't see an icon that allows me to do

    The full URL is in the link, and an extension script or a user could replace the short green text (< name > element) with the full link, but I suspect it should be customized wrote, I don't know that you won't find anything in that direction right now.

  • How to change the width of columns in an interactive report?

    I have an interactive report. I want to customize the width of the column in the report. How to get there?

    Thank you
    Jen

    Two things... (1)

     items are for the forum display use only, do NOT copy them to your page in APEX..  2) I have modified your page 23 in your app, I have added the code in the proper location and removed the other code you had in place and copied it to the comments section of page.
    
    Please take a look and adjust the size accordingly..
    
    If this answers your question, please mark the question as answered and assign points where due..
    
    Thank you,
    
    Tony Miller
    Webster, TX
    
    Time flies like the wind, but fruit flies like bananas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
    
  • Three questions.  The heart rate monitor now plays nice with the third-party applications?  Can you run these third-party applications, without the link to your phone?  How much storage?

    My experience with the original watch is that the heartbeat was working fine with apps in the House but does not work well with third-party applications.  Aboriginal health applications were sub par at best.  In addition, he wouldn't these third party apps (Strava), unless you were related to your phone.  A new doesn't do me much good if it is always the case.  Finally, it's great that you can bind your helmet now but what storage is the watch have?  I am not unrealistic, its understandable if its not much, but I hope that it is enough that a few apps and music enough to pass through a 4 hour tour.

    1 WatchOS3 made major changes in this area, and 3rd party applications get access to things like HR. OS3 also makes everything much more receptive. 3rd party applications will need to be updated to play with the HR monitor.

    2. you can run applications 3rd party without the phone with you, but for your type of application, you'll want a series 2 with GPS watch. The likes of Runkeeper OK working in the older shows, but without GPS, they do not really work you need. New - 3rd third party apps will need updates to work with the GPS watch. OS3 software has been available to developers for a while now, so I expect software updates only very quickly. I don't know if or when 3rd parties had access to the equipment and GPS devices, s, then it may be some while before they have series 2 updates.

    3. you can store 2 GB of music. How much music that is depends of course format and quality, but certainly several hours.

    Hope that helps

  • "Whereas unity" during the assignment of the width of column on InDesign Server 2015

    I am currently transfer my InDesign scripts to run on InDesign Server 2015, so far all worked well, so far.

    When I try to assign a width of a column, I get the following error:

    Error string: invalid value for the set 'width' property Unit expected, but received "1.058 mm".

    The code looks like this (listTable is my table object and iEigCol a counter in a loop for, so nothing out of the ordinary):

    var spacerColumnWidth = 1.058;
    listTable.columns[iEigCol].width = spacerColumnWidth + 'mm';
    

    A few lines earlier, I use this:

    listTable.columns[0].width = '82mm';
    

    Which works very well.

    I already tried these approaches instead:

    • By simply using the number without unit
    • Using an integer instead of a double
    • Concatenating the string before using to assign width
    • With the help of a literal string

    so far nothing worked here. Strange thing is that he works on dozens of other columns with the one of the ways mentioned to do.

    The exact same script also works very well to InDesign CS5.5.

    Any ideas what the problem may be?

    Thank you very much!

    InDesign does not set a table column width or row height under 1.058 mm (not even in the script). And in the scripts, it will not let you define under 1,059 mm. Try to work with 1,059 mm, and it should work.

  • Drop-down menu in the table of cells - how to develop across the width of column?

    Hello!

    A customer migrate their 2 400 forms of old JetForms as PDF (LiveCycle Designer) and would like to keep the same functionality, so that it is used in the old platform. However, some of the old tool features do not seem to be present in LiveCycle.

    Suppose that a drop down menu in a table cell, containing the elements whose lengths are larger than the column of the table. In JetForm, when you open the drop-down menu that spans the columns to display all of its content, do not cut the contents of the drop-down list.

    I tried this in LiveCycle, but the drop down menu gets cut and its content is limited to the column in the table (where the drop-down menu below) width.

    Is there a way to bypass this limitation, even if I use scripts?

    Thank you for all the ideas!

    Marcos

    Hi Marcos,

    I don't think you will get this works reliably in a table

    Niall

  • A question about the order of COLUMN sqlplus and PL/SQL

    Hello everyone.



    I would like to ask a question about sqlplus command COLUMN that I use in order to define the length of my queries of output columns. So, for example, I run something like:
    COLUMN market FORMAT a20
    That is why any column with the name 'the market' will be composed by sqlplus as 20 characters.

    Currently I'm working on a PL/SQL script that makes this automatic procedure, in other words, instead of manually write for each column in the above COLUMN order, it uses the DBMS_SQL. He read first as input the name of the table and then inside a loop, it detects the maximum length.

    For those interested, here is the Oracle documentation page that I found (example 8)
    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14258/d_sql.htm

    If everything worked well enough I managed to recover the maximum of each column in my table length, except that I don't know how to use the COLUMN sqlplus command in my PL/SQL block. I would like to do something like that (it's just a pseudo-code)
    FOR colIndex in 1 .. numberOfColumns LOOP
            currentColumnName = getColumnName(tableDescriptionObject, colIndex);
            currentColumnLength = getColumnLength(tableDescriptionObject, colIndex);
            
            COLUMN  currentColumnName FORMAT a -- and here after 'FORMAT a' I have to write currentColumnLenth but I don't know how to proceed.
    
    END LOOP;
    I would like to know is there a command in PL/SQL to define the appropriate column typeset in sqlplus length?


    Thanks in advance,
    Dariyoosh

    Hi, Dariyoosh,

    Sory, I don't think that there is a simple way to publish SQL * most orders fom PL/SQL.
    PL/SQL runs in the database (back-end); There isn't any direct contact with SQL * more at the front end.

    The best way I know is that PL/SQL script (myfile.sql) with orders of the COLUMN, and then have SQL * more run the script (@myfile).

  • Another question on the lines of columns...

    Hello world
    I have to rotate a table, but without knowing the actual values of the columns.
    I have:

    create table (test)
    cust_id varchar2 (10),
    month_id number (6).
    number of recipes);

    insert into test ('123', 201010, 1000) values;
    insert into test ('123', 201011, 1050) values;
    insert into test ('123', 201012, 200) values;
    insert into test ('125', 201010, 2000) values;
    insert into test ('125', 201011, 2050) values;
    insert into test ('125', 201012, 2005) values;
    insert into test ('120', 201010, 5000) values;
    insert into test ('120', 201011, 5050) values;
    insert into test ('120', 201012, 2000) values;


    Result:

    '123' as cust_id, 1000 as month_1, 1050 as month_2, 200 month_3
    "125" as cust_id, 2000 as month_1, 2050 as month_2, 2005, month_3
    '120' as cust_id, 5000 as month_1, 5050 as month_2, 2000 as month_3

    I still have 3 distinct values for month_id, but I do not have at the time of the selection.
    Could you help me?
    Thank you

    MIA

    user543426 wrote:

    I still have 3 distinct values for month_id, but I do not have at the time of the selection.

    You can use an approach to table pivot, as explained in {message identifier: = 9275390}.

    Before using the PivotTable, delete its contents, run a SELECT to get your 3 distinct values and insert in the PivotTable.

    Then run the SQL pivot.

    No need of dynamic SQL or PL/SQL - like you are dealing with 3 columns static pivot for 3 distinct values. The actual values are not relevant to the process itself.

  • How to expand the width of column padding

    1 have a brochure of 8.5 x 11 with 3 columns.  can not find a way to expand the space inside the column margins.  not sure if I describe it exactly like I do not know the name of the space, I'm expanding. in the image below, it is the empty space between the purple lines.  I thought that might be the gutter, but when I change the numbers on it, nothing happens.

    margins for idd.jpg

    You'll want to change the value while working on the Master Page. And there are a few caveats.

    First, if you have used a block of text type, it has been created as a framework of several column and used the value of gutter, you started with that. The gutter in a span of several column will not change when you change values in column guide. The good news is that if you used a master image, you can enable layout adjustment (layout > setting layout...) and return to the master page, select main text blocks and adjust the value of the gutter in the Options of text block or in the control panel and it will update the pages in a document :

    If you do not use a Master frame, the page layout setting should set individual images as sanp to the column guides (but you must activate the page layout setting before setting the gutter), but will not affect executives multi-column. If your existing images have an object Style, you can modify it and change the gutter, otherwise it is a manual procedure to select managers and change the value of Strawberry as above or assign a style object that has the right options (faster). If you have a recent version of ID, you can use find/change object to find blocks of text with your number of columns and the existing gutters and change wattage you need.

  • How to remove the names of columns in SQL-report

    What I want is only data, without no column name.

    COLUMN LDATE
    SELECT SYSDATE LDATE
    FROM DUAL;

    LDATE
    --------
    07.11.11

    This example does not work. There are still LDATE above column. Any idea?

    It's all in the SQL * more manual...

    SQL> set heading off
    SQL> select * from emp;
    
          7369 SMITH      CLERK           7902 17-DEC-1980 00:00:00        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-1981 00:00:00       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-1981 00:00:00       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-1981 00:00:00       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-1981 00:00:00       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-1981 00:00:00       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-1981 00:00:00       2450                    10
          7788 SCOTT      ANALYST         7566 19-APR-1987 00:00:00       3000                    20
          7839 KING       PRESIDENT            17-NOV-1981 00:00:00       5000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-1981 00:00:00       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-1987 00:00:00       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-1981 00:00:00        950                    30
          7902 FORD       ANALYST         7566 03-DEC-1981 00:00:00       3000                    20
          7934 MILLER     CLERK           7782 23-JAN-1982 00:00:00       1300                    10
    
    14 rows selected.
    
  • Writing a query to display data WHERE the data in column do not begin with 'Rep '.

    Hello

    * (Assuming file_name is a column of table $file_log) *.

    Please tell me

    How to write a query where I want to display the data for which File_Name does not begin with name like Reports_

    Please tell me.

    Thank you

    Hello

    I hope that this might help

    SELECT * FROM FILE_LOG_TABLE WHERE FILE_NAME NOT LIKE 'Reports_%';
    

    see you soon

    VT

  • A few questions about the difference between the Satellite P70, L70, S70

    Hello, I have a lot of questions about the P70, L70, S70 series that come with a 1920 x 1080 panel.

    (1) what are the differences between the L70 and S70 series? With the exception of the RAM and HARD drive capacity, books seem pretty identical.

    (2) P70, L70, S70 doesn't support a 2nd HARD drive or it's just the P70 series that support?

    (3) all the three (P70, L70, S70 series) come with the same TFT panels?

    (4) of the above series, which supports mSata?

    (5) all the model of each series are delivered with support from mSata? For example, it could be that L70 - a - 13 m supports mSata is not the case of the L70-a-146?

    (6) all the foregoing, are delivered with a S - ATA II or III S - ATA interface?

    (7) who is the best of these series listed? I'm trying to understand what makes the big difference of S70 to P70 except for the envelope for example.

    Thank you in advance.

    > (1) what are the differences between the series L70 and S70? With the exception of the RAM and HARD drive capacity, books seem pretty identical.

    What models Sat L70 and S70 do you mean exactly? There are different L70-xxx-xxx and S70 models on the market that supports different hardware specifications.

    (> S70 2) P70, L70, support a 2nd drive HARD or is - it just the series P70 that support?
    As you can see in this [Sam P70 HDD replacement document, | http://aps2.toshiba-tro.de/kb0/CRU3903II0000R01.htm] the P70 series supports the 2nd drive Bay HARD, BUT even if there is a 2nd HARD drive Bay, this does not mean that you can use the 2nd HARD drive. In the case where the 2nd HARD drive Bay are equipped with HARD drive connector, you can use the 2nd HARD drive

    I also found the [Sam L70/S70 HDD replacement | http://aps2.toshiba-tro.de/kb0/CRU3703HG0000R01.htm] the document on the Toshiba page and there I see this 2nd HARD drive Bay is not available

    (> 3) all three (P70, L70, S70 series) come with the same TFT panels?
    See point 1). Different P70, L70, S70 models were equipped with different material parts.

    (> 4) of the series above, which takes in charge mSata?
    As far as I know that some P70 models are equipped with an mSATA SSD of 256 GB.

    (> 5) do all the model of each series are delivered with support mSata? For example, it could be that L70 - a - 13 m supports mSata is not the case of the L70-a-146?
    See point 4) not all models supports the same hardware specifications

    (> 6) all of the above, come with a S - ATA II or III S - ATA interface?
    I don t think that SATA III is supported. I guess it would be SATA II

    (> 7) which is the best of these series listed? I'm trying to understand what makes the big difference of S70 to P70 except for the envelope for example.
    Not easy to answer because there are too many models released in Europea.
    And not all models are available in each country. So I guess you will have to look for the models that have been released in your country.

  • Where are the handles to change the width of the circles?

    Well, Adobe keeps adding useless "feautures" Illustrator and with each update, I found myself faced with some cool new "development".

    So please help me out here: when I create a circle with the latest version of Illustrator - where are the handles to change the width?

    I know that you can recover the corners, but that could also change the height and is not accurate. And you can also just type the width you want in the properties of the object or use the transformation tool. But this is not the point.

    Adobe really removed the feature or I'm blind to find?circle.jpg

    Also: ADOBE BRING CURVE HANDLES ALIGNMENT ON THE GRID!

    Object > shape > expand shape changes it back to the old style, make an action,

    or do what I did--make a keyboard shortcut.

    So when you draw the direct form, hit the shortcut key and you are back to the old behavior of form in a second dish


    Edit > keyboard shortcuts > Menu commands > object > shape > expand the form .

    then in the first box on the right, click on it, select and press a key on the keyboard, I choose F9, OK and name it.

  • How can I keep the width of the columns (1) and (2) a header when you replace a table?

    I am trying to format a series of paintings using simple Excel files and two columns that look like this:

    Screen Shot 2015-09-07 at 4.04.36 PM.png

    I have already created a table style, but I find myself relating to two additional steps each time I replace the existing data with a new Excel file:

    Challenge #1: Manually set the width of each column to 3 inches.

    Challenge #2: Manually convert the top row a header.

    Each of these tasks only takes a few seconds to set up, but I'll have to make hundreds of them and the time adds up. Here's my existing workflow:

    1. Select the existing table, properly formatted.

    Screen Shot 2015-09-07 at 4.09.59 PM.png

    2 file > Place... (Replace the item selected and The show Import Options checked)

    Screen Shot 2015-09-07 at 4.10.44 PM.png

    3. import in an unformatted Table using the custom Table Style 1 created for this document.

    Screen Shot 2015-09-07 at 4.08.54 PM.png

    Note: Once fell, the width of the previous columns is lost and there is no identified header:

    Screen Shot 2015-09-07 at 4.08.06 PM.png

    4. I manually adjust the width of the columns to 3 inches.

    Screen Shot 2015-09-07 at 4.08.23 PM.png

    5. Finally, I converted the top row a header.

    Screen Shot 2015-09-07 at 4.08.34 PM.png

    Result is a perfectly formatted table, exactly 6 inches wide, each column taking up half the width.

    Screen Shot 2015-09-07 at 4.08.40 PM.png

    Ideas to keep the width of column after replacing the Excel file and/or fit automatically in the top row, as a header would be greatly appreciated!

    Something like this should do the trick. Copy the script in a text editor, save with the extension .jsx and put in your folder of InDesign scripting. If you do this a lot, it would be useful to assign a shortcut to the script key.

    To use, place your cursor in a table cell, or select a cell or a line and run the script.

    //BS"D
    // Copyright (c) 2015 by www.Id-Extras.com
    // Free to use, but please do not remove this notice.
    myTable = app.selection[0].parent;
    if (!myTable instanceof Table){
      myTable = myTable.parent;
    }
    if (!myTable instanceof Table){
      alert("Select a cell or place your cursor in a cell, and try again");
      exit();
    }
    myTable.columns.everyItem().width = "3 in";
    myTable.rows[0].rowType = RowTypes.HEADER_ROW;
    
  • A question about the number of error indicated by SQL line * more

    Hello everyone,

    OS: Fedora Core 17 x86_64
    Oracle version: Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    I have a question for the line number specified by SQL * more whenever he is in error (syntax error, for example) in your script file. Consider the following script file (myscript.sql) which includes exactly 12 lines. Before the instruction to START I just put 4 blank lines by using - just to make the code clearer to read.
    HOST clear;
    SET SERVEROUTPUT ON;
    SET PAGESIZE 0;
    SET LINESIZE 1000;
    --
    --
    --
    --
    BEGIN
      DBMS_OUTPUT.PUTLINE('Hello');
    END;
    /
    DBMS_OUTPUT. PUTLINE at line 10 is obviously a mistake and it should be DBMS_OUTPUT. Put_line. However, if you run the script here is the output:
    SQL> @myscript.sql;
    
      DBMS_OUTPUT.PUTLINE('Hello');
                  *
    ERROR at line 2:
    ORA-06550: line 2, column 15:
    PLS-00302: component 'PUTLINE' must be declared
    ORA-06550: line 2, column 3:
    PL/SQL: Statement ignored
    
    
    SQL>
    for SQL * the error is in the line 2 and not 10.

    Any idea?

    Thanks in advance,

    >
    for SQL * the error is in the line 2 and not 10.
    >
    No - for Oracle, the error is in the line 2 and not 10.

    This is the code that sees the parser. What is the 2 line?

    BEGIN
      DBMS_OUTPUT.PUTLINE('Hello');
    END
    

Maybe you are looking for