Concatenation of fields

I use the following to generate a random number

< cfset random_no = #randrange (200000,999999) # >

Now, based on a provider's code, I need to add a prefix to a random number, if the seller is ABC, I need to add the letter A to make it A9999999, if the seller is BBC, then add B to make B1000000, etc. and write this new entry in my Access db

Is it done in CF and how, or what makes SQL and how?

Thank you

One or both.

SEE the basic concatenation operand is the ampersand {and}. If you
would just do something like this:
random_no >

It is also possible in most, if not all, DBMS. But how varies from
one to the other.

Tags: ColdFusion

Similar Questions

  • Value derived — concatenated string fields

    Hi all

    could you please give an example how can I set a value derived from a string field, so that it is values concatenated from several other fields of type string.

    Basically, what I want to do is to collect all the keywords in a field.

    Kind regards
    Gulnara

    Hey guliflower,

    With the help of a comprehensive rule that I have validated only that it works for me:

    first the pseudocode:

    If CERTAIN CONDITIONS

    value = variable1 & 'separator' & variable2

    endif

    If you are a derivation based on string values in the localdata (e.g. of the metadata contained in a checkin form) then the "#active." FIELDNAME"works well
    Otherwise, you will need to write additional idoc for the channels that you want to concatenate. The "&" is the operator of concat idoc, as defined in the reference guide of the IDOCScript (http://download.oracle.com/docs/cd/E10316_01/cs/cs_doc_10/sdk/idoc_script_reference/wwhelp/wwhimpl/js/html/wwhelp.htm)

    Here's the working example that I used on my test system. I pulled the doctype string and the string of delimited by a pipe in the comments field security group.

    Here's the code I used:

    <$if #active.ddocauthor="" like="" "sysadmin"$="">
         <$dprDerivedValue=#active.dDocType &"|"&="" #active.dsecuritygroup$="">
    <$endif$>

    It derived from the string ' document | public' in my field of xComments.

    This is interpreted as server-side:
    If the current user on this request is "sysadmin" and then take the string value of the field dDocType add a pipe ' | ' character and add the string value of the dSecurityGroup field and then place all of the contents in the xComments field.

    hope that helps,
    Warmly,.
    Billy Cripe
    Fishbowl Solutions

  • Concatenation of fields of big kid in a single line

    BEEP: 10.1.3.4.1
    Siebel: 8.1.1.2

    Hello!

    I'm new to BEEP - we are currently migrating Siebel operate above BEEP reports as part of an upgrade of Siebel 8.1.1.2.

    I get my head around BEEP and translated all the features to operate successfully to the new platform. There is one thing, however, that escapes me!

    We report against order attributes:

    Parent: order
    Child: Billing for the order
    Big kid: attribute of element order

    The XML of the BEEP report entry will have a head of parent and many children and grandchildren.

    There is a field in children:

    Product

    There are two fields in the great child:

    Name
    Value

    I would like to summarize across a single line, the concatenation of all the grandchildren 'Values' for the specific 'Name' fields in records of children with a specific field "product."

    For example:

    -Parents: car
    -The product child: door
    -Big kid name: color
    -Child large value: Blue
    -Big kid name: complete
    -Great value kids: metal
    -The product child: door
    -Big kid name: color
    -Child large value: Red
    -Big kid name: complete
    -Great value kids: metal
    -The product child: seats
    -Big kid name: color
    -Great value child: yellow
    -Big kid name: complete
    -Child large value: leather

    I want to a concatenated string values for the color of the door:

    Blue, red

    We have to operate in subclassing data stream Fetch and loop on the child and child large stream.

    Any thoughts on how to achieve this in TONE?

    Thank you very much in advance for your help!

    Hi mroshaw76,

    This should be eazzzzyy :)

    
      --- this will display the car
    Colors of the  : 
    
    

    Note the name of the element are case-sensitive.

  • Concatenation of field - work around null values

    Hello

    I was hoping I could get assistance or advice on an issues I'm having with the concatenation of several fields. Esentailly, I need to concatenate a number of fields in another column (ALL_COMMENTS) using the carriage return and line break between each of them, however, I must also ensure that are no null values in all areas that will create blank lines within the new column.

    Assuming that all the fields are varchar (255) Code is something like:

    Update my_table
    the value of ALL_COMMENTS == PART_COMMENT0 | CHR (13) | CHR (10) | PART_COMMENT1 | CHR (13) | CHR (10) | PART_COMMENT2 | CHR (13) | CHR (10) | PART_COMMENT3 | CHR (13) | CHR (10) | PART_COMMENT4 | CHR (13) | CHR (10) | PART_COMMENT5 | CHR (13) | CHR (10) | PART_COMMENT6;
    COMMIT;

    Can someone suggest a method to ensure that no blank line is included in the concatenated field (IE not null values in comments which allows line or carriage returns)

    See you soon

    Sorry I should have also mentioned that there is no structure for the data set and a null value can be in all areas PART_COMMENT.

    Thank you

    Published by: user11305352 on 07/05/2009 22:19

    Maybe something like that

    update my_table
       set all_comments =   part_comment0 || decode(part_comment0, null, null, chr(13) || chr(10)) ||
                      part_comment1 || decode(part_comment1, null, null, chr(13) || chr(10)) ||
                      part_comment2 || decode(part_comment2, null, null, chr(13) || chr(10)) ||
                      part_comment3 || decode(part_comment3, null, null, chr(13) || chr(10)) ||
                      part_comment4 || decode(part_comment4, null, null, chr(13) || chr(10)) ||
                      part_comment5 || decode(part_comment5, null, null, chr(13) || chr(10)) ||
                      part_comment6;
    
  • Concatenation of field value

    Hello

    Can we concatenate the results of 2 columns and display in a separate column in the reports for each record that is displayed in the report.

    Thanks in advance

    Hello

    Yes you can do it. On the third colum fx, you can use something like this-

    Account. "" Account name "| " ' || Account. "' Location account.

    Rgds,
    Amit

  • string concatenation &amp; date field?

    I am trying to concatenate the column of database + string + database column.

    I must add hook opened at the beginning of the string and a hook closing at the end of the database column.

    Example: Table.progtitle. "Deleted on | Table.Last_Modified_date

    the resulting output should therefore Table.progtitle (deleted 01/01/2010)

    How can we include media between a string and a database column?

    Hello

    the code is:

    select Table.progtitle || '(Deleted on '|| to_char(Table.Last_Modified_date ,'dd-mm-yyyy')||')'
    from Table;
    

    Herald tiomela
    Superconsult.nl

  • Concatenation of fields for the Group of records

    Dear friends,

    Here's my detail records


    employee not non-contact
    1360 8934
    1360 7172
    1360 [email protected]
    1297-8933
    1297 7056
    1297 8888
    1297 xyzl

    I want to write to the bottom of the query that returns the following result set

    1360 [email protected] 8934,7172,
    1297 8933,7056,8888, xyzl

    Pls help me!

    Manish Manyal

    See: http://www.oracle-base.com/articles/misc/StringAggregationTechniques.php

    An example:

    SQL> -- generating sample data
    SQL> with t as (
      2  select 1360 employee_no, '8934' contact_no from dual union
      3  select 1360, '7172' from dual union
      4  select 1360, '[email protected]' from dual union
      5  select 1297, '8933' from dual union
      6  select 1297, '7056' from dual union
      7  select 1297, '8888' from dual union
      8  select 1297, 'xyzl' from dual
      9  )
     10  --
     11  -- actual query:
     12  --
     13  select employee_no
     14  ,      ltrim(sys_connect_by_path(contact_no, ','), ',') contact_no
     15  from ( select employee_no
     16         ,      contact_no
     17         ,      row_number() over (partition by employee_no order by contact_no) rn
     18         from   t
     19       )
     20  where connect_by_isleaf=1
     21  start with rn=1
     22  connect by rn=prior rn+1
     23         and employee_no = prior employee_no;    
    
    EMPLOYEE_NO CONTACT_NO
    ----------- --------------------------------------------------
           1297 7056,8888,8933,xyzl
           1360 7172,8934,[email protected]
    
  • CQL Join on the coherence of Cache with Composite key

    I have a coherence of Cache with a composite key, and I want to join a channel for the records that cache with a CQL processor. When I deploy the package that contains the processor, I get the following error:

    + italics14:32:35, 938. modify the beginning of query SimpleQuery | [ACTIVE] ExecuteThread: '7' for the queue: "weblogic.kernel.Default (self-adjusting) | CQLServer | FATAL +.
    + 14:32:35, 938. change query > > SimpleQuery < < start +.
    + specified predicate requires a comprehensive analysis of the external source that is not supported. Please change the join predicate. [ACTIVE] ExecuteThread: '7' for the queue: "weblogic.kernel.Default (self-adjusting) | CQLServer | FATAL +.

    I think I use the key. If I change the key to a single field, it is OK. I found a similar problem when I defined a Java class to represent the composite key. It is possible to join this way on a composite key cache?

    I could define another area that is the concatenation of fields in the composite key, but it's a little messy.

    My config is as below:

    < wlevs: caching system id = "MyCache" provider = 'coherence' / >

    < wlevs:event - type-repository >
    < wlevs:event - type the type name = "SimpleEvent" >
    < wlevs:properties >
    < name wlevs:property = 'field1' type = "char" / >
    < name wlevs:property = 'Field2' type = "char" / >
    < / wlevs:properties >
    < / wlevs:event - type >
    < / wlevs:event - type-repository >

    < wlevs: channel id = "InChannel" - type of event = "SimpleEvent" >
    < wlevs:listener ref = "SimpleProcessor" / >
    < / wlevs: channel >

    < wlevs:processor id = "SimpleProcessor" >
    < wlevs:listener ref = "OutChannel" / >
    < wlevs:cache - Ref source = "SimpleCache" / >
    < / wlevs:processor >

    < wlevs: channel id = "OutChannel" - type of event = "SimpleEvent" >
    < / wlevs: channel >

    < wlevs:cache id = value 'SimpleCache"type ="SimpleEvent.
    Properties-key = "Field1, Field2.
    system caching = "MyCache" >
    < / wlevs:cache >

    and the processor CQL is as follows:

    < processor >
    < name > SimpleProcessor < / name >
    < rules >
    < request id = "SimpleQuery" >
    <! [CDATA]
    Select I.field1, I.field2 from InChannel [now] as I,
    SimpleCache as S where
    I.Field1 = S.field1 and
    I.Field2 = S.field2
    []] > < / query >
    < / rules >
    < / processor >

    Thank you
    Mike

    Unfortunately, join him on composite keys in coherence is not supported in the released versions. He will be supported in release 12g.

    As you mention, setting another field as the key, which is the concatenation of the original keys is the workaround.

  • How to extract fields from concatenated segments

    Hi all

    I need to get some fields of concatenated segments

    I have a column that is a concatenated segments, separated by ':'

    as:

    12 MAR - 14:K1:736457:90347589:874348

    12 MAR - 14:K1:736457: 874348

    Here, I want to extract the second, third and fifth field in the column

    I'm not sure the length of the field. So I can't use Substr.

    is there a way to extract based on the separator ': '?

    Thanks in advance

    Concerning

    UVA.

    with str as (select '12-MAR-14:K1:736457:90347589:874348' strg from dual)
    select regexp_substr(strg,'[^:]+',1,2) , regexp_substr(strg,'[^:]+',1,3) ,regexp_substr(strg,'[^:]+',1,5) from str;
    

    See you soon,.

    Manik.

  • Concatenation of global data fields

    I have the following entry data value fields 'Use global data' in the links tab:

    Client-city

    Customer Province

    Customer-Postal

    I want the three fields above to concatenate a field of text on other pages in the document.

    The fields are all tables within a form of entry on the first page and the data are correctly translated in subsequent documents.

    However, when I try to use formcalc to concatenate three fields above, nothing appears in the field.

    When the concatenation of the values of fields that use links "aggregate data", do I need to specify the absolute paths?

    Should I use formcalc or javascript?

    What is the good script to work?

    Just noticed, the property you want is rawValue no value.

    Paul

  • Adding fields / concatenation on submit

    Hi, I'm developing an APEX application, and I have a history of audit field, when previous comments can be seen (but not modified), and new comments can be typed and attached to this field when you click on submit.

    I am very new to APEX, so need advice/help, but currently I view previous comments as a field view-only and have a new comment textarea field to type. I don't know if it's the best way to do it, but my thought was to add the two fields together when you press the submit button and store as the value of field history new audit. So, a bit like comment = comments + NvoCommentaire.

    I tried to create an after - submit process and possibly using PL/SQL to do this, but I have no idea if this is a good way to achieve this, or if it is still possible. In addition, I don't know PL/SQL. :)

    Can anyone help/advise?

    Ah. Let me rephrase my comment. And 48 hours, you do very well.

    It will probably be much easier for this page if you think the stuff in two pieces: editable and non-editable. For the immutable stuff, with a simple report is going to be the best way to move things. You can create simple reports by creating a region of report based on an SQL statement. For your situation, it might look like this:

    select COMMENT_DATE, USER_ID, USER_COMMENT
      from USER_COMMENTS
     where ITEM_ID = :PX_ITEM_ID
    

    That's all you need for the view-only stuff.

    You get an error on your statement select is because your statement «select into...» "is that a variable to contain the response and the query returns more than one answer. You need an application that you can be sure returns only a single response. You can try something like this:

    select COMMENT_DATE, USER_ID, USER_COMMENT
      from USER_COMMENTS
     where COMMENT_ID = (select MAX(COMMENT_ID) from USER_COMMENTS where ITEM_ID = :PX_ITEM_ID);
    

    Assuming that your COMMENT_ID field is filled by a backward sequence value, that you will get the last (and only the last) message for the ITEM_ID.

    See if that helps any, and I apologize if I'm too far ahead. Feel free to let me know if you need me to save or better explain things.

  • Another issue of field concatenated Null

    I have some difficulty to return checked for null values.

    The Javascript function is calculating and my code is as follows:

    If (xfa.resolveNode ("INPUT. Vehicle.Row [0]. . RawValue vehicle-year'). = null) {}
    (xfa.resolveNode ("INPUT. Vehicle.Row [0]. . RawValue vehicle-year") +" '); ' "
    } else {}

    }
    +
    If (xfa.resolveNode ("INPUT. Vehicle.Row [0]. . RawValue vehicle-Make")! = null) {}
    (xfa.resolveNode ("INPUT. Vehicle.Row [0]. . RawValue vehicle-Make") +" '); ' "
    } else {}

    }
    +
    If (xfa.resolveNode ("INPUT. Vehicle.Row [1]. . RawValue vehicle-model"). = null) {}
    (xfa.resolveNode ("INPUT. Vehicle.Row [1]. . (RawValue vehicle-model') + '-');
    } else {}

    }
    +
    If (xfa.resolveNode ("INPUT. Vehicle.Row [2]. . RawValue vehicle-color")! = null) {}
    (xfa.resolveNode ("INPUT. Vehicle.Row [2]. . RawValue vehicle-color'));
    } else {}

    }

    The initial value is not null returns correctly, however, any subsequent value replaces the previous values and returns the last non-null field value.

    Help, please...

    Try the following code... See if it helps.

    var strVehicleYear, strVehicleMake, strVehicleModel, strVehicleColour

    If (xfa.resolveNode ("INPUT. Vehicle.Row [0]. . RawValue vehicle-year'). = null)

    strVehicleYear = xfa.resolveNode ("INPUT. Vehicle.Row [0]. . RawValue vehicle-year") +"";

    on the other

    strVehicleYear = "";

    If (xfa.resolveNode ("INPUT. Vehicle.Row [0]. . RawValue vehicle-Make")! = null)

    strVehicleMake = xfa.resolveNode ("INPUT. Vehicle.Row [0]. . RawValue vehicle-Make") +"";

    on the other

    strVehicleMake = "";

    If (xfa.resolveNode ("INPUT. Vehicle.Row [1]. . RawValue vehicle-model"). = null)

    strVehicleModel = xfa.resolveNode ("INPUT. Vehicle.Row [1]. . RawValue vehicle-model") +" - ";

    on the other

    strVehicleModel = "";

    If (xfa.resolveNode ("INPUT. Vehicle.Row [2]. . RawValue vehicle-color")! = null)

    strVehicleColour = xfa.resolveNode ("INPUT. Vehicle.Row [2]. . (RawValue color"of the vehicle);

    on the other

    strVehicleColour = "";

    this.rawValue = strVehicleYear + strVehicleMake + strVehicleModel + strVehicleColour;

    Thank you

    Srini

  • Creating a new ID concatenated field

    Hello

    I would like to add an additional field called "UNIQUE_ID" (varchar2) that would be from the previous field of the FID. FID is a numeric field (long integer).

    For example, for a certain PATTERN to the table. TELCO, I would need to add a prefix "TK" - (without the quotes) and concatenate it with the existing IDF.

    That's what I'm waiting for the Pl/SQL code and the trigger must create

    DIF UNIQUE_ID
    TK-100 100
    TK-101 101
    TK-102 102
    ...

    There should also be a trigger, if value FID change (per update), the field that unique_id should quickly get updated with the correct value.

    I need help here to establish such a PL/SQL code and where exactly to put triggers - I use the DBMS Oracle 11 g?

    Thank you!

    Dejan

    As you are 11g you can try creating UNIQUE_ID as a Virutal column. By which you should not use any trigger.

    Here is an example

    create table t(fid integer, unique_id varchar2(100) generated always as ('TK-'||fid) virtual)
    /
    insert into t (fid)
    select level
      from dual
    connect by level <= 10
    /
    select * from t
    /
    

    Published by: Karthick_Arp on February 17, 2010 05:12

  • Concatenation of select results in a single field

    Hello

    If I run the query "select name, the age of the users ' I get the following return

    VALUE NAME
    Ranieri 20
    Felipe 30
    Camila 28

    Is there a way to concatenate the names separated by slashes in a field and do the same thing with the value column to achieve this result as below:

    Value NAME
    Ranieri/Felipe/Camila-20/30/28

    Thank you

    Xmlagg using

    with d as
    (
    select 'Ranieri' name,  20 value from dual union all
    select 'Felipe' ,30 from dual union all
    select 'Camila' ,28 from dual
    )  -- test data
    select
         Rtrim(xmlagg(xmlelement(e,name,'/').extract('//text()')),'/') name ,
         Rtrim(xmlagg(xmlelement(e,value,'/').extract('//text()')),'/') value
    from d
    /
    
    NAME                                     VALUE
    ---------------------------------------- --------------------------
    Ranieri/Felipe/Camila                    20/30/28
    

    SS

  • concatenation of the values of the fields to update a column

    Hello.

    I have several columns in my table. I want to concatenate the value of a column to another.

    for example

    I want to PASS B value = value of COL B and c PASS.

    Is this possible? I know that
    UPDATE tbl SET COL B =  COL C + COL B  
    does not, as the Oracle sees it as a mathematical equation.
    UPDATE tbl SET COL B =  COL C   
    work, manufacturing COL B is equal to, or rather as value of the COLLAR C.

    Let's say COL b John and COL C a Smith, and I wanted to PASS B show JohnSmith, for example.

    What is the right syntax? I can't be that far off. Comments or a tip is appreciated!

    Thank you.
    UPDATE tbl SET COLB =  COLB||COLC
    OR
    UPDATE tbl SET COLB =  CONCAT(COLB,COLC)
    

Maybe you are looking for