Order by varchar field

Can anyone suggest a way for me to arrange a varchar field which starts with numbers? For example it has the following data in it.
SUBSTR(CB_TEXT,1,3)
0.
1.
10.
2.
3.
3a.
3b.
4.
4a.
4b.
5.
5a.
5b.
5c.
5d.
5e.
5f.
6.
7.
7a.
SUBSTR(CB_TEXT,1,3)
7b.
7c.
8.
8a.
9.
What I'd like to do is force the row starting with '10.' to the end of the list and keep the rest in the same order.
thanks

select
        XXX
     , to_number( substr(XXX, 1, length(XXX) - nvl(length(ltrim(translate(XXX,'0123456789.','___________'),'_')),0)) )  A
     , nvl(substr(XXX, length(XXX) - nvl(length(ltrim(translate(XXX,'0123456789.','___________'),'_')),0) + 1 ),' ')    B
from
            select '0.'    XXX from dual
      UNION select '1.'        from dual
      UNION select '10.'       from dual
      UNION select '2.'        from dual
      UNION select '3.'        from dual
      UNION select '3a.'       from dual
      UNION select '3b.'       from dual
      UNION select '4.'        from dual
      UNION select '4a.'       from dual
      UNION select '4b.'       from dual
      UNION select '5.'        from dual
      UNION select '5a.'       from dual
      UNION select '5b.'       from dual
      UNION select '5c.'       from dual
      UNION select '5d.'       from dual
      UNION select '5e.'       from dual
      UNION select '5f.'       from dual
      UNION select '6.'        from dual
      UNION select '7.'        from dual
      UNION select '7a.'       from dual
) AAA
    order by
      to_number( substr(XXX, 1, length(XXX) - nvl(length(ltrim(translate(XXX,'0123456789.','___________'),'_')),0)) )
     ,nvl(substr(XXX, length(XXX) - nvl(length(ltrim(translate(XXX,'0123456789.','___________'),'_')),0) + 1 ),' ')
0.           0
1.           1
2.           2
3.           3
3a.          3 a.
3b.          3 b.
4.           4
4a.          4 a.
4b.          4 b.
5.           5
5a.          5 a.
5b.          5 b.
5c.          5 c.
5d.          5 d.
5e.          5 e.
5f.          5 f.
6.           6
7.           7
7a.          7 a.
10.         10

