TopLink JPA - trailing spaces on Char column

Gurus,
In JDBC you use the following to ignore trailing spaces when querying on Char column:
OracleConnection conn = (OracleConnection) c;
conn.setDefaultFixedString(true);
How to achieve this using TopLink JPA?
Thanks much,
Nicky

Nicky,
I believe you would need to do this in API. Ideally setting these configurations on the properties of the JDBC connection pool is easier but if you wish to do it with TopLink Essentials I would use a session event listener's postAcquireConnection to customize it.
In the persistence.xml you will need to configure your persistence unit to use a session customer like:
        <property name="toplink.session.customizer" value = "mypackage.JDBCConnectionConfig"/>Then you will need to implement this customizer and include it on the classpath of your application:
public class JDBCConnectionConfig implements SessionCustomizer {
    public void customize(Session session) {
        session.getEventManager().addListener(new JDBCConfigEventListener());   
    class JDBCConfigEventListener extends SessionEventAdapter {
        public void postAcquireConnection(SessionEvent event) {
            Connection conn = ((DatabaseAccessor) event.getResult()).getConnection();
            OracleConnection oconn = (OracleConnection) conn;
            oconn.setDefaultFixedString(true);
Note: I did not see setDefaultFixedString in the most recent version of the Oracle JDBC driver
I would definitely look into configuring your data source's connection pool with this property enabled before adding this event listener.
Doug

Similar Messages

  • How to identify the trailing spaces in a column

    Hi,
    How to identify the trailing spaces in a column.
    for ex: empno char(5) and i enter 333 then there will be 2 spaces remaining. How to identify that two spaces

    One method...
    ME_XE?create table test1 (some_char char(5));
    Table created.
    Elapsed: 00:00:00.11
    ME_XE?
    ME_XE?insert into test1 values ('HI');
    1 row created.
    Elapsed: 00:00:00.07
    ME_XE?insert into test1 values ('HI HO');
    1 row created.
    Elapsed: 00:00:00.07
    ME_XE?select * from test1 where trim(some_char) <> some_char;
    SOME_CHAR
    HI
    1 row selected.
    Elapsed: 00:00:00.14
    [pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Toplink JPA forces database table and column names to UPPERCASE! Why?

    I have recently experienced using Toplink JPA while using glassfish ... migrating an existing application to EJB 3.0 persistence. Toplink JPA, as implemented in glassfish, forces tablenames and column names from my code to be uppercase in select statements, etc. as then submitted to the database. Why? I cannot find anything in the EJB 3.0 specs on persistence that even suggests this.
    This created a serious problem for me, in my application. For my code to work I had to change the names of the database tables to all uppercase, even though that meant other of my applications, already written using the original mixed case names of the databases, will no longer work unless I revise the code in those applications! (I am using mySQL as my database.)
    In both Unix/Linux and Java, which are both case sensitive, If I wanted names of files or other items to be uppercase, I would have written them that way. I do not expect some middleware piece of software to muck around with the case of text I have put into my code.
    I am hopeful this 'feature' of the reference implementation of the EJB Persistence API will be corrected in a subsequent version. [Maybe you can tell I am not happy!]
    Thanks for listening to my rant.

    Robert,
    I found that the name I specify in all of my @Table, @Column, ... annotations is used with the case as it is provided.
    If TopLink determines the schema information through defaults then the names it comes up with are definitely upper cased by default.
    Are you specifying the schema information that you want in annotations or XML?
    Doug

  • Trailing space in char field

    Hello there,
    I am a BW developer and I am currently having an issue with trailing spaces in an ABAP routine.
    This is the situation (example... In real life I use larger char fields):
    - From a source I get a text line that is let's say max. 60 characters long.
    - In BW I split this line into 3 parts and save those in the short text fields of 3 different InfoObjects. Short text is defined as CHAR 20.
    - Later on I can display the text line I just split up as one line of text again. I need to do this because BW can only store texts with acertain length.
    - Now it is possible that the text line I get has a blank at position 20. I need to keep this blank in the first of my 3 parts. But since it is a character field, the blank is ignored and only the first 19 characters are saved.
    Question:
    How can I manage to save all first 20 characters in the first of the three CHAR 20 fields, including any trailing blanks?
    The fields have to be defined as CHAR because that is the definition of text fields in BW. (data type RSTXTSH, to be exact)
    Example:
    Incoming text line (Notice, the character at position 20 is a blank):
    "blabla1111blabla111 blabla2222blabla2222blabla3333blabla3333"
    After splitting it into three parts, I get this:
    Part 1: "blabla1111blabla111" (no trailing blank)
    Part 2: "blabla2222blabla2222"
    Part 3: "blabla3333blabla3333"
    What I need is this:
    Part 1: "blabla1111blabla111 " (with trailing blank)
    Part 2: "blabla2222blabla2222"
    Part 3: "blabla3333blabla3333"
    Any help will be greatly appreciated
    Thanks and regards,
    Stefan

    Hi Stefan,
    As Stefan Seeburger already said you can use RESPECTING BLANKS to get that.
    DATA: i_input TYPE c LENGTH 60,
           e_part1 TYPE c LENGTH 20,
           e_part2 TYPE c LENGTH 20,
           e_part3 TYPE c LENGTH 20,
           v_space   TYPE c LENGTH 1,
           e_partfull TYPE c LENGTH 60.
    i_input = 'blabla1111blabla111 blabla2222blabla2222blabla3333blabla3333'.
    SPLIT i_input AT v_space INTO: e_part1 e_part2 e_part3.
    e_part1 = i_input(20).
    e_part2 = i_input+20(20).
    e_part3 = i_input+40(20).
    DATA: lv_length TYPE i.
    lv_length = STRLEN( e_part1 ).
    CONCATENATE e_part1 e_part2 e_part3 INTO e_partfull RESPECTING BLANKS.
    DATA: lv_length2 TYPE i.
    lv_length2 = STRLEN( e_partfull ).
    BREAK-POINT.
    Cheers!

  • How to join to a column contains trailing spaces

    I am trying to do a Left Outer Join between the above 2 tables.
    select a.name, a.address, a.city, a.state, a.zip, nvl(b.zip_id,0) as zip_id
    from t1 a, t2 b
    where a.zip = b.zip(+)
    The problem is that t2.zip is of 9 character size values with 5 digit zip code and 4 trailing spaces where as t1.zip is just 5 characters. Could any one advice me
    on how to make this Join?
    Thanks in advance.

    Thanks for all your replies. The query work fine if it is an inner join. But when I try it as a left outer join it says missing expression.
    select a.zip, b.zip, trim(zip_id) as zip_id
    from t1 a, t2 b
    where a.zip = substr(b.zip, 1, 5)(+)
    create table t1 (zip varchar2(9));
    insert into t1 values('17602');
    insert into t1 values('20879');
    insert into t1 values('21048');
    insert into t1 values('21074');
    insert into t1 values('21157');
    insert into t1 values('21158');
    insert into t1 values('21227');
    insert into t1 values('21228');
    insert into t1 values('21776');
    insert into t1 values('21787');
    insert into t1 values('21791');
    insert into t1 values('21797');
    create table t2 (zip varchar2(9), zip_id varhcar2(9));
    insert into t2 values('21048 ','8813');
    insert into t2 values('21074 ','8827');
    insert into t2 values('17602 ','7193');
    insert into t2 values('21150 ','8864');
    insert into t2 values('21152 ','8865');
    insert into t2 values('21153 ','8866');
    insert into t2 values('21154 ','8867');
    insert into t2 values('21155 ','8868');
    insert into t2 values('21156 ','8869');
    insert into t2 values('21157 ','8870');
    insert into t2 values('21158 ','8871');

  • String with Trailing Space in a 4.7 / Basis 620 system

    Hi
    My customer is using SAP 4.7(Enterprise Management Version) / SAP BASIS Release 6.20 (Kernel 640).
    We have a requirement to print a product label using a 2D Datamatrix barcode following HIBC standards.  We are using a custom development object (Z function module) that builds the barcode string (variable length string) using a Mod43 calculated check digit as the last character of the string.  One of the valid check digits is a "space" character as the last character of this barcode string.
    Everything in our solution is working fine, except for the situation of the "space" check digit character at the end.  We are running into an ABAP syntax limitation when we are trying to concatenate the calculated check digit onto the barcode string.
    For example, we have a barcode value "+M53210250 " (within the quotes).  This string ends with a SPACE character at the end.  We are calculating the barcode value (some fixed elements + SAP material number, batch, etc.), then calculating the check digit, and concatenating the check digit onto the end of the initial barcode string value.
    I have tried this in a higher version system and am able to make it work by using the statement CONCATENATE RESPECTING BLANKS.  This syntax is not available with WebAS 620 however.
    Here are the attempts we have made:
    *Get HIBC 2D Barcode String
      CONCATENATE E_HIBC_2D_BC L_CHECK_DIGIT INTO E_HIBC_2D_BC.
    IF L_CHECK_DIGIT = SPACE.
    The following attempts does not work
    CONCATENATE with SPACE at end
    Concatenate HIBC SPACE and a dummy variable like 'TEST' into HIBC builds a space in between the dummy and HIBC
    and then when i split it the space is lost again.
    Insert SPACE in the beginning bulding a new variable with 0(1) space followed by HIBC and then SHIFT CIRCULAR BY 1 place
    It will work only if moved to a variable of length which is exactly HIBC + 1 char in length then by default the last char is SPACE.
    Use a replacement variable which is not a HIBC Check Digit like # & ! ? ^ or other for SPACE
    ECC 5.0 and HIGHER
    *CONCATENATE {dobj1 dobj2 ...}|{LINES OF itab}
               INTO result
               [IN {BYTE|CHARACTER} MODE]
               [SEPARATED BY sep]
               [RESPECTING BLANKS].
    *4.7 Version *
    *CONCATENATE f1 ... fn INTO g.
    *1. ... SEPARATED BY h
    *2. ... IN BYTE MODE
    *3. ... IN CHARACTER MODE
    Having the customer upgrade to ECC 5.0 is not feasible to solve this.
    If anyone has any alternative ideas on how to manage this variable length string and respect the trailing space, I would appreciate it.
    I have searched the forums but the only solutions that are close deal with outputting to a file during a download or FTP, or else mention the newer syntax of CONCATENTATE with the option RESPECTING BLANKS, but that is not available in this release.

    If you could predict how long the string is (assuming you might determine whether the last element length is shorter than the db length), you could try to insert your check digit based upon fieldname+your_calculated_length(1) = checkdigit.
    for example if batch is 3 cahr and you have '50' in the data, you could calculate as lv_len = strlen( the value ) .
    lv_len = lv_len + 1.
    move checkdigit to barcodefield+lv_len(1).
    Perhaps something like this would allow you to work around.  At any rate, if you can figure out if there's supposed to be one or ?? blanks on the end, specifying the position by +offset(columns) should do the trick, instead of the concatenate.

  • Trailing spaces problem with OracleDataAdapter

    Hi,
    I have a char(60) column in the database which i cant change to nvarchar. I am using a ref cursor with the ODP.NET dataadapter to populate the dataset. The dataset has defined this column as a string. When I fill the dataset, the data for this column contains trailing spaces (to make it 60 characters).
    Situation: Stored Procedure returns a ref cursor that is used to fill the dataset using a dataadapter
    Problem: Trailing spaces in all char columns
    Attempts:
    1) Returning Trim(column_name) from the SP. This time the dataset column gets null values. Doesn't the trim work with the dataadapter.
    2) Tried returning length(trim(column_name)) from the SP. The dataset got all 0 values
    3) Tried returning length(column_name) from the SP. Returns 60 because the column is char(60)
    Any idea what is going on? Is this a bug? Is there a solution ?
    Thanks
    Nishith

    Got it !!! :D
    My query in the SP was SELECT TRIM(column_name) ... so it was trying to populate it into the "TRIM(column_name)" column of the dataset which is not there ... no have changed it to SELECT TRIM(column_name) as column_name ... works :)
    But is there an easier way ?
    Nishith

