30EA1: Determine column lengths before csv-Import

Hello out there,
I tried to import a csv (actually semicolon separated and enclosed in double quotes) into a new table using SQL Developer.
I got error messages that some columns are to short (ORA-12899). Now the question is, is there an option having SQL Developer determine the maximum length of the data to propose a suitable column width?
Wenn I convert the csv to Excel an import that, I get similar errors but much later in the process. So Excel-import seems to look much farther ahead than csv-import.
What I need is SQL Developer scanning the whole file to determine the maximum length of data an not only the first row or the first few 1000 rows.
Can this be achieved somehow?
Regards,
dhalek

Hi Dhalek,
Not sure if your problem is that we are not calculating the size of the columns correctly, we are not generating the inserts correctly or if we are not reading the rows with the columns that are large during the preview phase which is where we profile the data and determine the size of the columns. Can you see the rows that are rejected in the preview? When the table is created, are the sizes of the columns correct? Is it possible that your csv file is having the same problem with the single quote as the excel file? Once we have read the data, the generation is handled in the same way for both so the inserts should look the same.
Sqldeveloper uses java batch insert for the Insert method which is different from standard insert and inserting via a script. The rules are slightly different so rejections may differ. Also, failures reject the entire batch not just the bad row. For now, to limit the number of rejected rows, you can set the preferences->database->advanced-Sql Array Fetch Size to 1 for the import. This will generate only bad rows in the bad file and should make it easier to pinpoint the problem. You'll want to restore that value because it also affects any fetches done by SQLDeveloper. I'll need to research our generation of the single quote in the data.
Also you may want to try setting the preferences->database->load->preview characters limit to a very high number if you think the problem is that we are not reading the rows with the large columns during the preview. This is the overalll limit of characters that will be read from the file during the preview.
You can also try the insert script method to load your data which will eliminate any java batch insert issues.
Thanks,
Joyce

