Alphanumeric counter

Hi,
I need to write a query / function for an alphanumeric counter that would work as below:
A000
A001
A002
A003
A004
A005
A006
A007
A008
A009
A00A
A00B
A00C
A00Y
A00Z
A010
A011
A019
A01A
A01B
This would mean that the next value after Z999 would be Z99A
Is it possible to get this in a single query?
Regards

David_Aldridge wrote:
Too often these forums looks like a SQL obfuscation challenge.Well, not sure about Karthick's solution, but I thought mine was fairly straightforward. It could be simplified to...
SQL> ed
Wrote file afiedt.buf
  1  with t as (select rownum rn from dual connect by rownum <= 2000)
  2      ,x as (select '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' as str from dual)
  3  --
  4  -- end of test data
  5  --
  6  select t.rn
  7        ,substr(str,trunc(mod(rn+466559,1679616)/46656)+1,1)||
  8         substr(str,trunc(mod(rn+466559,46656)/1296)+1,1)||
  9         substr(str,trunc(mod(rn+466559,1296)/36)+1,1)||
10         substr(str,mod(rn+466559,36)+1,1)
11* from t, x
SQL> /
        RN SUBS
         1 A000
         2 A001
         3 A002
         4 A003
         5 A004
         6 A005
         7 A006
         8 A007
         9 A008
        10 A009
        11 A00A
        12 A00B
        13 A00C
        14 A00D
        15 A00E
        16 A00F
.but it seemed more readable to me to include all the "36*36..." so that it was clear where the values came from.
Edit: Or even this?
SQL> ed
Wrote file afiedt.buf
  1  with t as (select rownum rn from dual connect by rownum <= 2000)
  2      ,x as (select '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' as str from dual)
  3  --
  4  -- end of test data
  5  --
  6  select t.rn
  7        ,substr(str,trunc(mod(rn+(10*power(36,3))-1,power(36,4))/power(36,3))+1,1)||
  8         substr(str,trunc(mod(rn+(10*power(36,3))-1,power(36,3))/power(36,2))+1,1)||
  9         substr(str,trunc(mod(rn+(10*power(36,3))-1,power(36,2))/36)+1,1)||
10         substr(str,mod(rn+(10*power(36,3))-1,36)+1,1)
11* from t, x
SQL> /
        RN SUBS
         1 A000
         2 A001
         3 A002
         4 A003
         5 A004
         6 A005
         7 A006
         8 A007
         9 A008
        10 A009
        11 A00A
        12 A00B
        13 A00C
        14 A00D
        15 A00E
        16 A00F
        17 A00G
        18 A00H
        19 A00I
        20 A00J
        21 A00K
        22 A00L
        23 A00M
        24 A00N
.

