DB adapter - Trim spaces in column

Hi,
We are facing an issue while using DB adapter when retrieving data from a column (VARCHAR2).
Our column contains data like 'XXXX<spaces>XXX<spaces>'. Whenever we retrieve this column using Db adapter (both custom sql and Select option) and we are getting data with spaces trimmed.
For eg- Data is "1234 34456 3444". Db adapter retrieves this as 1234344563444.
We need the data to be retrieved as existing in the column.
Please let us know if anyone has seen this before, any inputs will be appreciated.
Regards,
ARPL

Hi,
I think it's very unlikely DbAdapter would remove spaces from the middle in a string... There's probably another problem associated...
If confirmed open a SR with Oracle Support.
Cheers,
Vlad

Similar Messages

  • How to provide space between columns in alv_grid_display?

    hi,
    gurus,
    I want to provide space between columns in alv display how can i achieve that.
    ex.
    sno   name   street    
    thank u ,
    shabeer ahmed.

    Hi..,
      There you wl get column seperators with seperate blocks and cells in the grid anyway.
    Maintain gap between columns is nothing but grid breaking, its may be possible with oops concept.
    Let me know whats your requirement?
    Thanks,
    Naveen.I

  • How to trim spaces from string in BMM layer?

    Hi friends,
    I need to trim spaces from the string. can you please give me syntax with example.
    Thanks

    Hi
    I have tried the below option , but it did not work . PS_D_PERSON
    PERSON_ID is char type in the data base oracle , and it is defined as varchar on the physical layer .
    So the table is loaded with space , i am not able to remove the space using trim both
    Thanks
    Sridhar.N

  • Removing spaces in column names

    Hi
    I have imported a number of tables from a legacy db. The column names in tables have spaces in them. Is there a script I can run to remove spaces from column names in all tables?
    Thanks
    Regards

    First of all, I do not agree with the concept of changing the column names. There is a good chance of breaking your code, if the table has been referred in procs/functions etc.
    One good method would be, import the tables from legacy db into staging and then insert into your actual tables by mapping the tables correctly where your actual table would not have the [space].[Here, I assume your procs/functions etc refer only your actual
    tables not staging tables].
    OR, if you are looking for a plain logic, then use the below:
    The below script wont execute the change, but just would give the statements to be executed to make the column modifications. This is intentional, because this is not a good practice and you can verify the objects and scripts rather than executing it directly.
    create table test_table([column test space] int)
    --select * From test_table
    --Script to do the change in column name
    select 'EXEC sp_rename '''+ B.name+'.'+a.name +''', '''+replace(a.name,' ','') +''', ''COLUMN''' from sys.columns A
    Inner join sys.tables B on A.object_id = B.object_id and OBJECTPROPERTY(b.object_id, N'IsUserTable') = 1
    where
    system_type_id in
    (select system_type_id From sys.types ) and charindex(' ',a.name)<>0
    EXEC sp_rename 'tbl_apas_t_tech.application id', 'applicationid', 'COLUMN'
    EXEC sp_rename 'test_table.column test space', 'columntestspace', 'COLUMN'
    Drop table test_table
    EDIT: Formatting...

  • Trim Space from a string

    Hello All,
    I need to trim space from beginning and end of a string.
    For example -
    astring = ' hello123 '.
    I need to get astring as 'hello123'.
    Thanks in advance.
    Viren

    Hi Viren,
    You can code like this
    WRITE ASTRING TO ASTRING NO-GAP.
    Hope this will help.
    Regards,
    Ferry Lianto

  • How to trim data from column

    Morning gurus
    I have two tables, with column matching data, BUT i need to trim the columns of one of the tables
    the data appears in xpq_log table as follows
    LOG_DATE                     LOG_PTR     LOG_HDR
    01/06/2011 00:00:00     0609pro     0609IN002C_06
    04/06/2011 00:00:00     0609pro     0609IN002C_06
    05/06/2011 00:00:00     0609pro     0609IN002C_06
    06/06/2011 00:00:00     0609pro     0609IN002C_06
    07/06/2011 00:00:00     0609pro     0609IN002C_06
    09/06/2011 00:00:00     0609pro     0609IN002C_06
    10/06/2011 00:00:00     0609pro     0609IN002C_06
    12/06/2011 00:00:00     0609pro     0609IN002C_06
    01/06/2012 00:00:00     0609pro     0609IN002C_06
    02/06/2012 00:00:00     0609pro     0609IN002C_06
    03/06/2012 00:00:00     0609pro     0609IN002C_06
    06/06/2012 00:00:00     0609pro     0609IN002C_06
    07/06/2012 00:00:00     0609pro     0609IN002C_06
    08/06/2012 00:00:00     0609pro     0609IN002C_06
    09/06/2012 00:00:00     0609pro     0609IN002C_06In printpdf table as follows
    PDF_REPORT     PDF_DESCRIPTION
    IN002C                     STOCK FILE PURGE - PRINT WH CONTROLHow can i trim data from column(log_hdr) to match column(pdf_report)?
    Any help will be much appreciated

    Alberto,
    Even we can use regexp_substr to something fix string( Known part of a string).
    Like:-
    SQL> ed
    Wrote file afiedt.buf
      1  WITH xpq_log AS
      2  (
      3     SELECT '0609IN002C_06' log_hdr FROM DUAL
      4  )
      5* SELECT REGEXP_SUBSTR(log_hdr,'[[:alnum:]]+[C$]',1,1) PDF_REPORT FROM xpq_log
    SQL> /
    PDF_RE
    IN002C
    Thanks!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Reduce space between columns

    hi all...
    i want to reduce space between columns in sqlplus....
    how can i?

    sachinpawan wrote:
    hi all...
    i want to reduce space between columns in sqlplus....
    how can i?Which space? Where it is coming, in some output? Whats the db version?
    Aman....

  • Forms 10gR2 does not trim spaces

    Hi,
    we are planning to migrate to 10g from 6i. as far as i know forms always trims trailing spaces. so when we are inserting space to a table it inserts null.
    but at 10gR2 it does not trims spaces and inserts non-null value.
    Am i missing something or is it really changed?
    Regards. Engin.

    I had fogotten about that bug. But it still exists, even in Forms 6i, patch 17 (6.0.8.26.0)
    I ran this test:
    Declare
      v1  varchar2(4);
      v2  varchar2(4);
      v3  varchar2(4);
    Begin
      v1 := ' ';  -- one space
      select nvl(v1,'X'), v1 into v2, v3 from dual;
      message
        ('V2=' || v2 || ', Length(V2) = ' || nvl(Length(v2),0) );
      message
        ('V3=' || v3 || ', Length(V3) = ' || nvl(Length(v3),0) );
    End;And I get the following messages:
    V2=X, Length(V2) = 1
    V3=, Length(V3) = 0Run under SQL Plus, changing Message to DBMS_Output.Put_Line:
    V2= , Length(V2) = 1
    V3= , Length(V3) = 1I get the correct result, the same as SQL Plus, in Forms 10.1.2.0.2.

  • How remove space in column ?

    In a.newunit column I have spaces before data. I tried to use TRIM and LTRIM -- but doesn't work :(
    What else I can use?
    SELECT LTRIM(u.scode), LTRIM(a.newunit)
    FROM unit u,
    aaa_test a
    WHERE LTRIM(u.scode) = LTRIM(a.newunit)

    Can you explain what "doesn't work" means, preferrably with an example (i.e. DDL for the Unit and AAA_Test tables, INSERT statements, and a query that returns the incorrect results)?
    TRIM will remove spaces at the beginning and end of a value, LTRIM will remove spaces at the beginning of a value. Potentailly, you don't really have spaces at the beginning of your data. Potentially, you are misinterpreting something (in which case seeing what constitutes "not working" is critical).
    Justin

  • How to trim spaces in SQL?

    Hi there,
    I have installed Oracle XE on my machine and have populated it with some data. In one table,namely the Id column i noted there are spaces before the actual code. For example _ _ _12345. My question is, how do i removed these spaces? I am using Oracle SQL Developer to query the tables in XE. I have over 100,000 records.
    Thanks for the help
    SI

    http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/functions002.htm#CJAEEJFC
    Refer to the TRIM, LTRIM and RTRIM functions and issue an appropiate UPDATE statement
    Sybrand Bakker
    Senior Oracle DBA

  • Trigger or sql statments to trim spaces??

    Dears,
    I am receiving some data in some kind of stagging tables with some columns having extra spaces ... so is it faster and / or better to create a trigger on those tables to trim those spaces before insert or shall i trim when retrieving data from those tables?? note that this data will not be retrieved more than two times as its part of migration process.
    Thanks in advance,
    Swaid McKey

    How did you perform the import? imp <username>/<password>@<ORACLE_SID> fromuser=<srcusername> touser=<destusername> file=<dumpfilename> tables='<tablename>' log=<logfilename> BUFFER=2048000 RECORDLENGTH=64000
    Where did the source dump file come from? if i got u right from informix dynamic server (src) to oracle 9i (intermediate) then to oracle 9i (stagging)
    How did you "processing and moving data to final destination"? with pl/sql procedures selecting from stagging inserting into dist with updates in the middle.
    How did you "updating the the table by trimming the> column"? update emp
    set name=rtrim(name);
    How many tables are we talking about? 13 table
    How many columns need to be trimmed? 1 to 2 columns per table
    How many rows are there? as i said before 11million
    How did you take these timings?using shell script, i record the time before & after.
    How did you write hte migration?cursor --> open --> loop --> fetch --> inserts --> updates --> end loop
    Why are you going via a dump file to do the migration?because of the agreement with the other party
    Why are you using staging tables? Are you performing other transforms on the staging tables?i only query from them but i do transform the data before inserting in the destination
    Where are the spaces? leading or trailing? or both?trailing
    what are the data types?VARCHAR2 (20)
    Are there object types involved?no
    Do the target tables already have triggers on them for other reasons?no

  • Error While creating a rule for trimming spaces

    Hi All,
    Please can you tell me the correct syntax for trimming the Spaces from the beginning of the word.
    I tried like this but it is giving error as below:
    BEGIN RETURN
    ltrim($SPACES_TRIM, '');
    END
    ERROR:  The return statement is expected to return a conditional value: found type<VARCHAR>. (COR-10622)
    Please do help me its urgent.
    Thanks & Regards,
    DJ

    Hi Deepak,
    when you create validation rules they always have to return TRUE or FALSE conditions. (A record can pass or fail your expression.
    So your expression above returns a VARCHAR string, as you can read in the User guide, you are replacing leading nothing '' at the beginning of your string $SPACES_TRIM.
    You need to understand basic concept for validation rule expressions and use of functions.
    There are lots of great product tutorials here on the SCN, that describe scope, features and functionalities of Information Steward, so you got a understanding of what you can do with IS.
    NIels

  • File Adapter: trailing space in field using XSD:Decimal in a CSV file

    Hi Folks,
    I have a problem which i am unable to understand fully.
    We have a SAP to file via XI scenario where a mail adapter is used. We are producing a CSV file as an mail attachment.
    The issue is all the decimal fields have an extra space before the next delimiter i.e. comma.
    The data type used in mapping is XSD:Decimal with 'fraction' set as 2.
    I have checked the source XML and there is no trailing spaces there. Initially i thought this might be due to doing the conversion using transformation beans in mail adapter, to rule this out i checked other files produced using FILE adapter they also appear to have same issue.
    I can't get my head around it, could not find any parameter i need to pass in content conversion either in MAIL adapter or FILE adapter to supress trailing space before the delimiter.
    I suppose this must have occured with others as well.
    Any directions would be greatly appreciated.
    Btw, we are on PI 7.0 and ECC 6
    -Praveen
    Edited by: - External Consultants Mouchel on Sep 15, 2009 5:34 PM

    Hi Mouchel,
    I personally didnot encounter this kind of issue with the file adapter at any point of time. I would suggest you to check the message mapping before and after payload in sxmb_moni. If you see in mapping you may not find out, so view the source in notepad and then see.
    Regards,
    ---Satish

  • Receiver SFTP adapter giving spaces between characters in the Output file

    Hi PI Experts,
    My Scenario is: Paymul (EDI file ) ECC -> PI -> SFTP server.
    Source Sender File adapter able to pickup this Paymul D96A file and able to send messages to target SFTP server using SFTP receiver adapter.
    But, Generated Output file having single space between each character. I am not using any content conversion modules in Receiver SFTP adapter.
    Also not having any mappings to transform the messages. it is just pass through interface.
    I have attached example Output file. I have changed the .Dat file to .txt just to attach here.
    Could any one try to help me on this. Please let me know incase need any more details.
    Thanks,
    Govindu.

    Hi Govindu,
    Please see if the below Endcoding settings wont resolve your issue.
    File Type - Text
    File Encoding - ISO-8859-1
    Regards,
    Jannus Botha

  • Hyperion IR 9.3.1.3:  Spaces in Column Names

    I have a table that has column names that have spaces. Hyperion IR 9.3.1.3 Studio can query this fine, but IR Web Client can't. In Studio, the query log shows the column names surrounded by quotes, but the Web Client won't even show me the query in the query log. Is there a setting I missed when I published the OCE to the Workspace?

    After checking the Use Quoted Identifiers box in the Advanced Options for the connection, the query works, but I still can't use the Detail View option for the table in the data model.

Maybe you are looking for

  • I forgot my iphone passcode, it's disabled now, and I can't restore??

    Hey guys, I've had an iphone for about 3 weeks. All of a sudden today I couldn't remember the lock code. Stupid I know! Anyhow I panicked and entered what I thought was the password way too many times. In short, it's now disabled now. I read on how t

  • Mac Hard Drive Failure - How to get all info of iphone?

    The computer that I sync my iphone to had a complete system drive failure. The drive is toast, nothing recoverable. There is lots of information that I have on my iphone that I now only have on my iphone: mail, contacts, notes, pictures. I want to ke

  • I can't use Word 2003

    Hello, I've MS Office 2003 and RoboHelp for Word (demo activated for 30 days trial) installed on a Vista HP system. When I open Word to load a previously edited document (.doc file) it does not open but the control of Word is taken by Robohelp. How t

  • Reader 11 prints white on black not black on white

    it started in reader 10, so i deleted that and installed reader 11, same problem, prints colour ok and will print as normal black on white if printer default is colour , but when it is b/w default it reverse prints ? printer is hp laser jet 400m475dw

  • Flash player update needed??

    I can't play videos on my ipad  and get a message that I need to update my flash player, but my husband has no issue watching videos on his iPad. What am I missing?