Similar Messages

  • How to determine column length semantics through ANSI Dynamic SQL ?

    I am looking for a way to determine the length semantics used for a column through ANSI Dynamic SQL.
    I have a database with NLS_CHARACTERSET=AL32UTF8.
    In this database I have the following table:
    T1(C1 varchar2(10 char), C2 varchar2(40 byte))
    When I describe this table in SQL*Plus, I get:
    C1 VARCHAR2(10 CHAR)
    C2 VARCHAR2(40)
    In my Pro*C program (mode=ansi), I get the select statement on input, use PREPARE method to prepare it and then use the GET DESCRIPTOR method to obtain colum information for output:
    GET DESCRIPTOR 'output_descriptor' VALUE :col_num
    :name = NAME, :type = TYPE,
    :length = LENGTH, :octet_length = OCTET_LENGTH
    For both C1 and C2 I get the following:
    :type=12
    :length=40
    :octet_length=40
    So, even if I know that my database is AL32UTF8, there doesn't seem to be a way for me to determine whether char or byte length semantics were used in C1 and C2 column definitions.
    Does anybody know how I can obtain this information through ANSI Dynamic SQL?
    Note: the use of system views such as ALL_TAB_COLUMNS is not an option, since we wish to obtain this information even for columns in a complex select statements which may involve multiple tables.
    Note: I believe OCI provides the information that we need through OCI_ATTR_DATA_SIZE (which is in bytes) and OCI_ATTR_CHAR_SIZE (which is in chars). However, switching to OCI is something we would like to avoid at this point.

    Yes, I was wondering which forum would be the best for my question. I see similar questions in various forums, Call Interface, SQL and PL/SQL and Database - General. Unfortunately there is no Pro*C or Dynamic SQL forum which would be my first choice for posting this question.
    Anyway I now posted the same question (same subject) in the Call Interface forum, so hopefully I'll get some answers there.
    Thank you for the suggestion.

  • SQL Developer - mapping column names for csv import

    In Apex I can do a spreadsheet upload to an existing table and it asks me to map source data to existing table, and it usually has the columns correct. I don't know if it imports them in order or what(first column name in table maps to first column in csv file, etc). SQL Developer makes me choose the mappings myself - it doesn't attempt to do a mapping at all, and some of my fieldnames are exactly the same. Am I missing something? Is there a way to get SQL Developer to try to do the mapping for me?
    Note: in apex and sql dev, you should use csv only... they let you choose xls, but xls fails in both products every time.

    So I guess SQL developer can't do this?

  • How do I determine the length of a column?

    Does anyone know how to determine the length of an Oracle column through sql statements? I know in SQL Server you can use the COL_LENGTH function to find the maximum length for a particular column, but I haven't been able to find an equivalent for Oracle.
    We have a column in a database that is a VARCHAR2 and can be any szie from 64 to 255 characters. I need to determine on the fly from a running client application what size the column is in the current database.
    Thank you very much for any help you can give me.

    select data_length from user_tab_columns
    where table_name='YOUR_TABLE' and column_name='YOUR_COLUMN';
    if you want function to return this value, create function like below..
    create or replace function col_len(t varchar2,c varchar2)
    return number is
    n number;
    begin
    select data_length into n from user_tab_columns
    where table_name=upper(t) and column_name=upper(c);
    return n;
    exception
    when others then
    return 0;
    end;
    /

  • Increase the column lengths of excel sheet through abap

    I developed a abap program and it was displayed the output.
      So i need to display this out put in excel sheet.
      for that I read the out put and placed in the excel,
    the only problem is the column lengths are small
    after download  i am dragging the each column,
    But i need to increase the each column by the program
       How can I ?
    I am using the following code
          lastline = new_line_c + 13.
          DO .
            READ LINE sy-index LINE VALUE INTO it_read-excel.
            APPEND it_read.
            IF sy-index > lastline.
              EXIT.
            ENDIF.
          ENDDO.
          lastline = new_line_c - 38.
          colm = ( length - 37 ) / 18.
          colm = colm + 4.
          FOR THE EXCEL CONVERTION
          INCLUDE ole2incl.
          DATA: w_cell1 TYPE ole2_object,
          w_cell2 TYPE ole2_object.
    *--- Ole data Declarations
          DATA: h_excel TYPE ole2_object, " Excel object
          h_mapl TYPE ole2_object, " list of workbooks
          h_map TYPE ole2_object, " workbook
          h_zl TYPE ole2_object, " cell
          h_f TYPE ole2_object, " font
          gs_interior TYPE ole2_object, " Pattern
          worksheet TYPE ole2_object,
          h_cell TYPE ole2_object,
          h_merge TYPE ole2_object,
          h_cell1 TYPE ole2_object,
          range TYPE ole2_object,
          h_sheet2 TYPE ole2_object,
          h_sheet3 TYPE ole2_object,
          gs_font TYPE ole2_object,
          flg_stop(1) TYPE c.
    *DATA: t_excel_bckord LIKE t_excel OCCURS 0 WITH HEADER LINE,
    *t_excel_bcklog LIKE t_excel OCCURS 0 WITH HEADER LINE,
    *t_excel_blkord LIKE t_excel OCCURS 0 WITH HEADER LINE.
          TYPES: data1(1500) TYPE c,
          ty TYPE TABLE OF data1.
          DATA: it TYPE ty WITH HEADER LINE,
          it_2 TYPE ty WITH HEADER LINE,
          it_3 TYPE ty WITH HEADER LINE,
          rec TYPE sy-tfill,
          deli(1) TYPE c,
          l_amt(18) TYPE c.
          DATA: BEGIN OF hex,
          tab TYPE x,
          END OF hex.
          FIELD-SYMBOLS: <fs> .
          CONSTANTS cns_09(2) TYPE n VALUE 09.
          ASSIGN deli TO <fs> TYPE 'X'.
          hex-tab = cns_09.
          <fs> = hex-tab.
          DATA gv_sheet_name(20) TYPE c .
    M A C R O Declaration
          DEFINE ole_check_error.
            if &1 ne 0.
              message e001(zz) with &1.
              exit.
            endif.
          END-OF-DEFINITION.
          DATA: xy TYPE i,
                xz TYPE i,
                yz TYPE i,
                ab TYPE i,
                pterm TYPE i.
          IF h_excel-header = space OR h_excel-handle = -1.
    start Excel
            CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
          ENDIF.
    PERFORM err_hdl.
    *--- get list of workbooks, initially empty
          CALL METHOD OF h_excel 'Workbooks' = h_mapl.
    PERFORM err_hdl.
          SET PROPERTY OF h_excel 'Visible' = 1.
    add a new workbook
          CALL METHOD OF h_mapl 'Add' = h_map.
    PERFORM err_hdl.
    *GV_SHEET_NAME = '1st SHEET'.
          gv_sheet_name = 'Price Comparison List'.
          GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
          SET PROPERTY OF worksheet 'Name' = gv_sheet_name .
          index1 = 3.
          LOOP AT it_read.
           heading
            IF sy-tabix < 4.
              it_item = it_read.
              IF  it_item CS '-----'.
                CLEAR it_item.
                APPEND it_item.
              ELSE.
                IF sy-tabix = 1.
                  it_item+0(1) = deli.
                ENDIF.
                APPEND it_item.
              ENDIF.
            ENDIF.
           headear data and item
            IF sy-tabix > 4 AND sy-tabix < descline1.
              it_item = it_read.
              IF it_item CS '----'.
              ELSE.
                REPLACE ALL OCCURRENCES OF sy-vline IN it_item WITH deli.
                APPEND it_item.
              ENDIF.
            ENDIF.
            xy = 2.
            xz = 38.
           discount etc
            IF sy-tabix >= descline1 AND sy-tabix < descline.
              it_item = it_read.
              it_item+12(1) = deli.
              it_item+22(1) = deli.
              it_item+43(1) = deli.
              WHILE xy < colm.
                xz = xz + 18.
                it_item+xz(1) = deli.
                xy = xy + 1.
              ENDWHILE.
              APPEND it_item.
            ENDIF.
          payment terms
            xy = 2.
            xz = 37.
            pterm = descline + 6.
            IF sy-tabix > descline AND sy-tabix < pterm.
              it_item = it_read.
              IF it_item CS '-----'.
                CLEAR it_item.
                APPEND it_item.
              ELSE.
                it_item+12(1) = deli.
                it_item+15(1) = deli.
                it_item+36(1) = deli.
                WHILE xy < colm.
                  xz = xz + 17.
                  it_item+xz(1) = deli.
                  xy = xy + 1.
                ENDWHILE.
                APPEND it_item.
              ENDIF.
            ENDIF.
         prepared by
            lastline = pterm + 3.
            IF sy-tabix >= pterm AND sy-tabix <= lastline.
              it_item = it_read.
              IF it_item CS '-----'.
              ELSE.
                it_item+0(1) = deli.
                it_item+54(1) = ' '.
                it_item+16(1) = deli.
                APPEND it_item.
              ENDIF.
            ENDIF.
           remaarks
            yz = lastline + 10.
            IF sy-tabix > lastline AND sy-tabix <= yz.
              it_item = it_read.
              it_item+0(1) = deli.
              it_item+54(1) = ' '.
              APPEND it_item.
            ENDIF.
      approved by
            ab = yz + 5.
            IF sy-tabix > yz AND sy-tabix < ab.
              it_item = it_read.
              IF it_item CS '-----'.
              ELSE.
                it_item+0(1) = deli.
                it_item+54(1) = ' '.
                it_item+14(1) = deli.
                APPEND it_item.
              ENDIF.
            ENDIF.
          ENDLOOP.
    *--Formatting the area of additional data 1 and doing the BOLD
          CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
            #1 = 1
            #2 = 1.
          CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
            #1 = 1
            #2 = colm.
          CALL METHOD OF h_excel 'Range' = h_cell
            EXPORTING
            #1 = w_cell1
            #2 = w_cell2.
    *CALL METHOD OF gs_cells 'Select' .
          GET PROPERTY OF h_cell 'Font' = gs_font .
          SET PROPERTY OF gs_font 'Bold' = 1 .
    *Bold for the second row
          CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
            #1 = 2
            #2 = 1.
          CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
            #1 = 1
            #2 = colm.
          CALL METHOD OF h_excel 'Range' = h_cell
            EXPORTING
            #1 = w_cell1
            #2 = w_cell2.
    *CALL METHOD OF gs_cells 'Select' .
          GET PROPERTY OF h_cell 'Font' = gs_font .
          SET PROPERTY OF gs_font 'Bold' = 1 .
    *Bold for the fourth row
          CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
            #1 = 4
            #2 = 1.
          CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
            #1 = 1
            #2 = colm.
          CALL METHOD OF h_excel 'Range' = h_cell
            EXPORTING
            #1 = w_cell1
            #2 = w_cell2.
    *CALL METHOD OF gs_cells 'Select' .
          GET PROPERTY OF h_cell 'Font' = gs_font .
          SET PROPERTY OF gs_font 'Bold' = 1 .
    *Bold for the fifth row
          CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
            #1 = 5
            #2 = 1.
          CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
            #1 = 1
            #2 = colm.
          CALL METHOD OF h_excel 'Range' = h_cell
            EXPORTING
            #1 = w_cell1
            #2 = w_cell2.
    *CALL METHOD OF gs_cells 'Select' .
          GET PROPERTY OF h_cell 'Font' = gs_font .
          SET PROPERTY OF gs_font 'Bold' = 1 .
    *Bold for the sixth row
          CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
            #1 = 6
            #2 = 1.
          CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
            #1 = 1
            #2 = colm.
          CALL METHOD OF h_excel 'Range' = h_cell
            EXPORTING
            #1 = w_cell1
            #2 = w_cell2.
    *CALL METHOD OF gs_cells 'Select' .
          GET PROPERTY OF h_cell 'Font' = gs_font .
          SET PROPERTY OF gs_font 'Bold' = 1 .
          DATA l_rc TYPE i.
          CALL METHOD cl_gui_frontend_services=>clipboard_export
            IMPORTING
              data                 = it_item[]
            CHANGING
              rc                   = l_rc
            EXCEPTIONS
              cntl_error           = 1
              error_no_gui         = 2
              not_supported_by_gui = 3
              OTHERS               = 4.
          CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
            #1 = 1
            #2 = 1.
          CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
            #1 = 1
            #2 = 1.
    PERFORM err_hdl.
          CALL METHOD OF h_excel 'Range' = range
            EXPORTING
            #1 = w_cell1
            #2 = w_cell2.
          CALL METHOD OF range 'Select'.
    PERFORM err_hdl.
          CALL METHOD OF worksheet 'Paste'.
    PERFORM err_hdl.
    CALL METHOD OF h_excel 'QUIT'.
          FREE OBJECT h_zl.
          FREE OBJECT h_mapl.
          FREE OBJECT h_map.
          FREE OBJECT h_excel.

    Hello Ravi,
    Thank you very much for your suggestions.. but still have some more doubts:
    What i want to do is :
    -->call report in background job with a selection criteria.
    -->the output of the report should be trasnsfered to excel sheet
    -->then the excel sheet should be sent to XI..
    My doubts are:
    -> is it possible with every report or we need some extra code to achieve this
    -> If yes, then how exactly it should be done. can you please explain in more detail.
    Thank you very much for your help.
    Best Regards,
    Jasmeet

  • How to determine the length of a LRAW field

    Hi
    I'm trying to write a generic persistency class that saves data in a table with a lraw field.
    As required the lraw field must be preceded by a length field of type INT2, but how can I calculate the actual length of the lraw field?
    kind regards Thomas

    Hi Martin
    I'm sorry to tell you that you are wrong. The INT2 field must contain the actual length.
    I have a table with a LRAW of 1024 bytes, but if I put 15 to the length field, then only 15 bytes are stored in the database.
    Of course I could just enter 1024 for the length, but that would wast a lot of database space - and performance.
    My class has a persistency method that inserts or updates a record in the database. The data that should be stored in the LRAW is sent to the method via a pointer (field symbol) of type X. This pointer can point at any data type.
    Something like this:
    field-symbols: <input> type x.
    field-symbols: <lraw> type x.
    *assign any field to <input>
    assign <lraw> to mydbtable-lraw_field casting.
    <lraw> = <input>.
    *here i need to determine the length of mydbtable-lraw_field before i store the content to the database.
    By debugging I can tell that if the pointer points to a char 32 field then the length of the X pointer is 64 and if the pointer points to a timestamp then the length of the x pointer is 8, but how can I determine this length programmatically - either from the x pointer or from the LRAW?
    Best regards
    Thomas

  • How to define cells/columns for export/re-import to another app

    I want to export a basic contact list to then import into another program (it's an email program, doesn't matter). It's a basic table with 3 columns: first name, last name, email address. How do you define the columns/cells so when importing in another app it knows what is what. Want to export as a tab-delimited or comma-delimited text file.
    thx.

    Christopher,
    It's hard to say what that un-named other app might require for field identification, but your best bet is to have the field titles in a Header Row.
    To produce a comma-delimited text file, assure that your data table is the only thing in your document. Isolating the data in this way will prevent complications. Then, File > Export > CSV.
    To produce a tab-delimited text file, Select and Edit > Copy the table in Numbers and then Edit > Paste and Match Style in a Pages doc. Save the Pages doc.
    Regards,
    Jerry

  • Export failure due to column length in DRM 11.1.2.1

    Hi All,
    We have migrated recently from 11.1.1.43 to 11.1.2.1 and the issue is with one of the exports
    In the earlier version you have the option of manipulating the column length inspite of the actual length set in the table column. This can be edited in the column options when the table is selected at the last option of export.
    Now the issue is i could see the length of the column in the 11.1.2.1 export option but i was unable to edit that length and reduce it to the required
    Viz., i have the column length of 80 set in the table and in the export it is restricted to 50 in the old version. Now i'm unable to edit this in 11.1.2.1
    Could anyone help me on this? I believe i may be missing some basics here
    Thanks

    In the earlier versions by default every property length is treated as 50 Characters while we export the data from DRM,
    Now in the new version we need to alter the table before we export based on the property length,
    Thanks,
    Murali

  • How to adjust column length in function REUSE_ALV_GRID_DISPLAY

    Hi,
    I am using this function REUSE_ALV_GRID_DISPLAY to display .Please tell how to adjust the column length in  this function, so that it is set to default field name size.
    thanks

    Hi anu,
    The column width can be adjusted by using the following method:
    -> define layout of the type.
                data: it_layout type slis_layout_alv.
    -> call the reuse alv... by using the is_layout field name with the above defined variable.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
        I_CALLBACK_PROGRAM                =  <program that calls reuse>
        I_CALLBACK_PF_STATUS_SET          = < form to set pf-status>
        I_CALLBACK_USER_COMMAND           = <form to catch user command>
        I_STRUCTURE_NAME                  = < structure to be passed>
        I_GRID_TITLE            = < any title to appear on top of the grid display>
        IS_LAYOUT                         = it_layout
        IT_FIELDCAT                       = IT_FIELDCAT[]
        IT_EVENTS                         =
        IT_EVENT_EXIT                     = I_EVENT_EXIT  < to capture exit event>
      I_SCREEN_START_COLUMN             = 0 <screen settings>
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
       TABLES
        T_OUTTAB                          = IT_INACT_OBJ
       EXCEPTIONS
        PROGRAM_ERROR                     = 1
        OTHERS                            = 2
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                 
    -> write a form to set the layout of the grid...
    *&      Form  build_layout
          text
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    Set layout field for row attributes(i.e. color)
      gd_layout-info_fieldname =      'LINE_COLOR'.
    gd_layout-totals_only        = 'X'.
    gd_layout-f2code            = 'DISP'.  "Sets fcode for double click or "click(press f2)
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text       = 'helllllo'.
    endform.                    " build_layout
    endform.   
    This will optimize the output of the grid display.
    Hope this helps!!!
    Revert if any queries!!!
    regards,
    Naveenan.

  • Weird csv import behaviour...

    Hi guys!
    I was wondering if any of you encountered a werid csv import behaviour:
    If the csv file I'd like to import has columns shortened...I mean sometimes you have to click twice on a column to see its full content..and I'm talking about the situation where you don't see it in a full spectrum. Then if im trying to import it I receive an error...if immediately after that I click twice on every column of that csv file...the import works fine...
    Any ideas?
    With regards,
    PsmakR

    Hi guys!
    I was wondering if any of you encountered a werid csv import behaviour:
    If the csv file I'd like to import has columns shortened...I mean sometimes you have to click twice on a column to see its full content..and I'm talking about the situation where you don't see it in a full spectrum. Then if im trying to import it I receive an error...if immediately after that I click twice on every column of that csv file...the import works fine...
    Any ideas?
    With regards,
    PsmakR

  • Re: [iPlanet-JATO] Finding the database column length

    This is the technique I would recommend. If you'd like to wrap this
    mechanism up in the model class itself, create a subclass of QueryModelBase
    that provides such a method and use that as the base class for all your
    QueryModels.
    Todd
    ----- Original Message -----
    From: "Craig V. Conover" <craig.conover@S...>
    Sent: Friday, October 19, 2001 12:15 PM
    Subject: Re: [iPlanet-JATO] Finding the database column length
    Chidu,
    The result set that you get back is a JDBC ResultSet, not a "JATO" resultset. In ND, everything was wrapped in a "spider" data
    structure, and therefore, difficult to get to the underlying datastructure, in many cases. In some case ND made it easier to do
    certain things, and in other ways, made it more difficult or impossible(like seeing the SQL for an insert, update, delete).
    >
    Anyway, looking at the java.sql package, you can do this.
    java.sql.ResultSet rs = <jata-model>.getResultSet();
    java.sql.ResultSetMetaData rsMeta = rs.getMetaData();
    // not sure if this is what you need, but it was the closest thing I couldfind
    int colSize = rsMeta.getColumnDisplaySize(int column);
    There are numerous other methods in the ResultSetMetaData interface thatmay be of use as well.
    >
    c
    chidusv@y... wrote:
    Hi,
    How do I find out the length of a database column in a data model? In
    NetDynamics, we can do dataobject.getDataField(<field
    name>).getColumnLength(). Is it possible to achieve this in JATO
    without using a resultset?
    Thanks,
    Chidu.
    For more information about JATO, please visit
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    >>
    >>
    >>
    >>
    >
    >
    >
    For more information about JATO, please visit
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    >
    >
    >
    >
    >
    >
    >

    This is the technique I would recommend. If you'd like to wrap this
    mechanism up in the model class itself, create a subclass of QueryModelBase
    that provides such a method and use that as the base class for all your
    QueryModels.
    Todd
    ----- Original Message -----
    From: "Craig V. Conover" <craig.conover@S...>
    Sent: Friday, October 19, 2001 12:15 PM
    Subject: Re: [iPlanet-JATO] Finding the database column length
    Chidu,
    The result set that you get back is a JDBC ResultSet, not a "JATO" resultset. In ND, everything was wrapped in a "spider" data
    structure, and therefore, difficult to get to the underlying datastructure, in many cases. In some case ND made it easier to do
    certain things, and in other ways, made it more difficult or impossible(like seeing the SQL for an insert, update, delete).
    >
    Anyway, looking at the java.sql package, you can do this.
    java.sql.ResultSet rs = <jata-model>.getResultSet();
    java.sql.ResultSetMetaData rsMeta = rs.getMetaData();
    // not sure if this is what you need, but it was the closest thing I couldfind
    int colSize = rsMeta.getColumnDisplaySize(int column);
    There are numerous other methods in the ResultSetMetaData interface thatmay be of use as well.
    >
    c
    chidusv@y... wrote:
    Hi,
    How do I find out the length of a database column in a data model? In
    NetDynamics, we can do dataobject.getDataField(<field
    name>).getColumnLength(). Is it possible to achieve this in JATO
    without using a resultset?
    Thanks,
    Chidu.
    For more information about JATO, please visit
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    >>
    >>
    >>
    >>
    >
    >
    >
    For more information about JATO, please visit
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    >
    >
    >
    >
    >
    >
    >

  • Need help in modifying the column length

    Hi Experts,
    I need to modify the length of a column from char(10) to char(5), but it's showing the error of:
    ALTER TABLE appr_group_table MODIFY (APPR_TBLNO CHAR(5)) It's showing the below error:
    ERROR at line 1:
    ORA-01441: cannot decrease column length because some value is too bigI've checked in the dbase but there is no any value of this column having more than 5 characters:
    SQL> SELECT APPR_TBLNO FROM appr_group_table;
    APPR_TBLNO
    ANTAB
    ANTAB
    ANTST
    SCCTR
    SOTAB
    SOTAB
    SOTAB
    SOTAB
    SOTAB
    SOTAB
    SOTAB
    11 rows selected.Thnx in advance for helping me out.....

    char means fixed length variable. when you say char(10) oracle will reserve 10 places for your data. that means in your output what you are seeing as blank spaces are also considered as data. that is the reason, it is not allowing you to reduce the size.
    better solution is to create new column with varchar2 or char(5) datatype and transfer this column data into new column and then drop original column.

  • Set the column length in an sql query

    Hi,
    Is there a way to set the column length in a query without using sqlplus commands like row size and format column.
    I'd like to do it just from the sql query itself.
    select 'this is a test' from dual; Can I define the width of this column in the select statement
    Cheers.

    Use RPAD,
    SQL> WITH T
      2       AS (SELECT 'this is test' str FROM DUAL
      3           UNION ALL
      4           SELECT 'this is a long test' FROM DUAL
      5           UNION ALL
      6           SELECT 'this is a long long long long test' FROM DUAL)
      7  SELECT RPAD ( str, 20) str,LENGTH( RPAD ( str, 20)) len
      8    FROM T;
    STR                         LEN
    this is test                 20
    this is a long test          20
    this is a long long          20
    SQL> G.

  • SQL*Loader - How to load only a few columns from a .csv file to ora table

    Hi there,
    Could anyone please let me know how to load few columns from a .csv
    file into a oracle table using SQL*Loader.
    I know how to create a .dat and .ctl file and run the sql loader.
    Suppose I have a .csv file with
    col1, col2, col3, col4
    and I only need to load col1 and col3 into col_a and col_b respectively
    in table_a?
    structure of table_ a
    col_a,
    col_b
    Please advice

    Try like..it i will work..
    LOAD DATA
    INFILE 'test.txt'
    LOAD DATA
    TRUNCATE INTO TABLE T1
    FIELDS TERMINATED BY ','
    (col1,
    col2 FILLER,
    col3,
    col4 FILLER
    )

  • Writing ouput to the next column in a .csv file

    I am Writing to .CSV file with PL/SQL code:
    CREATE OR REPLACE PROCEDURE Write_File(p_name IN VARCHAR)
    AS
    BEGIN
    DECLARE
    CURSOR emp_sel IS SELECT ename,hiredate FROM EMP;
    file_name VARCHAR2(20);
    output_file utl_file.file_type;
    BEGIN
    file_name:= (p_name||'.csv');
    output_file:=utl_file.fopen('d:\test_dir',p_name||'.csv','W');
    FOR i IN emp_sel LOOP
    utl_file.put_line(output_file,'NAME:'||i.ename);
    utl_file.put_line(output_file,'hire Date:'||i.hiredate);
    END LOOP;
    utl_file.fclose(output_file);
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line(SQLCODE||SQLERRM);
    END;
    END;
    Just wanted to know how Move to the next Column in the .csv file.
    at present the ename and hiredate r written in the 1st Column C1 column.
    I want to write the hiredate data in C2 column.
    how to?

    user545846,
    I answered you in the other thread:
    Re: Calling utl_file package from a java program
    Good Luck,
    Avi.