Similar Messages

  • How to Count number of words in a file....

    Hi Experts,
    I have uploaded the text file, from the application server, like this: 
    call function 'GUI_UPLOAD'
      exporting
        filename = LV_ip_FILENAME
      tables
        data_tab = LT_FILETABLE.
    The text file contains some number character words....  like "sap labs india..... "
    Now, I wanted to count number of words in an internal table  LT_FILETABLE....  can anybody help me?

    Hi,
    Special Characters in Regular Expressions
    The following tables summarize the special characters in regular expressions:
    Escape character
    Special character Meaning
    Escape character for special characters
    Special character for single character strings
    Special character Meaning
    . Placeholder for any single character
    C Placeholder for any single character
    d Placeholder for any single digit
    D Placeholder for any character other than a digit
    l Placeholder for any lower-case letter
    L Placeholder for any character other than a lower-case letter
    s Placeholder for a blank character
    S Placeholder for any character other than a blank character
    u Placeholder for any upper-case letter
    U Placeholder for any character other than an upper-case letter
    w Placeholder for any alphanumeric character including _
    W Placeholder for any non-alphanumeric character except for _
    [ ] Definition of a value set for single characters
    [^ ] Negation of a value set for single characters
    [ - ] Definition of a range in a value set for single characters
    [ [:alnum:] ] Description of all alphanumeric characters in a value set
    [ [:alpha:] ] Description of all letters in a value set
    [ [:blank:] ] Description for blank characters and horizontal tabulators in a value set
    [ [:cntrl:] ] Description of all control characters in a value set
    [ [:digit:] ] Description of all digits in a value set
    [ [:graph:] ] Description of all graphic special characters in a value set
    [ [:lower:] ] Description of all lower-case letters in a value set
    [ [:print:] ] Description of all displayable characters in a value set
    [ [:punct:] ] Description of all punctuation characters in a value set
    [ [:space:] ] Description of all blank characters, tabulators, and carriage feeds in a value set
    [ [:unicode:] ] Description of all Unicode characters in a value set with a code larger than 255
    [ [:upper:] ] Description of all upper-case letters in a value set
    [ [:word:] ] Description of all alphanumeric characters in a value set, including _
    [ [:xdigit:] ] Description of all hexadecimal digits in a value set
    a f
          v Diverse platform-specific control characters
    [..] Reserved for later enhancements
    [==] Reserved for later enhancements
    u2192 More
    Special characters for character string patterns
    Special character Meaning
    Concatenation of n single characters
    {n,m} Concatenation of at least n and a maximum of m single characters
    {n,m}? Reserved for later enhancements
    ? One or no single characters
    Concatenation of any number of single characters including 'no characters'
    *? Reserved for later enhancements
    + Concatenation of any number of single characters excluding 'no characters'
    +? Reserved for later enhancements
    | Linking of two alternative expressions
    ( ) Definition of subgroups with registration
    (?: ) Definition of subgroups without registration
    1, 2, 3 ... Placeholder for the register of subgroups
    Q ... E Definition of a string of literal characters
    (? ... ) Reserved for later enhancements
    for more details please refer the following,
    [http://help.sap.com/abapdocu_70/en/ABENREGEX_SYNTAX_SIGNS.htm]
    [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/902ce392-dfce-2d10-4ba9-b4f777843182?QuickLink=index&overridelayout=true]
    Thanks,
    Renuka S.

  • How to get a distinct count of multiple columns

    I've done this before and I'll be darned why I can't recall this.
    Table with 3 columns with the primary key defined in column a.
    Row a b c
    num.
    1 020 how abc
    2 030 why def
    3 010 not ghi
    4 040 how abc
    5 050 yes def
    6 060 why def
    So what I want is a count of the unique values for columns b and c as if b and c were actually one field.
    So the result of the query would be:
    Count = 4 unique rows.
    Hopefully I'm making some sort of sense. It's a bit much to ask about the number of occurrences of each duplicate value, I'm sure just getting count of the unique rows of the non-indexed rows will be sufficient. Since the query is meant to be universal for multiple columns of numeric and alphanumeric data and can be expanded for multiple columns, I am simply trying to get a basic skeleton that works for an "on the fly" analysis.

    Thanks to all of you. I had the idea and just couldn't nail it down. You did it.
    All of you understood what I poorly communicated. My apologies for the lack of prep with a table, I was running patches on the system and couldn't dare interrupt it on my laptop and starting Oracle 11 while Micro$lop was patching all sorts of evil code. This is something I'm setting up on my own time so it's a work I'm going to try to be proud of. So there will be plenty of instrumentation and debugging code for timing.
    I'd thought of concatenating columns and was worried it wouldn't backport to older Oracle versions (work goes back to 8.1.7) with nulls and other goofy things like long raw fields or lob/clobs plus the other DBs that are at various sites. What I'm trying to do is improve on a crappy data analysis tool SAP provides to use with reporting unique columns. (Basis people could recognize this as DB05). I tried dragging out the SQL that their ABAP/4 language generates from an SQL trace but it was unusable and often dies on internal storage which on most sites is about 4GB per process. Needless to say, the program is wasteful and I'm trying to keep the work on the DB where it belongs and discourage cowboys from doing this in the DB on the fly and at the same time make it simpler for junior members to use while having a semblance of an audit trail.
    What I'm trying to do is work out a tool that checks all the crappy secondary indexes that were created by folks who seem to think in ways that are from an alien species not yet speculated about even with the strongest psychedelics. One of them actually decreases performance by a minimum factor of 5. It's not much when it's 5 seconds but when the response time averages about 3 hours beforehand, you can imagine what it was like afterward. In this particular case, the "logic" was that the index needed to be defined by the order of the fields of the select clause. Some myths never die. So it's not easy to work out which ones haven't been used in a long time, so it's down to finding which of the custom ones are actually bad in terms of selectivity. Some of these may have made a little bit of sense when the system was started up, now that some of these have millions of rows instead of a few thousand, thaw tend to expose the flaws in design.
    I'm also trying to make this work on multiple DBs such as DB2, MaxDB and (sob) SQL Squealer. The idea is to write this in ABAP code as a utility without the overhead of internal tables in ABAP as some of these tables are many millions of rows and I have to account for the size in memory. (ABAP field sizes in internal memory are generally much larger than the actual DB lengths. so every bit helps!) So I'm trying to create actual SQL on the fly and use it internally without going through the SAP DB interface which limits the type of SQL functions used and all the overhead. It's intended to grab a secondary index and if there are more than 2 fields defined, work it backwards to show unique values for all columns, all columns - 1, all columns - 2 and so on back to the initial column in the index.
    Why does this seem important? On Oracle I can generate histograms but those can often screw up SAP. On other DBs, the indexing cardinality is much more important, particularly with DB optimizers that make some odd decisions. So I need evidence I can push to folks who will only understand if there's a plain and simple analysis that explains it (almost) in crayon.
    I'm testing null values next (which worked!) but these suggestions all seem to follow the same idea which won't work in ABAP without some serious memory issues. So I'm down to this type of coding:
    exec sql.
    <dynamically generated true SQL>
    end-exec.
    rather than using ABAP with their concept of "open SQL" and the DB interface with all the overhead.
    RB's suggestion of the UNION ALL wasn't quite what I was looking for BUT it made me think that this would be a nice enhancement for evaluations!
    So the candidates that seem to work for what I wanted are as follows:
    SQL> SELECT COUNT (MIN (0)) AS distinct_col3_col4_cnt
    2 from rb group by b, c;
    DISTINCT_COL3_COL4_CNT
    7
    select count(distinct(b || c)) num_rows from rb;
    So thanks also to Frank, APNL and Nimesh for their examples. Now the fun starts as I spec out the processing.

  • Record Counter in trailer for DMEE 005 Canada

    Hi , We have 2 originator ID for one bank account when we run F110 with vendors with invoices in USD & CAD we have in the same file 2 blocks one with CAD and other with USD we have Header + Detail + Trailer for both
    The issue we have is with the counter of the Trailer 2 . In the DMEE setting is looking for Reference Tree node and the tree node is the top level DMEE. The probleme is in the last trailer if I have total of 9 lines with CAD + USD the counter put 10 but in fact only for USD I have 3 lines . The counter should put 3 and not the total of all
    Do you have few solution to fix this issue . We try to change the Reference Tree and used aggregation but we don<t find the right solution. I need to pick the header and I'm not able to put Ref ID on Header

    Hi Frédéric,
    Check if note 1262855 can help you with this issue.
    The trailer must be filled only from the position 69 to 112 with zeros,
    the Filler from the position 113 to 1352 is alphanumeric, that means it
    must be filled with spaces. I believe implementing note 1262855  will help.
    Kind Regards,
    Fernando Evangelista

  • Alphanumeric Code Generation

    Hi all,
    How to generate alphanumeric unique code depending on the count of records...
    e.g. I want to have the code like AAAA, AAAB, AAAC .... AAAZ, AABA, AABB...AABZ, AACA etc. Can a single statement work here ? I don't want to limit the code, thats why I m asking the code based on number of records.
    Another question is that, how to generate the serial # with the records in a select statement... I forgot the method ... something ROW_NO/ROWCOUNT...
    Any help would be appreciated.
    Thanx
    Zaaf.

    This is the category of problem we call Interesting but stupid. I really cannot see a valid business for this - in particular the idea of generating serial numbers on the fly is worrying, because you've got no consistency from one query to the next. However, having started to think about the problem I couldn't let go of it.
    So here is the solution. Basically we have to convert the ROWNUM, which is in base 10, to letters, which is in base 26. I wrote a little function to do that. Note that in base 26 A=0, B=1 whereas in your example I think you're using A to represent 1.
    CREATE OR REPLACE FUNCTION n2a
       (pn_number IN NUMBER)
       RETURN VARCHAR2
    AS
      ln number;
      remainder number;
      return_value VARCHAR2(200);
      x number;
      letter number;
      alphabet CONSTANT varchar2(26) := 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
    BEGIN
      ln := length(pn_number);
      remainder := pn_number;
      return_value := NULL;
      FOR i IN REVERSE 1..ln
      LOOP
         x := power(26, i-1);
         letter := round(remainder/x, 0);
         return_value := return_value||substr(alphabet, letter+1,1);
         remainder := mod(remainder,x);
      END LOOP;
      RETURN return_value;
    END;
    [/code]
    and the output:
    [code]
    SQL> select n2a(rownum) from t1;
    N2A(ROWNUM)
    B
    C
    D
    E
    F
    G
    6 rows selected.
    SQL>
    [/code]
    I make no claims for the performance of this if you've got a large table.
    cheers, APC                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • NAD010 data type must be 'Alphanumeric' in EDIFACT D96A INVOIC

    Hi B2B GURUS,
    I am new to B2B, I was trying to integrate EDIFACT D96A INVOIC from BPEL to B2B.
    I got below error in B2B:Can some one please help on this.
    Element NAD010 data type must be 'Alphanumeric'. Segment NAD is defined in the guideline at position 0120.{br}{br}This error was detected at:{br}{tab}Segment Count: 6{br}{tab}Element Position: 3 {br}{tab}Characters: 2012 through 2049
    XML published to B2B ==>
    <Invoke_SendInvoiceToB2b_Enqueue_InputVariable_1><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Transaction-INVOIC"><Transaction-INVOIC xmlns:ns1="urn:oracle:integration:b2b:EB1F987EE11A4A3E98E3345554E5DB13" Standard="EDIFACT" Version="VD96A" GUID="{2d333538-3630-3735-3039-313132343638}" xmlns="urn:oracle:integration:b2b:EB1F987EE11A4A3E98E3345554E5DB13">
    <ns1:Segment-UNH>
    <ns1:Element-0062>3210012325</ns1:Element-0062>
    <ns1:Composite-S009>
    <ns1:Element-0065>INVOIC</ns1:Element-0065>
    <ns1:Element-0052>D</ns1:Element-0052>
    <ns1:Element-0054>96A</ns1:Element-0054>
    <ns1:Element-0051>UN</ns1:Element-0051>
    <ns1:Element-0057>EAN008</ns1:Element-0057>
    </ns1:Composite-S009>
    </ns1:Segment-UNH>
    <ns1:Segment-BGM>
    <ns1:Composite-C002>
    <ns1:Element-1001>380</ns1:Element-1001>
    </ns1:Composite-C002>
    <ns1:Element-1004>3210000019</ns1:Element-1004>
    </ns1:Segment-BGM>
    <ns1:Segment-DTM>
    <ns1:Composite-C507>
    <ns1:Element-2005>137</ns1:Element-2005>
    <ns1:Element-2380>21120821</ns1:Element-2380>
    <ns1:Element-2379>102</ns1:Element-2379>
    </ns1:Composite-C507>
    </ns1:Segment-DTM>
    <ns1:Loop-Group_1>
    <ns1:Segment-RFF>
    <ns1:Composite-C506>
    <ns1:Element-1153>VN</ns1:Element-1153>
    <ns1:Element-1154>3210012325</ns1:Element-1154>
    </ns1:Composite-C506>
    </ns1:Segment-RFF>
    <ns1:Segment-DTM>
    <ns1:Composite-C507>
    <ns1:Element-2005>171</ns1:Element-2005>
    <ns1:Element-2380>21120821</ns1:Element-2380>
    <ns1:Element-2379>102</ns1:Element-2379>
    </ns1:Composite-C507>
    </ns1:Segment-DTM>
    </ns1:Loop-Group_1>
    <ns1:Loop-Group_2>
    <ns1:Segment-NAD>
    <ns1:Element-3035>BY</ns1:Element-3035>
    <ns1:Composite-C082>
    <ns1:Element-3039>541218011234</ns1:Element-3039>
    <ns1:Element-3055>9</ns1:Element-3055>
    </ns1:Composite-C082>
    <ns1:Composite-C058>
    <ns1:Element-3124>Flex ABC Division GH-94404</ns1:Element-3124>
    </ns1:Composite-C058>
    <ns1:Composite-C080>
    <ns1:Element-3036>ABC ABC Ltd</ns1:Element-3036>
    </ns1:Composite-C080>
    <ns1:Composite-C059>
    <ns1:Element-3042>tyu Wei 45</ns1:Element-3042>
    </ns1:Composite-C059>
    <ns1:Element-3164>werentem</ns1:Element-3164>
    <ns1:Element-3251>B-455</ns1:Element-3251>
    <ns1:Element-3207>BE</ns1:Element-3207>
    </ns1:Segment-NAD>
    </ns1:Loop-Group_2>
    <ns1:Loop-Group_7>
    <ns1:Segment-CUX>
    <ns1:Composite-C504>
    <ns1:Element-6347>2</ns1:Element-6347>
    <ns1:Element-6345>EUR</ns1:Element-6345>
    <ns1:Element-6343>4</ns1:Element-6343>
    </ns1:Composite-C504>
    </ns1:Segment-CUX>
    </ns1:Loop-Group_7>
    <ns1:Loop-Group_8>
    <ns1:Segment-PAT>
    <ns1:Element-4279>5</ns1:Element-4279>
    <ns1:Composite-C110>
    <ns1:Element-4277>30</ns1:Element-4277>
    </ns1:Composite-C110>
    <ns1:Composite-C112>
    <ns1:Element-2475/>
    <ns1:Element-2009/>
    <ns1:Element-2151>D</ns1:Element-2151>
    <ns1:Element-2152>30</ns1:Element-2152>
    </ns1:Composite-C112>
    </ns1:Segment-PAT>
    <ns1:Segment-DTM>
    <ns1:Composite-C507>
    <ns1:Element-2005>12</ns1:Element-2005>
    <ns1:Element-2380/>
    <ns1:Element-2379>102</ns1:Element-2379>
    </ns1:Composite-C507>
    </ns1:Segment-DTM>
    <ns1:Segment-PCD>
    <ns1:Composite-C501>
    <ns1:Element-5245>12</ns1:Element-5245>
    <ns1:Element-5482/>
    </ns1:Composite-C501>
    </ns1:Segment-PCD>
    <ns1:Segment-MOA>
    <ns1:Composite-C516>
    <ns1:Element-5025>21</ns1:Element-5025>
    <ns1:Element-5004/>
    </ns1:Composite-C516>
    </ns1:Segment-MOA>
    </ns1:Loop-Group_8>
    <ns1:Loop-Group_25>
    <ns1:Segment-LIN>
    <ns1:Element-1082>1</ns1:Element-1082>
    </ns1:Segment-LIN>
    <ns1:Segment-PIA>
    <ns1:Element-4347>NH</ns1:Element-4347>
    <ns1:Composite-C212_1>
    <ns1:Element-7140>LDI323010</ns1:Element-7140>
    </ns1:Composite-C212_1>
    </ns1:Segment-PIA>
    <ns1:Segment-IMD>
    <ns1:Element-7077>F</ns1:Element-7077>
    <ns1:Element-7081>DSC</ns1:Element-7081>
    <ns1:Composite-C273>
    <ns1:Element-7008>ABCD IND/ Lux</ns1:Element-7008>
    </ns1:Composite-C273>
    </ns1:Segment-IMD>
    <ns1:Segment-QTY>
    <ns1:Composite-C186>
    <ns1:Element-6063>46</ns1:Element-6063>
    <ns1:Element-6060>10</ns1:Element-6060>
    </ns1:Composite-C186>
    </ns1:Segment-QTY>
    <ns1:Loop-Group_28>
    <ns1:Segment-PRI>
    <ns1:Composite-C509>
    <ns1:Element-5125>AAA</ns1:Element-5125>
    <ns1:Element-5118>769.31</ns1:Element-5118>
    </ns1:Composite-C509>
    </ns1:Segment-PRI>
    </ns1:Loop-Group_28>
    <ns1:Loop-Group_29>
    <ns1:Segment-RFF>
    <ns1:Composite-C506>
    <ns1:Element-1153>ON</ns1:Element-1153>
    <ns1:Element-1154>3210000025</ns1:Element-1154>
    <ns1:Element-1156>1</ns1:Element-1156>
    </ns1:Composite-C506>
    </ns1:Segment-RFF>
    </ns1:Loop-Group_29>
    <ns1:Loop-Group_33>
    <ns1:Segment-MOA>
    <ns1:Composite-C516>
    <ns1:Element-5025>124</ns1:Element-5025>
    <ns1:Element-5004>461.59</ns1:Element-5004>
    </ns1:Composite-C516>
    </ns1:Segment-MOA>
    </ns1:Loop-Group_33>
    <ns1:Loop-Group_38>
    <ns1:Loop-Group_43>
    <ns1:Segment-TAX>
    <ns1:Element-5283>7</ns1:Element-5283>
    <ns1:Composite-C243>
    <ns1:Element-5278>6</ns1:Element-5278>
    </ns1:Composite-C243>
    <ns1:Element-5305>S</ns1:Element-5305>
    </ns1:Segment-TAX>
    </ns1:Loop-Group_43>
    </ns1:Loop-Group_38>
    </ns1:Loop-Group_25>
    <ns1:Loop-Group_50>
    <ns1:Segment-MOA>
    <ns1:Composite-C516>
    <ns1:Element-5004/>
    </ns1:Composite-C516>
    </ns1:Segment-MOA>
    </ns1:Loop-Group_50>
    <ns1:Segment-UNT>
    <ns1:Element-0074>#SegmentCount#</ns1:Element-0074>
    <ns1:Element-0062>3210000019</ns1:Element-0062>
    </ns1:Segment-UNT>
    </Transaction-INVOIC>
    </part></Invoke_SendInvoiceToB2b_Enqueue_InputVariable_1>

    Hi Vikky,
    Glad that it worked but I am wondering why alphanumeric will allow only UPPERCASE characters. It works properly for me with lowercase characters as well. If you don't mind, can you please forward your ecs, xsd and the sample payload to my id (in my profile). Just want to check where is the gap.
    Regards,
    Anuj

  • Code to check whether a given string contains alphanumeric

    Can anyone post the Code to check whether a given string contains only alphanumeric and no special characters

    <Rule name='isAlphaNumericString'>
    <RuleArgument name='testStr'/>
    <block>
    <defvar name='counter'>
    <i>0</i>
    </defvar>
    <defvar name='splitString'>
    <while>
    <lt>
    <ref>counter</ref>
    <length>
    <ref>testStr</ref>
    </length>
    </lt>
    <append name='splitList'>
    <substr>
    <ref>testStr</ref>
    <ref>counter</ref>
    <i>1</i>
    </substr>
    </append>
    <set name='counter'>
    <add>
    <ref>counter</ref>
    <i>1</i>
    </add>
    </set>
    </while>
    <ref>splitList</ref>
    </defvar>
    <containsAll>
    <list>
    <s>A</s>
    <s>B</s>
    <s>C</s>
    <s>D</s>
    <s>E</s>
    <s>F</s>
    <s>G</s>
    <s>H</s>
    <s>I</s>
    <s>J</s>
    <s>K</s>
    <s>L</s>
    <s>M</s>
    <s>N</s>
    <s>O</s>
    <s>P</s>
    <s>Q</s>
    <s>R</s>
    <s>S</s>
    <s>T</s>
    <s>U</s>
    <s>V</s>
    <s>W</s>
    <s>X</s>
    <s>Y</s>
    <s>Z</s>
    <s>a</s>
    <s>b</s>
    <s>c</s>
    <s>d</s>
    <s>e</s>
    <s>f</s>
    <s>g</s>
    <s>h</s>
    <s>i</s>
    <s>j</s>
    <s>k</s>
    <s>l</s>
    <s>m</s>
    <s>n</s>
    <s>o</s>
    <s>p</s>
    <s>q</s>
    <s>r</s>
    <s>s</s>
    <s>t</s>
    <s>u</s>
    <s>v</s>
    <s>w</s>
    <s>x</s>
    <s>y</s>
    <s>z</s>
    <s>0</s>
    <s>1</s>
    <s>2</s>
    <s>3</s>
    <s>4</s>
    <s>5</s>
    <s>6</s>
    <s>7</s>
    <s>8</s>
    <s>9</s>
    </list>
    <ref>splitString</ref>
    </containsAll>
    </block>
    </Rule>
    It Retruns 1 if it contains only alphanumeric otherwise 0

  • Generate random alphanumeric string as pk

    Hallo,
    I want to generate a random and unique alphanumeric string (4-digit).
    Uniqueness is very important, because it will be used as primary key.
    Is this supported by oracle 10?

    You can try the sys_guid function:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for Linux IA64: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    SQL> select sys_guid() from dual;
    SYS_GUID()
    439F46B40AAAFB59E04014ACAE650DC1
    SQL> create table guid_tbl(str varchar2(300), constraint guid_tbl_pk primary key
    (str));
    Table created.
    SQL> begin
      2  for i in 1..1000 loop
      3     insert into guid_tbl(str) values(sys_guid());
      4  end loop;
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL> select count(*) from guid_tbl;
      COUNT(*)
          1000
    SQL>Amiel

  • Special alphanumeric order

    Hello altogether,
    I've got a table that looks like the following
    | ID | Text1 | Text2 |
    ==============
    |001|'ABC' | 'HIJ' |
    |002|'ABC' | 'HIJ' |
    |010|'ABC' | 'HIJ' |
    |012|'ABC' | 'HIJ' |
    |0A4|'ABC' | 'HIJ' |
    |0A6|'ABC' | 'HIJ' |
    |3FR|'ABC' | 'HIJ' |
    |3FX|'ABC' | 'HIJ' |
    I want to query these values, ordered by the ID. The ID is always 3 characters alphanumeric, it starts with 000 and ends with ZZZ.
    The order must be as following:
    1. 000 to 009
    2. 010 to 019
    3. 100 to 109
    4. 110 to 119
    5. 900 to 999
    Now the alphanumeric values come
    6. 00A to 00Z
    7. 01A to 01Z
    8. 09A to 09Z
    Now the first char is counted from 0 to 9
    9. 10A to 10Z
    10. 11A to 11Z
    11. 19A to 19Z
    12. 20A to 20Z
    13. 21A to 21Z
    14. 90A to 90Z
    15. 99A to 99Z
    Now the alphanumeric values on the second char begin
    16. 0A0 to 0A9
    17. 0B0 to 0B9
    18. 0Z0 to 0Z9
    Now alphanumeric at the last char
    19. 0AA to 0AZ
    20. 0BA to 0BZ
    21. 0ZA to 0ZZ
    Now increase on first col.
    22. 1A0 to 0A9
    23. 1B0 to 0B9
    24. 1Z0 to 0Z9
    Now alphanumeric at the last char
    25. 1AA to 0AZ
    26. 1BA to 0BZ
    27. 1ZA to 0ZZ
    This up to 9AA to 9ZZ, and then all that again with alphanumeric at the beginning.
    I really do not have any idea, how to implement this in Oracle.
    It anyone has an idea, you would help me a lot!
    Best regards,
    Daniel

    Hi Terry,
    Check this link
    http://help.sap.com/saphelp_sbo2007a/helpdata/en/44/f29326df7365fbe10000000a1553f7/content.htm
    Regards
    Jambulingam.P

  • Find remaining serial numbers left in Alphanumeric range

    Can anyone help me with this.
    Say there are two alphanumeric sequences 1234A1B  And 1234B1B . The no. of series between them are to be found.
    Say between 1234A1B and 1234B1B there are 26 numbers like 1234A1C,1234A1D,…1234A1Z,123B1B..In this case the output would be 26.The number of series in between are to be calculated.
    The length of both the sequences is less than 18 and contain alphabets and numbers in them in random fashion e.g 1234A3D -1234C7E(The number series existing  between these two numbers should be counted).
    Thanks in Advance
    Rijish

    Rijish,
    First, a question.  In your example, the "from" and the "to" are both 7 characters, and you are considering only 7-character values between them.  But is not 1234A1BA (8 characters) alphabetically between 1234A1B and 1234A1B?  Or are you regarding the alphanumerics somehow as numbers?
    Second, another question.  Have you mistyped your example?  You seem to imply that 123B1B comes after 1234A1Z.  Do you mean that 1234B1B comes right after 1234A1Z?  That would be confusing too.
    Third, another question.  The characters allowed are A-Z and 0-9 only (36 in all)?  And their order (lowest first) is 0123..89ABC...XYZ?
    Fourth, a warning.  The number of such serial numbers possible is rather large.  It is, I think, a 27-figure number.  So you need to consider the data type for holding  the answer to your calculation.
    I may be able to help more if you can clarify your meaning.
    John

  • Order of delivery schedule line counter at schedule agreements from MRP run

    Currently we are using schedule agreements for our long term external suppliers, but we are facing a problem with the order of new delivery schedule lines created during MRP run.
    Because of master data settings like, lot size, rounding value, plan delivery time and planning time fence to set as firm new requirements, multiple schedule lines are created with no order for schedule line counter.
    Does anyone is aware of a BADI, user exit or customizing control to have this schedule line counter in order?
    Thank you
    Daniel Guillen
    IT
    Skyworks Inc.

    Hi,
    Pls put this query in SD fourms  and get immly help because this is technical fourms.
    Anil

  • Help Counting Vowels and Consonants using a class

    I'm currently working on a class project where I need take a user inputed string and count how many vowels and/or consonants are in the String at the user discretion. I have the main logic program working fine. However, the trouble I'm running into is how to take the string the user inputed and pass that data into the class method for counting.
    Here is the code for the program:
    package vowelsandconsonants;
    import java.util.Scanner;
    public class VowelConsCounter {
        public static void main(String[] args) {
            String input; //User input
            char selection; //Menu selection
            //Create a Scanner object for keyboard input.
            Scanner keyboard = new Scanner(System.in);
            //Get the string to start out with.
            System.out.print("Enter a string: ");
            input = keyboard.nextLine();
            //Create a VowelCons object.
            VowelCons vc = new VowelCons(input);
            do {
                // Display the menu and get the user's selection.
                selection = getMenuSelection();
                // Act on the selection
                switch (Character.toLowerCase(selection)) {
                    case 'a':
                        System.out.println("\nNumber of Vowels: " +
                                vc.getNumVowels());
                        break;
                    case 'b':
                        System.out.println("\nNumber of consonats: " +
                                vc.getNumConsonants());
                        break;
                    case 'c':
                        System.out.println("\nNumber of Vowels: " +
                                vc.getNumVowels());
                        System.out.println("Number of consonants: " +
                                vc.getNumConsonants());
                        break;
                    case 'd':
                        System.out.print("Enter a string: ");
                        input = keyboard.nextLine();
                        vc = new VowelCons(input);
            } while (Character.toLowerCase(selection) != 'e');
         * The getMenuSelection method displays the menu and gets the user's choice.
        public static char getMenuSelection() {
            String input;  //To hold keyboard input
            char selection;  // The user's selection
            //Create a Scanner object for keyboard input.
            Scanner keyboard = new Scanner(System.in);
            //Display the menu.
            System.out.println("a) Count the number of vowels in the string.");
            System.out.println("b) Count the number of consonants in the string.");
            System.out.println("c) Count both the vowels and consonants in the string.");
            System.out.println("d) Enter another string.");
            System.out.println("e) Exit the program.");
            //Get the user's selection
            input = keyboard.nextLine();
            selection = input.charAt(0);
            //Validate the input
            while (Character.toLowerCase(selection) < 'a' ||
                    Character.toLowerCase(selection) > 'e') {
                System.out.print("Only enter a,b,c,d or e:");
                input = keyboard.nextLine();
                selection = input.charAt(0);
            return selection;
    class VowelCons {
        private char[] vowels;
        private char[] consonants;
        private int numVowels = 0;
        private int numCons = 0;
        public VowelCons(String str) {
        public int getNumVowels() {
            return numVowels;
        public int getNumConsonants() {
            return numCons;
        private void countVowelsAndCons() {
            for (int i = 0; i < total; i++) {
                char ch = inputString.charAt(i);
                if ((ch == 'a') || (ch == 'A') || (ch == 'e') || (ch == 'E') || (ch == 'i') || (ch == 'I') || (ch == 'o') || (ch == 'O') || (ch == 'u') || (ch == 'U')) {
                    numVowels++;
                } else if (Character.isLetter(ch)) {
                    numCons++;
    }The UML given to me by my instructor calls for the counting method to be private. Being that I'm not too familiar with Java syntax I did not know if that may cause a problem with passing the user's input into that method.

    Well the only compilers i get are due to the code:
    private void countVowelsAndCons() {
            for (int i = 0; i < total; i++) {
                char ch = inputString.charAt(i);
                if ((ch == 'a') || (ch == 'A') || (ch == 'e') || (ch == 'E') || (ch == 'i') || (ch == 'I') || (ch == 'o') || (ch == 'O') || (ch == 'u') || (ch == 'U')) {
                    numVowels++;
                } else if (Character.isLetter(ch)) {
                    numCons++;
        }However, that is due to the fact that i have no data for those variables to use. I'm pretty much stuck on how to get the string the user inputs into that method shown above so the code can perform the task of counting the vowels and consonants.
    If i comment out the code within that function the program compiles and will allow me to enter the string and use the options but since i can't figure out how to pass the input to the counting method the program returns 0 for everything.

  • How to count number of Characteristics' with the same value?

    Hello, Everybody,
    In InfoCube I have data:
    person ID (characteristic), points (key figure), gendre (characteristic), org.unit (characteristic)
    1313; 10; F;5001
    1313; 10; M;5001
    1313; 12; F;5001
    1313; 6; M;5001
    1515;20;F;5001
    Report,  with data from this InfoCube, should look like this:
    org.unit/number of employees, 6 points, 10 points, 12 points, 20 points
    5001, 1, 2, 1, 1
    Could you give me a suggestion how I can count the number of employees?
    Thanks in advance!
    Best Regards,
    Arunas Stonys

    Arunas,
    you can crate 4 CKF one each for employee points, and in each of the CKY have a data function value =1 if <your condition is satisfied>. This way the CKY will have a value of 1 if point is 6 for the first CKY and similarly for the rest and use exception aggregation based on person ID to count the no. of employees with that particular point in the Org unit. Use org unit in the rows and these 4 CKY in the columns and you should be able to get the report.
    hope this helps.
    Regards,
    Aashish
    Edited by: Aashish Kalra on Jan 6, 2009 12:31 AM

  • After using "consolidate library" to move my media to a NAS the items counts do not match.  How do I find what is different the easiest way??

    I wanted to move my itunes media on my imac to a NAS drive.  I used the advance preferences to change the folder to the folder on the NAS.  I then went to the "organize library" setting to consolidate.
    When I compare the two folders, the music folders are different (807 items in the old to 798 items in the new), mobile applications are different (143 in the old to 153 in the new), Movies are different (321 items in the old, 324 in the new).
    I think I already had the entire folder organized the way itunes wanted it.  I'm not sure why the count would increase or to easily make sure I'm not missing any info.
    Any suggestions?
    Thanks.

    Actually, a little off on the situation as I originally described.
    Compared the old items counts to the new item counts:
    1. The music folder increased in item counts.
    2.  Books is identical.
    3.  Mobile apps decreased by 10 on the new.
    4.  Movies decreased by 3.

  • Increase counter frequency performanc​e

    Hello,
    I want to increase the frequency performance for my period counter. I'm using a USB-6210 board and I have the vi that is attached - period measurement.
    The problem is that I want to measure the period for a 8MHz signal (I know that is a lot, I would be happy even with 4MHz). The source freq for the counter is 80Hz. If the frequency is high, the accuracy is not very critical for me.
    1. I get most of the time the error: "Buffer overwritten". I've seen that I can get rid of it if I decrease the frequency, but I don't want to do that . I think that another solution would be to increase the number of points that are read. I noticed that the maximum buffer size is around 9000 points (I've read it with DAQmxRead Property Node).
    2. Another fact that I've noticed is that in the While loop where I'm doing the Data Reading I should have no other operations or delay. Is this true, or just a coincidence?
    3. There is a strange behavior: if I start the acquisition and I have at the input high frequency, I get the error (Buffer overwritten) almost instant. If I start acquisition at low freq I can increase it even at high freq.
    4. There is another strange behavior: if the input frequency is high the frequency and the measured period increase and decrease togheter. I think that this is caused by alias. Where can I find some more information about the board limits?
     If you can give me some other advice/hints/links/pdfs I would be very thanksful.
    Maybe there are some small mistakes in the VI. I made it only to get a feeling of what I'm doing. I didn't chek it with the hardware.
    Regards,
    Paul
    Attachments:
    example.vi ‏32 KB

    Paul,
    I  have added some comments to your answer.
    Regards,
    Jochen 
    KPanda wrote:
    Jochen,
    thanks for this information. This was what I was looking for some while.
    I still have a question related to this topic: I've read that the maximum size of FIFO is 1024 samples. What does it mean?
    [JK:] The FIFO is the hardware buffer on the board. In general the PCI-bus or the USB should have enough bandwidth to transfer the data as fast as they are acquired by the device, but in fact there are sometimes some latencies that require some local memory on the board. That's what is called FIFO in this context.
    This FIFO is the same with the: Available Samples Pro Channel from Read Property node?
    [JK:]  No. This value refers to the buffer in the PC's memory that is allocated for the acquisition operation.
    I've noticed that when the value for this property is passing 9000 I get the error with Overwritten Buffer. If it is like this why do I reach more than 9000 samples pro channel? Please take a look at the attachement (test1.png - screenshoot with the values / speed_test_x - the VI that I used for this measurement).
    [JK:] The buffer size is not limited to 9000 values. NI-DAQmx allocates memory automatically by default. If you like you can increase the buffer size manually.
    Which is the relation between maximum numbers of sample that can be read with the Counter 1D Read NSamples? In my VI there are N=250 samples. Can I increase it in order to avoid the error? If yes, which should be the maximum limit, 1024 ?
     [JK:] You can increase the number of values to read up to the size of the buffer (not of the FIFO). A reasonable value is up to 50% of the buffer size, but this is not a strict rule. Anything between 10% and 90% could make sense, depending on the timing requirements of your application.
    Paul
    PS: I've hope that I translated the LabView terms in the right way. I have my LabView in german (but I don't know german, so it is a nightmare for me )

Maybe you are looking for

  • I can't use Time Machine with a USB drive plugged into an Airport Extreme.

    I connected an external drive to the USB port of an Airport Extreme, intending to use it with Time Machine and one of the laptops in the Wi-Fi network (call it Laptop). The drive is visible from the Disks tab of each computer's Airport Utility but fr

  • How to display standard text element of main window in next page

    hi all In scripts we have standard script medruck for purchase order. i want to pull text elements ( terms and payment terms ) in to main window of next page. i have included main window in page windows of next page ,but im unable to print text eleme

  • Install SP4 on linux

    Hi, while installing wls61sp4_upgrade_generic.zip into WLS 6.1 SP3, I get an error that "WebLogic Server 6.1 not found" and the text "WebLogic Server Service Pack 4 Installation failed. You do not seem to have WebLogic Server 6.1 installed for BEAHOM

  • Desktop Content Viewer crashes every time

    I can't get the Adobe Content Viewer for the desktop to stop from crashing on my MacBook Air. Even if I launch it separately, outside of InDesign. Anyone know what to do about this? I've reinstalled Folio Producer tools, but to no avail and am desper

  • Envoi d'une chaîne de caractère avec (visa write) caractère par caractère

    Salut, Je veux savoir comment écrire une chaine de caractère en utilisant "visa write" caractère par caractère et la lire par la suite par "visa read" J'ai essayé d'utiliser une boucle for, un délai et avec l'objet "chaîne au format tableur en tablea