Problem with 'order by' and comparison operator with varchar2 field

I have a problem with the following sql query (field1 is varchar2):
SELECT field1
FROM tablename
WHERE field1 > 'AA10BB'
ORDER BY field1
The contents of field1 is:
AA10BB
AA10-10BB
AA10-12BB
The sql query without the WHERE clause sorts field1 this way:
AA10BB
AA10-10BB
AA10-12BB
But the sql query with the WHERE clause has no hits.
It seems that when sorting the minus character is greater than the 'B' character and
at the comparison ( > 'AA10BB' ) the minus character is lower than the 'B' character!
The database and client NLS_PARAMTER are GERMAN_GERMANY.
The database is 9.2.0.7
Has anyone an idea?

thanks for your fast reply!
My problem was that NLS_SORT was set to 'GERMAN' and NLS_COMP to 'BINARY'.
NLS_SORT = GERMAN orders the varchar2 fields in form of 'a A b B ... 0 1 2 3 ..'
NLS_COMP = BINARY compares binary (ASCII-Table).
I use now:
SELECT field1
FROM tablename
WHERE field1 > 'AA10BB'
ORDER BY NLSSORT(field1, 'NLS_SORT = Binary'');

Similar Messages

  • Problem with currency  field in smart form

    hi
    friends ..
    i had problem with currency field in smartform iam printing 5 currecny
    fields after the main window .But not getting printed on right way gets printed down from the given mesaurement and i get lot of gap betwen the
    each fields for ex.
    33,260.00
    120.00
    0.00
    0.00
    0.00
    i thought the the problem is with space .so iwanted to condense it but cannot as it is currency field so move into character fields .but the user want out put in currency format like 22,60.20 if i  get the value in char variable i get 2260.20 which i dont want .
    so pls help me how to condense or shift left and print the currency field on right place.
    regards
    answers will be rewarded points.

    hi,
    this is a normal problem u can avoid this by moveing these currencu value to a character field then print the char field us ing condece... &var(C)&..
    eve if not solve the problem use the TEMPLATE node..
    Please Close this thread.. when u r problem is solved. Reward all Helpful answers
    Regards
    Naresh Reddy K

  • Problem with a field set to refresh after insert at Row level

    hello all,
    i have a problem with a field (a serial) which is set by a db trigger at insertion. The field "refresh after insert" is properly set in the Entity and everything is refreshed correctly when i insert data via an adf form in a jspx but when i want to insert programmatically nothing is refreshed. I insert data this way :
    ViewObject insertVO = findViewObject("myView");
    Row newRow = insertVO.createRow();
    newRow.setAttribute("mandatoryAttribute1",value1);
    newRow.setAttribute("mandatoryAttribute2",value2);
    <more init here but not the serial since it will be set by the DB trigger>
    insertVO.insertRow(newRow);
    but when i want to get back the value with "newRow().getAttribute("TheSerial");" i always get a null back and not the value set by the db trigger.
    One way to get the serial is to commit after each insert but i don't want to commit between inserts.
    i've tried to unset the refresh after insert and override the createDef() method to setUseReturningClause(false) as it's is advised in chapter 26.5 of the ADF 4GL dev. guide but in this case i have an exception JBO-29000: JBO-26041.
    How can i get the value back properly ?
    thanks
    -regards

    The data for the newly created row doesn't get inserted into the database until the commit is executed, so the insert trigger isn't called.
    If you need to get the value without committing, then you should implement the trigger programmatically and drop the trigger from the database. The code below shows how you could do this.
    ViewObject insertVO = findViewObject("myView");
    Row newRow = insertVO.createRow();
    SequenceImpl seq = new SequenceImpl("MY_SEQ", insertVO.getDBTransaction());
    Long next = (Long)seq.getData();
    newRow.setAttribute("primaryAttribute", new Number(next));
    ...You will need to replace MY_SEQ and primaryAttribute with the correct values for your example, but this should acheive what you want.

  • Problems with varchar2 column and a select statement

    Hi to all,
    I am new to ODP...so I would really appreciate your help..
    I am having problems with using the following code:
    con.ConnectionString = "User Id=bla;Password=bla;Data Source=bla;";
    string cmdQuery = "SELECT * from try where data ="+textBox1.Text+"";
    OracleCommand cmd = new OracleCommand(cmdQuery);
    cmd.Connection = con;
    cmd.CommandType = CommandType.Text;
    OracleDataReader reader = cmd.ExecuteReader();
    while (reader.Read())
    MessageBox.Show(reader.GetString(0)+"");
    cmd.Dispose();
    con.Close();
    where:
    data is the name of a field in the table
    textBox1 is the name of a text box where the user inserts the values..
    The error that appears is "Invalid identifier"..
    I hope it makes sense...and please help...

    Hi,
    I'm fairly sure it IS the single quotes actually. Print out the string you're trying to excute, then try it outside odp.net, does it work?
    For example:
    SQL> select * from dual where dummy=foo;
    select * from dual where dummy=foo
    ERROR at line 1:
    ORA-00904: "FOO": invalid identifier
    SQL> select * from dual where dummy='foo';
    no rows selected
    Cheers,
    Greg

  • Problems with image field and java

    Hi, i´m a beginner user of Adobe LiveCycle Designer, i create a form and i fill the text fields with a Java code, but when i try to dinamically assign a image on the image field of my form it doesn´t work, someone have any idea of whats happening or how can i manipulate the image field from Java code? thanks

    Session data will only last as long as the servlet container allows. In most cases (eg Tomcat) this defaults to about 30 minutes, but can be changed. Check that the session timeout configuration in your servlet container hasn't been set to "never timeout".
    Even if it had, I would have expected OutOfMemory errors rather than degrading performance. Although if the max heap size of the JVM has been set to a level higher than the RAM on the machine you could be getting excess page file usage.
    This probably wouldn't put CPU utilization at 99% though.. I suspect this is a code related problem.
    My best guess is one of two reasons:
    1. Somewhere in your code, or someone elses, there is a loop that never ends.
    2. There is a bug in the servlet container.
    I don't know which servlet container you are using, but I have used Tomcat extensively and never seen this behaviour.
    In terms of solving this problem, that's a tough one. I would try running the entire application within a profiling tool to see which threads are clogging up the processor. The Eclipse java IDE has a plugin called Eclipse Profiler which will allow you to track the utilization of code right down to the method level.
    If it were me, I'd be running the entire web application with a profiler like Eclipse Profiler and waiting for it to start clogging, then see who the guilty code is.

  • Problem with currency fields

    Hi,
    My international settings are set to Turkish locale. I created a spreadsheet and defined a column as currency. Turkish currency symbol is YTL. When I want to make calculations using cells on that column, I get "+The operator "*" expects a number but the cell contains string+" error. Numbers doesn't understand that YTL is the currency symbol and prohibits any calculation. If I change the locale to U.S.A, and define the same column as currency, i can make calculations on this column. Does anyone has the same problem with different locale?
    Thanks
    Bilgehan

    Hello
    Glad to give you the ability to work flawlessly.
    I will report to Apple because the behaviour is really foolish.
    If I enter System Prefs to select Turkish as used language, the currency is displayed as
    If with this setting I enter Numbers, type 123 and apply the currency format, the cell displays
    TRY is the official ISO 4217 symbol but it's not the system setting and it is not treated as a currency symbol so the cell is treated as a string.
    If I enter the Inspector and select "livre turque (TL)"
    the cell is treated as a number.
    Funny isn't it.
    Yvan KOENIG (from FRANCE vendredi 8 février 2008 14:33:53)

  • Problem with add fields in KOB1

    Hi,
    I need to add some fields in the KOB1 report for Display Actual Cost Line Items for Orders, i have tried change the Customizing include CI_RKPOS with the new fields and the includes ZXKAEPTOP, ZXKAEPU01 from EXIT_SAPLKAEP_001. The problem is that the new fields are marked with 'X' in the fielcat-no_out and not appear in the report. How can i change this fieldcat or do that these fields appear in the report.
    Thanks.

    Hi,
    do like this
    1) there is a view covp go in to that open table/join tab  COEP table in that one include is there CI_COBL
    in this include put your custome fields.
    and activate it.
    2)open se37 tc and run this RS_SEL_OPTIONS fm and exe cute it click on creat button and you can able to give group no in the sceen with the fields which you need to display. then save it.
    3) run kob1 you will get it

  • Problem with Date fields in Search panel

    Hi all,
    I use TP2 and in my jspx page I have a search panel with two date fields and table where the results is displayed. But there is a problem with these date fields, because when I search dates the results is nothing even I retype the date from table. Also I have other pages where this problem exist with same structure.
    Could somebody help me with some advice?
    Thanks in advance!

    Hi Frank,
    Thanks for the answer.
    I use the standart method to make search panel with drag and drop the data control to the page. The other search panel fileds work fine, only the date fileds are problem. Maybe something in view object doesn't work properly.
    Here I post the code from my page.
    <table border="1" style="margin:5px;">
    <tr>
    <td>
    <af:showDetailHeader text="ТЪРСЕНЕ" disclosed="true"
    inlineStyle="width:780px;">
    <table cellspacing="2" cellpadding="3" border="0">
    <tr align="left">
    <td align="right">
    <af:outputLabel value="#{bindings.EGN.hints.label}"/>
    </td>
    <td align="left">
    <af:inputText value="#{bindings.EGN.inputValue}"
    label="#{bindings.EGN.hints.label}"
    columns="#{bindings.EGN.hints.displayWidth}"
    maximumLength="#{bindings.EGN.hints.precision}"
    simple="true"/>
    </td>
    <td align="right">
    <af:outputLabel value="#{bindings.LNC.hints.label}"/>
    </td>
    <td align="left">
    <af:inputText value="#{bindings.LNC.inputValue}"
    label="#{bindings.LNC.hints.label}"
    columns="#{bindings.LNC.hints.displayWidth}"
    maximumLength="#{bindings.LNC.hints.precision}"
    simple="true"/>
    </td>
    <td align="right">
    <af:outputLabel value="#{bindings.AccPersonID.hints.label}"/>
    </td>
    <td align="left">
    <af:inputText value="#{bindings.AccPersonID.inputValue}"
    label="#{bindings.AccPersonID.hints.label}"
    columns="#{bindings.AccPersonID.hints.displayWidth}"
    maximumLength="#{bindings.AccPersonID.hints.precision}"
    simple="true"/>
    </td>
    </tr>
    <tr align="left">
    <td align="right">
    <af:outputLabel value="#{bindings.PersonName.hints.label}"/>
    </td>
    <td align="left" colspan="5">
    <af:inputText value="#{bindings.PersonName.inputValue}"
    label="#{bindings.PersonName.hints.label}"
    columns="#{bindings.PersonName.hints.displayWidth}"
    maximumLength="#{bindings.PersonName.hints.precision}"
    simple="true"/>
    </td>
    </tr>
    <tr align="left">
    <td align="right">
    <af:outputLabel value="#{bindings.DateFrom.hints.label}"/>
    </td>
    <td align="left">
    <af:inputDate value="#{bindings.DateFrom.inputValue}"
    label="#{bindings.DateFrom.hints.label}"
    simple="true">
    <af:convertDateTime pattern="#{bindings.DateFrom.format}"/>
    </af:inputDate>
    </td>
    <td align="right">
    <af:outputLabel value="#{bindings.DateTo.hints.label}"/>
    </td>
    <td align="left">
    <af:inputDate value="#{bindings.DateTo.inputValue}"
    label="#{bindings.DateTo.hints.label}"
    simple="true">
    <af:convertDateTime pattern="#{bindings.DateTo.format}"/>
    </af:inputDate>
    </td>
    </tr>
    <tr>
    <td align="right">
    <af:commandButton actionListener="{bindings.Execute.execute}"
    text="#{bundle.FindBtn_LABEL}"
    disabled="#{!bindings.Execute.enabled}"
    icon="/images/find.png"/>
    </td>
    <td align="left">
    <af:commandButton text="#{bundle.FindClearBtn_LABEL}"
    icon="/images/find_clear.png"
    action="#{PeopleBean.onClearVCBtn}"/>
    </td>
    </tr>
    </table>
    </af:showDetailHeader>
    </td>
    </tr>
    </table>
    Also I have a result table for the search panel, but I don't believe the problem can be there because it works fine when I search in fields different by inputDate.
    Do you have any suggestions?

  • Problem with Date-Field

    Hi,
    I have a problem with a date-field. Maybe I must describe the problem more detailled, but first I just want to ask you, if you know the following error-message: "21.10.2010 kommt nicht in der Menge der erlaubten Werte vor". I don't know the correct translation but it must be something like this: "21.10.2010 does not occur in the quantity of the permitted values". I don't find the position in the sourcecode of this message. And I know, that this message isn't thrown by a functionblock from SAP. So what is the describtion of this message?

    Yes I have a date field in my form. Ok I must describe it more detailled. I have an employee searchfield. After select an employee you see a form. After filling the form you click on "Send". It creates a ticket and sends the data to the Backend and jumps back to the employee search field. Untill this point everything works fine. There is no problem with the datefield. Now I want to create the form. I choose an employee and fill the form. But now it comes this message. But not after clicking the "send" button. The message comes after changing some data (e.g. change a radio button). So it looks like a validationproblem, but only at the second creationprocess. Maybe the first date is in some cache? I don't know...

  • Problem with selection fields in SAP Quick Viewer

    Hi Friends
    I am using SQVI t-code to develop the SAP queries. I have developed a query using tables KNA1, VBAK and VBAP. Initially I used customer number, customer name, city, document creation data, document type and document number as selection fields. Now I have removed customer name, city, document creation data, document type from selection fields.  I am executing this query through a Function module "RSAQ_REMOTE_QUERY_CALL". While passing the data to selection table, even after deleting the 4 selection fields, still I have to pass the sales document number positioning as 6. Is there any way to solve this and make its position as 2.
    I have gone through the FM "RSAQ_IMPORT_QUERY", there one table parameter O_DBSE will retrieve the values for selection fields are designed for that query, again its tedious process, I have create a customized function module and make the required changes. Instead of using this FM, is there any table which stores the data of the selection fields of a query. I have tried for the table and I failed to find that.
    Please help me in this regards
    Regards
    Praveen

    Hello, I am trying to create LSMW to upload KP06 also, we have been uploading by copying and pasting once we run the iverview layout and then save. The problem is that we can only do this by G/L account. We want to use one file to upload all. Can you give me some tips how you were able to accomplished. I am familiar with LSMW, but tcode KP06 behaves in different ways. Do you use the flexible upload to load the fiel thru LSMW? Can you tell me which fields you touch in KP06 when you were recording?
    Thanks You,

  • Sender FCC , problem with Repeating Field under a Sub-structure

    Hi,
    I have an Input File as
    D,TH_ ,10/31/2008,ABC,pieces
    PF, 10/31/2008,11/2/2008,11/3/2008,11/4/2008
    P,mat,CS,100,120,130,125,150,170,120
    P,mat,CS,100,120,100,110,140,120,110
    I need to Implement an FCC to convert this to
    a Structure like this
      Recorset
        Header           1....1
            Unique Id
            date Time
            CustomerCode
            Code
            Unit
        Dates         1
         date          1....n
        Products       1....n
          product      1
          unit         1
          quantity     1.....n
    This this is a Variable recordset type ( i.e each ROW has a Different Structure) the following keys D,PF,P  are defined, for the header, dates, and Product Information.
    The Following FCC parameters are applied
    Document Name :  MT_FILE_INPUt
    Document NameSpace = http://xyz.com
    Recordset Name = "Recordset"
    Recordset structure = Header,1,Dates,1,Products,*
    keyname              = Key
    Keytype               = String
    Header.FieldSeprator = ,
    Header.FieldName = Unique Id,date Time,CustomerCode,Code,unit
    Header.keyValue = 'H'
    Dates.FieldSeprator = ,
    Dates.Fieldname   = 'date'
    Date.keyValue    = 'PF'
    Products.FieldSeprator = ,
    Product.FieldName =  product,unit,quantity
    Product.KeyValue  = 'P'
    Now the Problem is as Follows:
    1) I have a Repeating Field Quantity under the Product and Date under the Dates Sub-structure,  This is not getting Repeated at all.
    Is there a Way to achieve the same
    2) Another Point is That, i do not want to take the key Value in the XML structure after converion, is there a way to avoid it
    Please let me know if any blogs are available
    Any help would be appreciated.
    Thanks,
    Best Regards
    Abhishek

    can u try.. i haven't tired this.
    quantity is occuring multiple times, but if that is fixed no# of occurance,, you can can try with this?
    P,mat,CS,100,120,130,125,150,170,120
    Product.FieldName = product,unit,quantity,quantity,quantity,quantity,quantity,quantity
    let me try ..
    As long as the quanitfy defined under Product.FieldName are more than the input msg quantity values (100,120..), you will be safe...
    Edited by: Anand on Oct 31, 2008 3:54 PM

  • Smartform: Formatting Problem with QUAN-Field

    I want to print a smartform and get exception 1 (formatting error). With function SSF_READ_ERRORS I get an error table. There is on entry: errnumber = 020011, msgid = SSFCOMPOSER, msgty = E, msgno = 601, msgv1 = wa_outtab-menge.
    It seems to be a formatting problem with field WA_OUTTAB-MENGE. But in the structure this field is referenced correctly.
    Does anybody know a solution?

    I solve this kind of problem in my SmartForm.
    Try this:
    Go to "Global Definitions" Node, then "Current/Quant.Fields" tab and set these values:
    Field Name:      WA_OUTTAB-MENGE
    Reference Field: WA_OUTTAB-MEINS
    Data Type:       QUAN
    Best Regards,
    Eduardo Ribeiro.

  • Problem with number field

    Hi,
    I'm using ADO (Oracle Provider for OLEDB) to connect Oracle 9. If the type of any field in table is Number(9) and I open query with this field, all negative values are displayed as positive values. For example: If I write -1 value to this field and then post the dataSet (Delphi7 - TADOQuery) value is refreshed to 1. Real value in database is -1.
    Could anybody help me with this problem?
    Regards Jan.

    Once again :)
    I finally foud out that Deplhi does support (varDecimal), but delphi TCustomADODataSet (ADO recordSet wrapper) component incorrecltly treats such field type. It regards Decimal(<9,0) as integer (TIntegerField) but when it gets value from underlying ADO recordset it expects integer variant. So it's delphi problem. I hat to fix this problem in source code of this component.
    Regards Jan.

  • Problem with number-fields in csv-Export-Files

    Hello,
    the export with the csv option works fine and our users like this export-function.
    But Unfortunatelly we have some problems with the exported number fields. In my region I defined the field with a format mask.
    On the screen it looks fine but when I change to csv the values are exported as text-values.
    So in excel the columns are shown with left alignment.
    When I try to change the format in excel to number, excel change the column type but not the value inside.
    On this account we cannot use the sum-function and the display of the value is wrong (alignment).
    Which possibilities do I have to resolve that problem?
    Thanks in advance
    Ulrike

    I have the same issue - Anyone any ideas on how to export currency values in a report to excel as numbers?

  • Problem with slis_t_specialcol_alv Field Symbol Assignment

    I have created a dynamic internal table (runtime determined number of columns) to contain data to be displayed in an ALV. I’ve also made ensured that the last column of the dynamic itab is of type <b>'slis_t_specialcol_alv'</b> and named <b>‘CINFO’</b> to contain color information for that particular row. In the code below the dynamic itab is pointed to by field symbol <dyn_table> while the work area for it would be <dyn_wa>.
    Somewhere down the line I attempt to assign the ‘CINFO’ component of the current row of the itab to a field symbol called <fs_cinfo> typed as ‘slist_t_specialcol_alv’ (Same as CINFO).
    I used the code:
    ASSIGN COMPONENT 'CINFO' OF STRUCTURE <dyn_wa> TO <fs_cinfo>.
    This gives me the runtime error:
    <i>Type conflict in the ASSIGN statement in the program "ZHRR001_TEMMATRIX".
    You attempted to assign a field to a typed field symbol,
    but the field does not have the required type.    </i>     
    I am unsure why this happens as both the component CINFO and FS <fs_cinfo> are of type slist_t_specialcol_alv.
    For some odd reason though during debugging, I took a look at the <dyn_wa> structure and the component type of CINFO was displayed as “C”???
    Here is the relevant portion of code (creation of dynamic itab and attempting to assign <fs_cinfo>)
    FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
                   <dyn_wa>.
    FIELD-SYMBOLS: <fs_cinfo> TYPE slist_t_specialcol_alv.
    DATA: lw_cinfo TYPE slis_specialcol_alv.
    DATA:          li_fldcat TYPE lvc_t_fcat,
                   lw_fldcat TYPE lvc_s_fcat.
    *Create internal table fields (they will be called Field1, Field2, etc)
    *Last column will be named 'CINFO' to contain row color information
    DO l_alvcolumncount TIMES.
      index = sy-index.
      IF index <> l_alvcolumncount.
        CLEAR lw_fldcat.
        CONCATENATE 'Field' index INTO lw_fldcat-fieldname .
        CONDENSE lw_fldcat-fieldname NO-GAPS.
        lw_fldcat-datatype = 'STRING'.
    *    lw_fldcat-intlen = 5.
        APPEND lw_fldcat TO li_fldcat .
      ELSE.
        CLEAR lw_fldcat.
        lw_fldcat-fieldname = 'CINFO'.
        CONDENSE lw_fldcat-fieldname NO-GAPS.
        lw_fldcat-datatype = 'slis_t_specialcol_alv'.
        APPEND lw_fldcat TO li_fldcat.
      ENDIF.
    ENDDO.
    * Create dynamic internal table and assign to FS
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog = li_fldcat
      IMPORTING
        ep_table        = new_table.
    ASSIGN new_table->* TO <dyn_table>.
    *Create dynamic work area and assign to FS
    CREATE DATA new_line LIKE LINE OF <dyn_table>.
    ASSIGN new_line->* TO <dyn_wa>.
      ASSIGN COMPONENT 'CINFO' OF STRUCTURE <dyn_wa> TO <fs_cinfo>.
    * Color this cell
      lw_cinfo-fieldname = fieldname.
      lw_cinfo-color-col = 6.
      APPEND lw_cinfo TO <fs_cinfo>.
    Message was edited by: Sow Yong Wong

    Hello Sow
    There is a big problem in the program: you are mixing types used for FM-based ALV (SLIS_...) and ABAP-OO based ALV (LVC_...).
    For ABAP-OO based row colouring you have to define your itab like this:
    TYPES: ty_s_outtab.
      INCLUDE TYPE kna1. " just an example
    TYPES: rowcolor(4)  TYPE c.
    TYPES: END OF ty_s_outtab.
    TYPES: ty_t_outtab TYPE STANDARD TABLE of ty_s_outtab
                       WITH DEFAULT KEY.
    In the layout (LVC_S_LAYO) you have to set <b>ls_layout-info_fname = 'ROWCOLOR'</b>.
    ROWCOLOR has to be filled according to <b>Cxyz</b> whereas
    - x = color
    - y = inverse on/off
    - z = intensified on/off
    For documentation please refer to <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907">An Easy Reference to ALV Grid Control</a>
    Regards
      Uwe

Maybe you are looking for

  • CSA 6.0 will not install. Crashes on Patch Information.

    I have tried to install CSA 6.0 a few times and it crashes on "Unable to load patch information into database. setup will now abort". can anyone tell me why this keeps happening. I have installed 5.2 just fine but I want to use 6.

  • Changing iTunes Store accounts with Automatic Downloads

    I use my Mac Mini at home as my media server/HTPC, and contains my iTunes library.  I want to copy all my music to my MacBook Air for work, as my internet at work is too slow for iTunes Match to work effectively.  Therefore, I was going to set Automa

  • When Oracle 9i release 2 for Linux releases?

    Hi all, sorry for my borther, but I really wanna know the exact date that Oracle 9i release 2 for Linux releases? Thanks xiao

  • How to format / erase data on hard disk?

    Hi I have Solaris 9 installed. For some tests I need a HDD without any data on it. (Like a new one, you buy). As I don't have a new hard disk, I'd like to erase the data. How can I do this? Thank you in advance

  • OAM 11g SECOND SERVER INSTALL

    Hello: Has anyone had any luck installing the 2nd OAM 11g server on Linux? I have not seen very good documentation, and have tried to get a 2nd instance going as an EXTENDED DOMAIN with little luck. Anyone?? Help!!