  • Inserting blanks into a NOT NULL CHAR column

    How do you insert a value of blank/spaces into a NOT NULL CHAR column. Oracle 9i interprets the space as a NULL and the insert fails because the column does not allow NULLS. Thanks in advance.

    Hi,
    19:07:13 topgun>create table t1(c1 varchar2(10) not null);
    Table created.
    19:07:33 topgun>insert into t1 values (' ');
    1 row created.
    19:07:42 topgun>select * from t1;
    C1
    19:07:46 topgun>select count(*) from t1;
      COUNT(*)
             1
    19:07:53 topgun>select * from V$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for Linux: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production- Pavan Kumar N

  • Trailing spaces in env-entry-type elements

    Hi,
    We have been porting our EJB application from another app server over to Oracle iAS (9.0.3 Lite) and have encountered a rather frustrating problem.
    We have an CMP (2.x) entity bean that has ejbSelect methods. There are corresponding <query> blocks in the ejb-jar.xml file for these methods. In the same ejb-jar.xml file there are <env-entry> blocks that setup a few things that are needed by the bean.
    If the <env-entry-type> element is written as "<env-entry-type>java.lang.String </env-entry-type>" (note the trailing space after the type name) the following exception occurs during deployment of the ear file;
    java.lang.InstantiationException: Failure to initialize EJBQL descriptors: com.sun.enterprise.deployment.xml.ContentTransformationException: java.lang.String is not an allowed property value type
         at com.evermind.server.ejb.deployment.EJBPackage.initializeEjbqlDescriptors(EJBPackage.java:2075)
         at com.evermind.server.ejb.deployment.EJBPackage.init(EJBPackage.java:2054)
         at com.evermind.server.ServerComponent.init(ServerComponent.java:208)
         at com.evermind.server.ejb.EJBPackageDeployment.getPackage(EJBPackageDeployment.java:672)
         at com.evermind.server.administration.ServerApplicationInstallation.finish(ServerApplicationInstallation.java:547)
         at com.evermind.server.administration.ServerApplicationInstallation.deploy(ServerApplicationInstallation.java:913)
         at com.evermind.server.administration.DefaultApplicationServerAdministrator.deploy(DefaultApplicationServerAdministrator.java:337)
         at java.lang.reflect.Method.invoke(Native Method)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:119)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:479)
    Error during deployment: Failure to initialize EJBQL descriptors: com.sun.enterprise.deployment.xml.ContentTransformationException: java.lang.String is not an allowed property value type
    Removing the trailing space and the deployment proceeds to completion without exceptions.
    I should also add that if the ejbSelect methods are remove d from the application and the trailing space left in place the resulting ear file will deploy sucessfully.
    It is trivial to reproduce this problem with the ORMAP demo that ships with 9.0.3.
    This was a really subtle problem that is not present on the *3* other appserver implementations that our application runs on. It was very frustrating to locate and perhaps some consideration could be given to how PCDATA is handled when parsing <env-entry-type> blocks.
    Cheers,
    Mick.

    Hi ,
    Create two Characteristic InfoObjects in BW With length 60 Char  and then in the Transfer Rules of this two InfoObjects write the Formula using Left() and right() function present in the Formula Builder .
    That is First infoObject Contains the Left 60 Char and next one Contains the right 60 Char.
    Regards,
    Vijay.

  • Gui_download issue - trailing spaces getting truncated for fixed length fil

    Hi All,
    I have a requirement where I need to download an internal table as a fixed length file.
    The code is as follows:
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE =
    FILENAME = L_FILE
    FILETYPE = 'ASC'
    APPEND = 'X'
    WRITE_FIELD_SEPARATOR = ' '
    HEADER = '00'
    TRUNC_TRAILING_BLANKS = ' '
    WRITE_LF = ' '
    COL_SELECT = ' '
    COL_SELECT_MASK = ' '
    DAT_MODE = ' '
    IMPORTING
    FILELENGTH =
    TABLES
    DATA_TAB = IT_TEXT
    EXCEPTIONS
    FILE_WRITE_ERROR = 1
    NO_BATCH = 2
    GUI_REFUSE_FILETRANSFER = 3
    INVALID_TYPE = 4
    NO_AUTHORITY = 5
    UNKNOWN_ERROR = 6
    HEADER_NOT_ALLOWED = 7
    Each row in the internal table IT_TEXT is 242 chars long.
    The FM is truncatinf the trailing blanks on the file. How do I get the FM to not truncate the trailing blanks in each row?
    My internal table has multiple rows and the number of rows on the table should be same as the number of rows on the downloaded file.
    I tried setting the WRITE_LF parameter to space.
    In this case, the trailing spaces are not truncated(which is as per my requirement), BUT all the rows in the internal table appear in a single line on the downloaded file instead of multiple rows.
    I also tried setting the TRUNC_TRAILING_BLANKS field to space but that does not work either. Spaces at the end of the row are still truncated.
    so the requirement is: the spaces at the end of each row should not be truncated and
    each row on the internal table should have a corresponding row on the downloaded file.
    (it is a fixed length file)
    I also tried using the following code
    class cl_abap_char_utilities definition load.
    DATA: BEGIN OF IT_TEXT OCCURS 0,
           TEXT(242) TYPE C,
           cr_lf TYPE c VALUE cl_abap_char_utilities=>cr_lf,
          END OF IT_TEXT.
    when i compile, i get the following error
    The type "CL_ABAP_CHAR_UTILITIES" is unknown.     
    Im using R/3 4.6C. Could this be a problem?     
    Please suggest a solution for this problem.
    Thanks!
    Sandeep
    Edited by: sandeep reddy on Jul 25, 2008 7:16 PM

    Hi,
    Try this..This worked..Add a dummy character at the end of the internal table...Then pass trunc_trailing_blanks   = ' '...
    PARAMETERS: p_file TYPE rlgrap-filename
                DEFAULT 'c:\test_download.txt'.
    DATA: BEGIN OF s_data,
            data TYPE char10,
            dummy,      " Added this.
          END OF s_data.
    DATA: t_data LIKE TABLE OF s_data.
    s_data-data = 'Test'.
    APPEND s_data TO t_data.
    s_data-data = 'Test2'.
    APPEND s_data TO t_data.
    s_data-data = 'Test3'.
    APPEND s_data TO t_data.
    s_data-data = 'Test4'.
    APPEND s_data TO t_data.
    * Download.
    DATA: v_file TYPE string.
    v_file = p_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = v_file
        trunc_trailing_blanks   = ' '
      TABLES
        data_tab                = t_data
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        OTHERS                  = 22.
    Thanks
    Naren

  • How to remove trailing spaces in SQL PLUS spool

    Hi,
    I've requirement to pull data from tables and I'm using sqlplus spool to automate data fetch from various tables:
    I'm using the following script for the same :
    set echo off
    set feedback off
    set pagesize 0
    set linesize 2000
    set heading on
    set trimspool on
    Spool table1.TXT;
    prompt col1|col2|col3|col4|col5
    select
    LTRIM(RTRIM(col1))||'|'||
    LTRIM(RTRIM(col2)) ||'|'||
    LTRIM(RTRIM(col3)) ||'|'||
    LTRIM(RTRIM(col4)) ||'|'||
    LTRIM(RTRIM(col5)) ||'|'||
    from TABLE1 ;
    spool off
    After using trimspool on option also I'm having trailing spaces issue how to fix it?
    Thanks,
    Mahender.
    Edited by: user518071 on Oct 11, 2010 1:05 PM

    Hi,
    do you need LTRIM/RTRIM? This is namely your problem. By using a function around your column Oracle reserves the maximum lenght for the column. So what do you get without those functions? Furthermore you are concatenating all the columns. This is also a function. For getting '|' in between columns you can also set a seperator by using
    set colsep '|'Herald ten Dam
    http://htendam.wordpress.com

  • Querying CHAR columns with character length semantics unreliable

    Hi again,
    It appears that there is a bug in the JDBC drivers whereby it is highly unlikely that the values of CHAR columns that use character length semantics can be accurately queried using ResultSet.getString(). Instead, the drivers return the value padded with space (0x#20) characters out to a number of bytes equal to the number of characters multiplied by 4. The number of bytes varies depending on the number and size of any non-ascii characters stored in the column.
    For instance, if I have a CHAR(1) column, a value of 'a' will return 'a ' (4 characters/bytes are returned), a value of '\u00E0' will return '\u00E0 ' (3 characters / 4 bytes), and a value of '\uE000' will return '\uE000 ' (2 characters / 4 bytes).
    I'm currently using version 9.2.0.3 of the standalone drivers (ojdbc.jar) with JDK 1.4.1_04 on Redhat Linux 9, connecting to Oracle 9.2.0.2.0 running on Solaris.
    The following sample code can be used to demonstrate the problem (where the DDL at the top of the file must be executed first):
    import java.sql.*;
    import java.util.*;
    This sample generates another bug in the Oracle JDBC drivers where it is not
    possible to query the values of CHAR columns that use character length semantics
    and are NOT full of non-ascii characters. The inclusion of the VARCHAR2 column
    is just a control.
    CREATE TABLE TMP2
    TMP_ID NUMBER(10) NOT NULL PRIMARY KEY,
    TMP_CHAR CHAR(10 CHAR),
    TMP_VCHAR VARCHAR2(10 CHAR)
    public class ClsCharSelection
    private static String createString(char character, int length)
    char characters[] = new char[length];
    Arrays.fill(characters, character);
    return new String(characters);
    } // private static String createString(char, int)
    private static void insertRow(PreparedStatement ps,
    int key, char character)
    throws SQLException
    ps.setInt(1, key);
    ps.setString(2, createString(character, 10));
    ps.setString(3, createString(character, 10));
    ps.executeUpdate();
    } // private static String insertRow(PreparedStatement, int, char)
    private static void analyseResults(PreparedStatement ps, int key)
    throws SQLException
    ps.setInt(1, key);
    ResultSet results = ps.executeQuery();
    results.next();
    String tmpChar = results.getString(1);
    String tmpVChar = results.getString(2);
    System.out.println(key + ", " + tmpChar.length() + ", '" + tmpChar + "'");
    System.out.println(key + ", " + tmpVChar.length() + ", '" + tmpVChar + "'");
    results.close();
    } // private static void analyseResults(PreparedStatement, int)
    public static void main(String argv[])
    throws Exception
    Driver driver = (Driver)Class.forName(
    "oracle.jdbc.driver.OracleDriver").newInstance();
    DriverManager.registerDriver(driver);
    Connection connection = DriverManager.getConnection(
    argv[0], argv[1], argv[2]);
    PreparedStatement ps = null;
    try
    ps = connection.prepareStatement(
    "DELETE FROM tmp2");
    ps.executeUpdate();
    ps.close();
    ps = connection.prepareStatement(
    "INSERT INTO tmp2 ( tmp_id, tmp_char, tmp_vchar " +
    ") VALUES ( ?, ?, ? )");
    insertRow(ps, 1, 'a');
    insertRow(ps, 2, '\u00E0');
    insertRow(ps, 3, '\uE000');
    ps.close();
    ps = connection.prepareStatement(
    "SELECT tmp_char, tmp_vchar FROM tmp2 WHERE tmp_id = ?");
    analyseResults(ps, 1);
    analyseResults(ps, 2);
    analyseResults(ps, 3);
    ps.close();
    connection.commit();
    catch (SQLException e)
    e.printStackTrace();
    connection.close();
    } // public static void main(String[])
    } // public class ClsColumnInsertion

    FYI, this has been mentioned as early as November last year:
    String with length 1 became 4 when nls_lang_semantics=CHAR
    and was also brought up in Feburary:
    JDBC thin driver pads CHAR col to byte size when NLS_LENGTH_SEMANTICS=CHAR

  • Toplink JPA and handle to a sequence

    Hi All,
    I am trying to figure out a way to get a handle to an Oracle sequence and use it from the java application i.e. run operations like currval/nextval.
    The reason I need this flexibility is to refer 2 sequences from the java app and apply it on a single table. Currently the table i am trying to insert already has a sequence which is a primary key generator. We do refer it in our JPA annotations and this works fine.
    But there was a need where another column (not part of Primary key) also needs its values from a different sequence.
    When we try to refer it from Toplink JPA it does not allow and errors stating cannot have 2 sequences mapping for a single table entity.
    Let me know your thoughts.
    Thanks

    You could use a native SQL query to get the nextval or curval from the Sequence.
    TopLink/EclipseLink should support an API for this, or allow multiple sequences per object, please vote for these bugs,
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=267701
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=320456
    James : http://www.eclipselink.org

  • 'SHIFT variable RIGHT deleting trailing space' not working

    I have a character field in a transaction that occasionally gets populated with a value that has a space at the end or at the beginning or both. This is causing the dataload to fail. I added code below to remove these spaces from the end and beginning-
    SHIFT <variable> RIGHT deleting TRAILING space.
    SHIFT <variable> LEFT deleting LEADING space.
    The SHIFT LEFT works perfectly and deletes the space at the begining of the value but SHIFT RIGHT does not delete the space at the end for some reason. I tried defining the variable as a char (16), string but nothing seems to make it work.
    Note: I cannot use CONDENSE because the value can have spaces in between that we cannot delete.
    Any ideas why shift right wouldn't work?

    Hi Maanasa,
                           First of all Shift works only with string datatype. So transfer the contents of that character field into a string datatype and do the shift operation.
    Declare a string variable of that type. Data v_str type string.
    Pass the contents of the character field into the string.
    And do the shift operation on the string and pass the value of the string back to the character field.
    Shift v_str by 1 places right.
    Please try this.
    Thanking you,
    Jerry

  • How to remove trailing space-sqlldr failed OCI-30951-exceeds max length

    sqlldr failed to load the xml into xdb ( table created through schema registration) because of the padded space in element 'Country' whose maximum length is defined as '3'…Is there any way to remove the extra trailing space using the control file or xdb annotation in the xsd? Thanks!
    <Address>
    <StreetAddress1>1 BRKSTONE SQ </StreetAddress1>
    <StreetAddress2>SUITE 5 </StreetAddress2>
    <City>ANDOVER </City>
    <State>MA</State>
    <Country>USA </Country>
    <ZipCode>01810</ZipCode>
    </Address>
    Here is the errors I got:
    kgepop: no error frame to pop to for error 30951
    OCI-30951: Element or attribute at Xpath /BranchRegulatoryFiling/Branches/Branch[1]/Address/Country exceeds maximum length
    Errors in file :
    OCI-30951: Element or attribute at Xpath /BranchRegulatoryFiling/Branches/Branch[1]/Address/Country exceeds maximum length
    ----- Call Stack Trace -----
    Bus Error (core dumped)
    Here is my ctl file:
    load data
    infile *
    into table xml_stg_tbl
    append
    reenable disabled_constraints exceptions cnstr_xcptn_tbl
    xmltype(XMLDATA)(
    lobfn filler char terminated by ',',
    XMLDATA lobfile(lobfn) terminated by EOF
    BEGINDATA
    /tmp/1025552.xml
    Edited by: user10954036 on Jul 27, 2009 8:12 AM

    Hi,
    Its good that u pasted the complete log file. In your environment you have to run this upgrade tool only once from any of the middle tier.
    And with respect to your error that u got in precheck is quite simple. All u have to do is just run this script from by connecting to portal schema using sqlplus.
    Run dropupg.sql
    Location-------- /raid/product/OraHome_1/upgrade/temp/portal/prechktmp/dropupg.sql
    Later you re-run the upgrade tool and let me know the status.
    Good luck
    Tanmai

Maybe you are looking for

  • Windows Firewall has a port open but when I do a port scan the port is closed

    Hello, I have a new door entry device that is being installed that has a internal IP address of say 192.168.200.12 that requires port 3001 to be open. The device is reachable via ping and is plugged into a HP Procurve 2910al switch that is connected

  • Three ZTE MF627 Dongle

    I upgraded to SL yesterday, and today picked up a Three ZTE MF627 Dongle, which I now discover is only compatible with Leopard up to 10.5.2 and so I can't install it! Any ideas as to how to overcome this, whether it is likely to be upgraded in the ne

  • Transferring files without copying

    What is the best way to transfer files to an EHD without leaving a copy behind?

  • Date field to be set blank--Urgent --Please help

    Hi All,    We are running on SRM 4.0(classic scenario).On the SC screen,there  is a  date field called "Required on".By default this field is getting populated with the system date.   Now my reqt is that when the SC screen appears,i want this date fi

  • How te move labeled objects to specific layers?

    I made in InDesign a product catalogue with EasyCatalog, works fine, but EasyCatalog puts all the items (graphics, text frames, price box, ) on one layer. Soon there will be translations on that document and so I want that all my graphics that are la