Maybe you are looking for

  • Applying different template to the same item for different organizations

    Hi I'm having an issue with an item load. We are trying to load a list of items using the item import. 3 orgs 1: mas 2: first 3: second say in the new list that we are importing there is an item "100A" (mtl_system_items_b.segment1) This item already

  • OS Lion: Can't drag attachments into Mail message, Can't drag files into Trash

    Dragging an attachment into a Mail causes a crash adn I have to force quit. I can attach files via the menu, but keep forgetting and have to keep force quitting. Also (probably not connected), I can't move files into the Trash... Just get a Moving "x

  • Java doesn't seem to work with anything anymore...

    About 4 months ago, something strange started happening with Java...nothing that needs java works. (i.e. Yahoo Games, Pogo Games, trend micro house call, etc) I've contacted the support people for those websites as well as the sun people. All gave me

  • HD 4:3 without letterbox

    I have a canon hv20 camcorder that only records HD video in 16:9.I was wondering if there was any way I could convert those 16:9 files to 4:3 without letterbox and without warping the image,in other words to zoom in to the center thus eliminating the

  • F8 thru F10 shorcuts not working on Microsoft Keyboard

    Hi all, I got and installed the Microsoft Intellitype Software. It says next to the F1 thru F12 that they are handled by Mac OS X. BUT when i try to use F9, for example, my windows don't all show.. I am not completely sure what to do on this one. I h