Similar Messages

  • Sales order CARRIER TEXT field

    Hi,
    I am creating query through SQVI, I would like to use sales order carrier text field with the query.please advice which table and field should I use for query ?
    Thanks in advance

    Sorry, by mistake I posted the message again.
    Pls ignore it.
    Hi JK,
    Where are u entering the sales order carrier data. Is it Header Data or Item Data. Is it a long text?
    Please give more details.
    Regards,
    Vinod

  • Why do columns not appear in the same order as the fields on my imported form?

    Hello All
    I am an Acrobat X user and make numerous forms through Acrobat.  However, when I import the file into FormsCentral, the order of the fields in the table do not correspond to the order in which they appear on my form.  The fields on my form are in a calendar format so they appear from left-to-right.  I'm wondering if when I do the import, it is read by FormsCentral from top-to-bottom instead or is it random.  It's a real inconvenience and severely inhibits my workflow when I have to rearrange the columns to work with the data.  Any suggestions or insight would be appreciated.
    Thanks
    Daryl

    Files have no order. File management programs like the finder or windows explorer will display files according to your selected display sort. Typically alpha by file name, date created, size, date modified. So to view them in a selected order you need to sort on an attribute that accomplishes that. The easiest usually is to export photos using the sequential naming option then displaying in alpha order
    LN

  • How do I change the order of the fields in my pdf form?

    I am using pdf. form I made in Acrobat and distributing with Adobe FormsCentral.  We use a table format for our teachers to fill out their field trip schedules and therefore use many different fields.
    How can I change the order of the fields (not for tabbing, we figured that out)...so that when we receive our notification email, I can see the inforamtion in a specific order (Date, Time, School, Program, etc).
    We would also like this same order to appear in the "View Responses" table.  I know you can drag and drop the order in the table but we have over 100 fields and that is going to take a really long time.
    Please help???
    DATE
    TIME
    To start/finish
    Name of Program  
    TEACHER’S
    NAME
    TEACHER’S EMAIL
    # OF
    STUDENTS
    Setup in
    Room #
    03-21-14
    Solids vs. Liquids
    03-21-14
    Solids vs. Liquids
    03-21-14
    Solids vs. Liquids
    04-11-14
    Solids vs. Liquids
    04-11-14
    Solids vs. Liquids
    04-11-14
    Solids vs. Liquids

    What do you mean by the "order they appear in the pdf structure"?  What is the "Pdf structure"? 
    thank you for your help... this is really upsetting, as I thought we finally found a solution with Adobe Forms : (
    We really need the fields to report back in a specific order and wouldn't have time to rearrange over 100 fields with every form that is submitted. We receive about 10-20 different forms a day (same form layout, just some of the fields will have to be prefilled depending on school/teacher reservation... so we have to name each form a different name, for each school).
    Thank you again and maybe one day they will change that.  Is there anyway to set it up in the web verison of Adobe FormsCentral to look similar to the table we have created?
    DATE
    TIME
    To start/finish
    Name of Program  
    TEACHER’S
    NAME
    TEACHER’S EMAIL
    # OF
    STUDENTS
    Setup in
    Room #
    03-21-14
    Solids vs. Liquids
    03-21-14
    Solids vs. Liquids
    03-21-14
    Solids vs. Liquids
    04-11-14
    Solids vs. Liquids
    04-11-14
    Solids vs. Liquids
    04-11-14
    Solids vs. Liquids

  • Purchase Order released date field and table name

    Hi,
    Please tell me the  Purchase Order released date field and table name.
    Regards
    Deepak

    Hi,
    Table : EKKO.
    Fields : FRGKE,FRGZU.
    You can get release date of PO from CDHDR  table.
    give object value as your po number and check.dont forget to give leading zeros.
    The udate will be date field and transaction will be me29n for relaesed po.

  • Is it possible to change the order of the fields in the int table?

    Hello
    Is it possible to change the order of the fields in the int table?
    Lets say itab has the following fields :
    F1, F2, F3
    I would like to see it as F2 F3 F1
    Thanks

    >
    Comandante Che Guevara wrote:
    > Lets say itab has the following fields : F1, F2, F3
    >
    > I would like to see it as F2 F3 F1
    What do you mean by "like to see" ? You can WRITE the fields in any order you want. If you want to display the internal table in an ALV you can manipulate the fieldcatalog.
    If you want something else other than display the field, you have to explain your req. in detail.
    BR,
    Suhas

  • How to make a field in sales order a required field

    Hi,
    How do i make a certain field in sales order a required field. I want to make the assignment field in accounting tab a required field. How do i configure this.
    Thank you.
    Rachelle

    In you know the Transaction and screen Variant Configurations.
    Use T-code SHD0
    Put your Sales Order t-code There : Va01
    Then Select the feilds or tabs whatever you want as mandatory , optional.
    Customize as per your requirement and save the variant.
    Next GO to the Sales Document types :
    There In the Transaction flow you will find at variant feild.
    Assign this variant there.
    Next when ever you do sales Order for that Document type the feilds will be taken in the fashion of the variant.
    regards,
    SAP SD

  • How to Generate sales orders with custom Fields using BAPI_BUSPROCESSND_CREATEMULTI

    Hi,
    I need to generate sales orders with custom fields on table CRMD_ORDERADM_H using BAPI_BUSPROCESSND_CREATEMULTI, after changing the structure BAPI_TE_CRMD_ORDERADM_H, and feed the  EXTENSIONIN table of the BAPI with data, the order is created, but any value on custom fields.
    After debuging, I saw that the BAPI search for structure conversion in table CRMC_OBJECTS_GEN, but we haven't entry with BAPI_TE_CRMD_ORDERADM_H in this table. is that the problem ?, Is there any way to fix it?
    Best Regards,
    Salah.

    That depends on where do you have the customer fields, check the table CRMD_CUSTOMER_H, if your custom fields are there, you need to use the changing parameter CUSTOMER_HEAD, I guess your already checked that one, right? but there's no custom fields, well...AET/EEWB doesn't enhance the strcuture of the BAPI, so you should do it manually, check the note following note for further details.
    988410 - FAQ: User-defined fields in the BAPI
    If you don't have access to the SAP Marketplace, in resume you should create an append on the structure BAPIBUS20001_CUSTOMER_H and include the following strcutrue CI_EEW_CUSTOMER_H
    Cheers!
    Luis

  • Best practice to define length for varchar field of table in sql server

    What is best practice to define length for a varchar field in table
    where field suppose Remarks By Person  varchar(max) or varchar(4000)
    Could it affect on optimization in future????
    experts Reply Must ... 
    Dilip Patil..

    Hi Dilip,
    Varchar(n/max) is a variable-length, non-unicode character data. N defines the string length and can be a value from 1 through 8,000. Max indicates that the maximum storage size is 2^31-1 bytes (2 GB). The storage size is the actual length of the data entered
    + 2 bytes. We always use varchar when the sizes of the column data entries vary considerably. While if the filed data size might exceed 8,000 bytes in some way, we should use varchar(max).
    So the conclusion is just like Uri said, use varchar(max) or varchar(4000) is depends on how much characters we are going to store.
    The following document about varchar in SQL Server is for your reference:
    http://technet.microsoft.com/en-us/library/ms176089.aspx
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to add order reason code field to selection screen of VL10

    Hi,
       How to add Order reason code(vbak-augru) to the selection screen of VL10.
      1. How to find enhancement for it?
       2.I want to display Order reason code field on output list also?
      3.Pls give steps i am new to enhancements
    thanking u advance...
    surya

    Hi,
    there is no user exit available for this report program, one alternative is copy the program associated with this standard program i.e. RVV50R10C to a Z program and modify it as per your requirement or if you want to modify the standard program you need access key.
    Regards,
    Raghavendra

  • Comparing 2 varchar fields

    I have a procedure which accepts a varchar field as input and compares it with each value in a table. how do I code it.
    e.g. proc1(xx IN varchar, yy OUT)
    --say column name is abc then
    where abc = xx;
    Dosent giving any output.

    here it goes
    SQL> ED
    Wrote file afiedt.buf
    1 CREATE OR REPLACE PROCEDURE
    2 COMPARE_VARCHAR_FIELDS(XX IN VARCHAR,YY OUT VARCHAR)
    3 IS
    4 A NUMBER:=0;
    5 BEGIN
    6 FOR I IN (SELECT * FROM AX WHERE X=XX)
    7 LOOP
    8 A:=A+1;
    9 END LOOP;
    10 IF A>0 THEN
    11 YY:=XX||' FOUND '||A||' TIMES';
    12 ELSE
    13 YY:=XX||' NOT FOUND';
    14 END IF;
    15* END;
    SQL> /
    PL/SQL procedure successfully completed.
    SQL> ed
    Wrote file afiedt.buf
    1 DECLARE
    2 Z VARCHAR2(40);
    3 BEGIN
    4 COMPARE_VARCHAR_FIELDS('x',z);
    5 dbms_output.put_line(z);
    6* end ;
    SQL> /
    PL/SQL procedure successfully completed.
    SQL> set serveroutput on
    SQL> /
    x FOUND 3 TIMES
    PL/SQL procedure successfully completed.

  • How to change the order of the fields in the queryoutputnode in OVS.

    How to change the order of the fields in the queryoutputnode in OVS.

    The actual requirment is to re-arrange the elements of the queryoutput node, to look more organised
    say for ex.
    Seq 1:
    c code                            company name                          g/l ac                g/l ac description  
    Seq2 :
    g/l ac description             c code                                       g/l ac                company name  
    Seq 1 way of representation is more organised that Seq2. How can we achieve this re-arranging of ordering in the queryoutputnode.

  • Clob's versus Varchar fields

    It's been a day of learning. I found out that when Kodo gets a
    columnlength of -1 for a String field, it will ask the Dictionary for
    the sql for generating a Clob. Also when Kodo finds a positive
    columnlength it will call getLenString on the dictionary.
    We're using MySQL and in this case, when the column-length of a String
    is set to -1 this creates a TEXT field and when the column-length is
    positive this creates a VARCHAR(column-length) field.
    When querying the database, Kodo once again turns to the meta data. When
    the column-length has been set to -1 Kodo does a separate query for each
    text field. If the column-length is positive, Kodo includes the field in
    it's default-fetch-group.
    Am I correct so far?
    The problem I have is that when a query for a certain field is
    performed, I want it to be in the first group fetched. It is always
    needed and not that large at all. It will at most be 1500 characters. In
    SQL Server and possibly others, I can put the column-length at 1500 and
    wind up with a varchar field of 1500 characters long. MySQL however,
    does not support anything over 255 characters for a varchar field.
    So, I need to create a field of type TEXT to allow it to contain more
    than 255 chars. However, I do not want a separate query for the field
    since it won't be that big anyway.
    I've been able to get this working using the column-length -1 at schema
    time and the value 1500 at runtime. This is not at all convenient and
    will very likely result in a wrong schema being created or the wrong
    query being run in the long run.
    Is the solution I just mentioned the only one, or are there other scenarios?
    Thanks in advance,
    Martin van Dijken

    Martin-
    Your analysis is exactly right. Kodo 3.0 allows a lot more latitude in
    how this behavior is defined.
    One way in which you might be able to get around this problem is to
    leave the "column-length" attribute to -1, but manually force the
    mapping to not be the ClobMapping (which is the mechanism by which Kodo
    knows to issue a separate query for the object). You can do this by
    setting the "custom-mapping" field-level metadata extension to
    "com.solarmetric.kodo.impl.jdbc.ormapping.ValueMapping".
    I'll be interested to know if this works for you.
    In article <[email protected]>, Martin van Dijken wrote:
    It's been a day of learning. I found out that when Kodo gets a
    columnlength of -1 for a String field, it will ask the Dictionary for
    the sql for generating a Clob. Also when Kodo finds a positive
    columnlength it will call getLenString on the dictionary.
    We're using MySQL and in this case, when the column-length of a String
    is set to -1 this creates a TEXT field and when the column-length is
    positive this creates a VARCHAR(column-length) field.
    When querying the database, Kodo once again turns to the meta data. When
    the column-length has been set to -1 Kodo does a separate query for each
    text field. If the column-length is positive, Kodo includes the field in
    it's default-fetch-group.
    Am I correct so far?
    The problem I have is that when a query for a certain field is
    performed, I want it to be in the first group fetched. It is always
    needed and not that large at all. It will at most be 1500 characters. In
    SQL Server and possibly others, I can put the column-length at 1500 and
    wind up with a varchar field of 1500 characters long. MySQL however,
    does not support anything over 255 characters for a varchar field.
    So, I need to create a field of type TEXT to allow it to contain more
    than 255 chars. However, I do not want a separate query for the field
    since it won't be that big anyway.
    I've been able to get this working using the column-length -1 at schema
    time and the value 1500 at runtime. This is not at all convenient and
    will very likely result in a wrong schema being created or the wrong
    query being run in the long run.
    Is the solution I just mentioned the only one, or are there other scenarios?
    Thanks in advance,
    Martin van Dijken
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • MRP Generated production orders greys out Sales Order and Customer fields

    Hi there,
    The MRP generated production orders greys out the Sales Order and Customer fields for some reasons. These fields are really important as they link the production order to the sales order and the customer's purchase order. Could the SAP team please fix this or advise alternative way of getting the sales order and customer info on production order? Thanks.

    Hello
    MRP only poulated this fields in case the material master has been set up with a strategy group hich is make to order (normally 20). Otherwise MRP summarizes all the requirements from different Customer orders and creates a production order
    Stephan

  • MRP - Sales order and customer fields grey-out

    Hi there,
    The Sales order and customer fields are grey-out for all MRP generated production orders. Can the SAP programmers please get this fixed? It should either read in the sales order number and the customer number or allow user to type in the sales order, just like the manually created production order.
    cheers

    Hello Gordon,
    If production is make-to-order rather than make-to-stock, the MRP should read in the sales order number and the customer, since it is specific to the sales order. Even for make-to-stock production, where it cannot read in the specific sales order number, it should at least not grey out the field, don't you think so? By greying out the field, users are not allowed to type in the sales order number even when the production order directly relates to a particular sales order. As such, we are not able to link it back to the sales order where other info such as customer's purchase order, etc... can be found.
    Could you please advise alternative way of linking MRP generated production orders to the sales orders? thanks

Maybe you are looking for

  • MDX formula help

    The formula below works just fine but I want to use a UDA driven member in Member Range and need help. IIF( Count( Intersect( {MemberRange( [Jan],[Apr] )}, {[Time].CurrentMember} ) = 1, [Actual], [Forecast]) I tried with IIF( Count( Intersect( {Membe

  • How do I check and modify the outgoing port number

    Charter has changed their settings and I need to set the outgoing port to 465. How do I do that?

  • JSP-JDBC Help

    Hi everone, Can you please let me know how can I insert "-" or "+" into my sql Database. for example the code bellow, imagin c =10, taken from the user, I want to insert C as "-10" or "+10" into databse String str= "insert into table values ('"+a+"',

  • EMD_MAINTENANCE.EXECUTE_EM_DBMS_JOB_PROCS(); has broken.

    Hi, im getting below error in my database .. can you any one tell me tips or provide me usefull link .. EMD_MAINTENANCE.EXECUTE_EM_DBMS_JOB_PROCS(); has broken. Database :10.2.0 .4 OS :sun

  • Not able stop the SOA suite

    hi, when i am trying to stop the soa i am getting the following error. but the components OC4JGroup:default_group and ASG are showing down. in status bar after 33% the following error is coming. Configuration information Running in D:\product\10.1.3.