Ignore carriage returns in select statement

Within Oracle Report builder, I am using a select startment
select descr
from atable
"descr" contains carriage returns at the end of the input ie people have enter 'enter' when inputting the data.
how do write the select statement to ignore the carriage return 'enter' contain within "descr".
Thanks

SQL> SELECT 'aa' || chr(10) || 'bb' c FROM dual;
C
aa
bb
SQL> SELECT translate('aa' || chr(10) || 'bb', chr(10),' ') c FROM dual;
C
aa bb
SQL> SELECT 'aa' || chr(13) || 'bb' c FROM dual;
C
aa
bb
SQL> SELECT translate('aa' || chr(13) || 'bb', chr(13),' ') c FROM dual;
C
aa bb
SQL> "For Windows"
Message was edited by:
mennan
Message was edited by:
mennan

Similar Messages

  • SQLLDR ignoring carriage returns

    Can SQLLDR ignore carriage returns? I am trying to load records
    from Access to Oracle. The columns I am loading contain content
    for displaying on the web (Text inter-mixed with HTML code).
    Because these columns were created/updated via a web interface,
    they contain a lot of carriage returns. The problem I am having
    in SQLLDR is when it sees a carriage return, it thinks it is a
    new record. Can I prevent this without manually removing the
    carriage returns in the Access records?

    Hi William,
    The Workbench should help you since it uses the following SQL
    Loader syntax :-
    "str '<er>'" specifies that the end of record delimiter is <er>.
    This means carriage returns will be preserved. Also <ec> is the
    end of column delimiter.
    load data
    infile 'AUTHORS.dat' "str '<er>'"
    into table AUTHORS
    fields terminated by '<ec>'
    (AU_ID ,
    AU_LNAME ,
    AU_FNAME ,
    PHONE ,
    ADDRESS ,
    CITY ,
    STATE ,
    ZIP ,
    CONTRACT )

  • Ignore carriage return in a text area

    Hi
    I've a JTextArea of 3 rows on an applet screen.
    I want to disable the carriage return key on the text area.
    Thanx in advance

    Look at the API documentation for JTextField; it contains an example of a class called UpperCaseField. You could modify this code to ignore line-end characters; the concept works with JTextArea as well as JTextField. This code would prevent people from pasting line-end characters as well as from keying them.

  • JDBC Sender MSSQL Stored Procedure - Multiple Select Statements

    Hello all,
    I will proceed to tell you my problem, for which solution I request your kind advice:
    Im working in a project for a retailer, which consists in sending the information from erp and sql server to pos thru XI interfaces.
    One of the interfaces is about sending items from sql server to a file so the pos can load it into the system. For doing so I have devloped an stored procedure which function is to return several select statements as many stores the retailer might have, so they can have a different file per store along with its corresponding items in it. 
    The thing is that XI just gets the first select statement and creates the corresponding file, but it seems to ignore the remaining responses as I'm neither getting any file nor an error afterwards.
    So, my question is: is XI capable of handling multiple select responses from an Stored Procedure in graphical mapping??? Or am I just wasting my time trying?
    Thanks in advice for your help.
    Regards.

    Hello Ramkumar,
    After 5 days trying, I finally made it work out applying your advice. Below the short explanation of what I did:
    My Source structure is: Main Node->Row->Records (Material Number, StoreNum, Price, Status)
    My Target structure is: Main Node->File Node->Record Node->Records ( Material Number, Price, Status)
    The key was to make all the occurrences happen against StoreNum node. So, based on what you adviced these two where the key mappings:
    1) The Mapping that will create a new file for each different store that comes in the query (In my case, query was already sort by store using an sql "order by" function, if not you can also use xi node function "sort" as Ramkumar suggested)
    StoreNum->RemoveContext->SplitbyValue (Value Changed)->Collapse Contexts->File Node
    2) The Mapping that will create each record in its corresponding store file:
    StoreNum->RemoveContext->SplitbyValue (Value Changed)->Record Node
    And Voilá !!! It worked.
    Thanks very much Ramkumar.
    Regards.

  • Carriage return with concatenation

    Hi, I have an address table that has the address, city, state, and zip. I'm trying to make a select statement that will display each field on a line. I want to place address, city, state, and zip into an Alias Address. Is there a char value that I can use to do the carriage return?
    Select address || city || state || ', ' || zip AS "Address" From address;
    I want the output to be like:
    address
    city
    state, zip
    I just need to know what to put between the address, city and state to make them go on their own line.

    SQL> SELECT
      2  'John Doe'
      3  || CHR(10)
      4  || '100 Main St.'
      5  || CHR(10)
      6  || 'Anytown, USA  00000' address
      7  FROM DUAL
      8  /
    ADDRESS
    John Doe
    100 Main St.
    Anytown, USA  00000HTH,
    T.

  • Handling carriage returns (enter)

    I have an application with several pages.
    If the user pushes the carriage return (enter) on many of the pages,
    the application goes back to the login page rather than activating a button on the page.
    What is the best way to trap and ignore carriage returns to avoid this situation?

    I was hoping for another mechanism, but that works.
    Thanks.

  • Regular Expression.  Select Statement.  Carriage Return

    Oracle 9i
    Using SQLPLUS
    I've read about regular expression and need some translation/explanation.
    I have a large table containing a varchar2 (free text) column. Users may have inserted carriage returns when they entered the data. I need to locate rows that contain carriage returns, select and display them. Later I'll need to update those rows to replace the carriage returns with a space.
    Can you assist with syntax. I believe use of a regular expression is required.
    Thanks

    for single characters like <CR> TRANSLATE() Doh. Never post at the end of a long day.
    As the other posters have pointed out, one-for-one single character substitution is normally done with REPLACE(), although TRANSLATE() also works. The more normal role for TRANSLATE() is situations where you want to substitute multiple characters, e.g.
    SQL> update <your table> set <your column> = replace (<your column> , chr(13)||chr(10), ' ');This substitutes a space for a carriage return and line feed combination.
    Cheers, APC

  • Return multiple values from a function to a SELECT statement

    I hope I've provided enough information here. If not, just let me know what I'm missing.
    I am creating a view that will combine information from a few tables. Most of it is fairly straightforward, but there are a couple of columns in the view that I need to get by running a function within a package. Even this is fairly straightforward (I have a function named action_date in a package called rp, for instance, which I can use to return the date I need via SELECT rp.action_date(sequence_number).
    Here's the issue: I actually need to return several bits of information from the same record (not just action_date, but also action_office, action_value, etc.) - a join of the tables won't work here as I'll explain below. I can, of course, run a separate function for each statement but that is obviously inefficient. Within the confines of the view select statement however, I'm not sure how to return each of the values I need.
    For instance, right now, I have:
    Table1:
    sequence_number NUMBER(10),
    name VARCHAR(30),
    Table2:
    Table1_seq NUMBER(10),
    action_seq NUMBER(10),
    action_date DATE,
    action_office VARCHAR(3),
    action_value VARCHAR(60),
    I can't simply join Table1 and Table2 because I have to do some processing in order to determine which of the matching returned rows I actually need to select. So the package opens a cursor and processes each row until it finds the one that I need.
    The following works but is inefficient since all of the calls to the package will return columns from the same record. I just don't know how to return all the values I need into the SELECT statement.
    CREATE VIEW all_this_stuff AS
    SELECT sequence_number, name,
    rp.action_date(sequence_number) action_date,
    rp.action_office(sequence_number) action_office,
    rp.action_value(sequence_number) action_value
    FROM table1
    Is there a way to return multiple values into my SELECT statement or am I going about this all wrong?
    Any suggestions?
    Thanks so much!

    Hi,
    What you want is a Top-N Query , which you can do using the analytic ROW_NUMBER function in a sub-query, like this:
    WITH     got_rnum     AS
         SELECT     action_seq, action_dt, action_office, action_type, action_value
         ,     ROW_NUMBER () OVER ( ORDER BY  action_date
                                   ,            action_seq
                             ,            action_serial
                           ) AS rnum
         FROM     table2
         WHERE     action_code     = 'AB'
         AND     action_office     LIKE 'E'     -- Is this right?
    SELECT     action_seq, action_dt, action_office, action_type, action_value
    FROM     got_rnum
    WHERE     rnum     = 1
    ;As written, this will return (at most) one row.
    I suspect you'll really want to get one row for each group , where a group is defined by some value in a table to which you're joining.
    In that case, add a PARTITION BY clause to the ROW_NUMBER function.
    If you'd post a little sample data (CREATE TABLE and INSERT statements), I could show you exactly how.
    Since I don't have your tables, I'll show you using tables in the scott schema.
    Here's a view that has data from the scott.dept table and also from scott.emp, but only for the most senior employee in each department (that is, the employee with the earliest hiredate). If there happens to be a tie for the earliest hiredate, then the contender with the lowest empno is chosen.
    CREATE OR REPLACE VIEW     senior_emp
    AS
    WITH     got_rnum     AS
         SELECT     d.deptno
         ,     d.dname
         ,     e.empno
         ,     e.ename
         ,     e.hiredate
         ,     ROW_NUMBER () OVER ( PARTITION BY  d.deptno
                                   ORDER BY          e.hiredate
                             ,                e.empno
                           ) AS rnum
         FROM     scott.dept     d
         JOIN     scott.emp     e     ON     d.deptno     = e.deptno
    SELECT     deptno
    ,     dname
    ,     empno
    ,     ename
    ,     hiredate
    FROM     got_rnum
    WHERE     rnum     = 1
    SELECT     *
    FROM     senior_emp
    ;Output:
    .    DEPTNO DNAME               EMPNO ENAME      HIREDATE
            10 ACCOUNTING           7782 CLARK      09-JUN-81
            20 RESEARCH             7369 SMITH      17-DEC-80
            30 SALES                7499 ALLEN      20-FEB-81 
    By the way, one of the conditions in the query you posted was
    action_office     LIKE 'E'which is equivalent to
    action_office     = 'E'(LIKE is always equivalent to = if the string after LIKE doesn't contain any wildcards.)
    Did you mean to say that, or did you mean something like this:
    action_office     LIKE 'E%'instead?

  • Apostrophe cause a carriage return when sig is selected

    I've got no clue on this one folks, only seems to happen in mail when a sig file is selected as a default, regardless of whether a new signature is created from scratch or a pervious one is chosen.  If none is select it appears to not happen or the adding of an apostrophe does not invoke a carriage return?
    All clues and observations welcome!
    Mr. "P"

    Yes as it turns out someone had turned on smart quotes in the keyboard system preferences.
    Case closed...

  • How can I limit the number of rows returned by a select stat

    How can I limit the number of rows returned by a select
    statement. I have a query where I return the number of stores
    that are located in a given area.. I only want to return the
    first twenty-five stores. In some instances there may be over
    200 stores in a given location.
    I know is SQL 7 that I can set the pagesize to be 25....
    Anything similiar in Oracle 8i?
    null

    Debbie (guest) wrote:
    : Chad Nale (guest) wrote:
    : : How can I limit the number of rows returned by a select
    : : statement. I have a query where I return the number of
    : stores
    : : that are located in a given area.. I only want to return the
    : : first twenty-five stores. In some instances there may be
    : over
    : : 200 stores in a given location.
    : : I know is SQL 7 that I can set the pagesize to be 25....
    : : Anything similiar in Oracle 8i?
    : If you are in Sql*Plus, you could add the statement
    : WHERE rownum <= 25
    : Used together with an appropriate ORDER BY you
    : could get the first 25 stores.
    Watch out. ROWNUM is run before ORDER BY so this would only
    order the 25 selected
    null

  • JeditorPane text selection problem due to line feeds and carriage returns

    Hi folks,
    I have a jEditorPane (text/plain) that contains a document in which the user has highlighted some text. I want to pull the selected text from the pane, do some processing on it, and then put the altered text back in the same position.
    First I get the starting and ending position of the highlighted text
    int mySelStart = myJEditorPane.getSelectionStart();
    int mySelEnd = myJEditorPane.getSelectionEnd();Then I get all the text from the pane and (in theory) strip out the portion the user highlighted
    String myPaneText = myJEditorPane.getText();
    String mySelectedText = myPaneText.substring(mySelStart,mySelEnd);But the text string in mySelectedText never matches what the user originally highlighted. The starting and ending positions are off by the number of carriage returns that proceed the highlighted text in the document. It appears that while in the jEditorPane Java treats the carriage return as one characters, but once the info is in the myPaneText field Java treats the carriage return as two characters.
    Has anyone encountered this before? Am I doing something wrong? To fix the problem I'm looping through the entire document to find out how many carriage returns proceed the highlighted text, but there has to be an easier way.
    Thanks

    It appears that while in the jEditorPane Java treats the carriage return as one
    characters, but once the info is in the myPaneText field Java treats the carriage
    return as two characters.Correct on a Windows platform. Check out my posting here for a one line solution:
    http://forum.java.sun.com/thread.jspa?forumID=31&messageID=1464594

  • How to return the result set of multiple select statements as one result set?

    Hi All,
    I have multiple select statements in my stored procedure that I want to return as one result set 
    for instance 
    select id from tableA
    union 
    select name from table b 
    but union will not work because the result sets datatypes are not identical so how to go about this ?
    Thanks

    You have to CAST or CONVERT (or implicitly convert) the columns to the same datatype.  You must find a datatype that both columns can be converted to without error.  In your example I'm guessing id is an int and name is a varchar or nvarchar. 
    Since you didn't convert the datatypes, SQL will use its data precedence rules and attempt to convert name to an int.  If any row contains a row that has a value in name that cannot be converted to an int, you will get an error.  The solution is
    to force SQL to convert the int to varchar.  So you want something like
    select cast(id as varchar(12)) from tableA
    union
    select name from tableb
    If the datatypes are something other that int or varchar, you must find a compatable datatype and then convert one (or both) of the columns to that datatype.
    Tom

  • Using Column Name returned by function in SELECT statement

    Hi
    Output from my function (RETURN data type is VARCHAR2) is column name. I want to use it directly in my SELECT statement. Below is simplified example of this:
    --- Function
    CREATE OR REPLACE FUNCTION simple RETURN varchar2 IS
    BEGIN
    RETURN ‘my_column’;
    END simple;
    --- Select
    SELECT simple FROM my_table;
    This does not work. It seems that output from function is passed in quotation i.e.
    SELECT ‘my_column’ FROM my_table;
    So the output from SELECT is a list of rows populated with values my_table:
    COLUMN     simple
    ROW1     my_column
    ROW2     my_column
    ROW3     my_column
    Can please someone help me with this?

    I'm not sure I got you right.
    In standard SQL everything must be known at compile time. If not dynamic SQL is required, but is a costly operation (usually requires parsing before each execution) so it should better not be used when standard SQL can do it.
    I provided a design time example where a function returns the column name from the given the table name and column id for a varchar2 column data type to make things simple. Then a query string is constructed and executed dynymically to return all column values of the chosen table_name.column_name.
    SELECT simple FROM my_tableAt compile time the simple function return value is unknown (any varchar2 value would do) you already find out you get the (same) return value (i.e column name) for each table row => dynamic SQL needed to get the column values
    The purpose of function would be to rename all columns for provided table.The table name would be provided, right? If yes => dynamic SQL
    What is the function supposed to return the column name (where would the new name come from?), the column alias (which table column would be renamed to the new name?)
    The user could use the new_column name as the column alias name submitting the query.
    Is it possible to do this?Maybe () using a pipelined function (different data types - number,date, ... not cosidered yet) but your simple query;
    <tt>SELECT simple FROM my_table</tt>
    might look like:
    <tt>select my_column_value new_column_name from table(get_column_value(table_name,column_name))</tt>
    Sorry, no Database at hand to provide a specific example.
    Regards
    Etbin

  • SELECT statement not returning NULL records

    I have the following SELECT statement:
    SELECT *
    FROM RPT_DS1_CNT_CAT
    WHERE DUPS_SAME <> 'N/A';
    I also tried:
    SELECT *
    FROM RPT_DS1_CNT_CAT
    WHERE DUPS_SAME != 'N/A';
    Same results - There ARE Null DUPS_SAME values
    which are not being selected. I get NO results.
    When I execute this, I do get NULL values.
    SELECT *
    FROM RPT_DS1_CNT_CAT
    WHERE DUPS_SAME IS NULL;
    How can I ensure that I get all non - 'N/A' records
    if it won't pick up the nulls? Is there a function
    I can use or a different wording? I do want to use
    != or <> because there may be other values besides
    'N/A' such as 'YES' or 'NO' and they may be null or
    filled with spaces.

    The expression
    NVL(DUPS_SAME,'') is meaningless. You're saying "If DUPS_SAME is NULL, return the empty string, which is NULL, otherwise return DUPS_SAME." If you're going to use NVL, the string that gets returned if the column is NULL should be non-NULL, i.e.
    NVL(DUPS_SAME,'DUPS_SAME was NULL') Your query should, as others have pointed out, either be
    SELECT *
      FROM rpt_ds1_cnt_cat
    WHERE dups_same <> 'N/A' OR dups_same IS NULLor
    SELECT *
      FROM rpt_ds1_cnt_cat
    WHERE NVL(dups_same, 'DUPS_SAME is NULL') <> 'N/A' Either of these return the same results as your query but they're going to be far clearer for whoever needs to maintain the code. There may be performance differences as well if DUPS_SAME is indexed depending on the data distribution...
    Justin

  • Carriage Return ignored in ABAP Created HTML?

    We are in the pre-production box for an upgrade.
    We have ABAP source code that generates HTML logic. It worked fine in 4.6.
    The carriage return/line feeds are being ignored.
    I have already tried all the cl_abap_char_utilities=>NEWLINE
                                              cl_abap_char_utilities=>CR_LF
                                              cl_abap_char_utilities=>FORMFEED.....and more
    I've tried the conversion utilities also.
    When we look in the debugger we see the cr_lf values as ##, and 0d000a00 in hex, which should work, right?
    But, when we view the source code on the web page - where arrays are not being built because the crlfs are being ignored- we can see that when the html is being written, the crlfs are ignored and the html is all over the place, unformatted.
    I am thinking there must be a another HTML Function Module that might be available to format the html table before sending it out thru WWW_HTML_MERGER. Again, even in debug everything look good, but when it writes it to the URL the crlfs are ignored?
         Any suggestions?

    Becuase you enter your patterns as expressions where some characters are used as control characters, and then have to esacpe some of the control characters in the expressions when you enter them as java strings.
    So the expression is actually \r\n if you let a user enter it into a textfield, but you have to escape the \ if you write it as a String in the source code (since \ is an escape characters in strings)
    /Kaj

Maybe you are looking for

  • MSI P45 Neo-f with intermittent boot problems

    Current system: *CPU: Intel core2duo 4300 1,80GHz Mobo: MSI P45 Neo-F LGA775 *Memory: 1 Kingston 1GB PC2-5300 667MHz DDR2 and 1 Dane-Elec 1GB PC2-5300 667MHz DDR2 Videocard: Club3D Nvidia 8800GT 512MB GDDR3 *Hard drive: 120GB IBM deskstar 7200rpm Ult

  • How to create hierarchical LOV and Webi front end or wrapper report to replace the JSP code in BO4.0?

    My requirement is - There are customer names & region names ,Client wants to go for dynamic cascading prompt and hard code the customer name ,bu t they DON'T WANT customer names to be appear in the cascading dynamic prompt input values (they wants to

  • Sample portlets work in Repository page, but can't be added to a page

    Help, Portal 3.0.9.8.2. Apps 11.5.7 DB 8.1.7.3.0 I installed the JPDK and could see all samples from the Portlet Repository page. Every one works fine, except the Lottery only shows preview, not the balls. Then I try to add a portlet to a page. When

  • Create PDF's in an older Version

    Dear Sir or Madam, our company works with an interface for PDF forms. The fields of a form are automatically recognized. For option fields are the possible element values selectable. That works fine with forms made with the Distiller 7.0. Newly we bo

  • Confirmed quantity to unrestricted use

    hi, i have two sales orders which are confirmed and gods are transferred from unrestricted user to sales orders stock. how to cancel it (sales order stock) it and get back the same stock which is confirmed under the sales orders stock. in simple term