How to use substr and instr, where the line of input Multi text

Hi all

with

data in the form of)

Select ' Mary America.1234 Southridge Park Dr... Samna Lorie.MO.31234..' double val

Union of all the

Select 'Bill Johnson.Apartment 3 b. Sterling.VA.20166.3 Plaza Falke' of the double

)

Select

regexp_substr (shipping_instructions, "[^ #] +' 1, 1") name

, regexp_substr (shipping_instructions, "[^ #] +' 1, 2") address

, regexp_substr (shipping_instructions, "[^ #] +' 1, 3") city

, regexp_substr (shipping_instructions, "[^ #] +' 1, 4") State

, regexp_substr (shipping_instructions, "[^ #] +' 1, 5") zip

, regexp_substr (shipping_instructions, "[^ #] +' 1, 6") County

FROM (select REGEXP_REPLACE (val, ' \.)) () [^.])', ' #\1 ") data shipping_instructions)

(1)'Mary America.1234 Southridge Park Dr... Samna Lorie.MO.31234..'

(2)'Bill Johnson.Apartment 3 b. Sterling.VA.20166.3 Falke Plaza. »

"Mary America. 1234 Southridge Park Dr. Samna Lorie. MO.31234..'

NAME ADDRESS CITY ZIP County SATE

---------                  --------                                ------------           ------           -------    -- -----

Married America 1234 Southridge Park Dr.    Samna Lorie MO 31234  NULL VALUE

"Bill Johnson. Apartment 3B. Sterling. VA. 20166. Falke Plaza 3... "

NAME ADDRESS CITY ZIP County SATE

----------------      -----------------        -------       -----        ---         --------

Bill Johnson apartment 3B Sterling, WILL 20166 3 Falke Plaza.

Problem

---------

(1) if the value, if the County (if null) value then it shows the ZIP with dot's (.) value, in the 31234 above..,.

How to solve this problem?

(2) another possible to fix the code, I want to use substr and InStr.

(3) who is the best approach?

Conditions:

--------------

(1) shipping_instructions column has the value with "Mary America.1234 Southridge Park Dr... Samna Lorie.MO.31234... »

This means it combined all the similar name, address, city, State, zip

(2) we insreted in the table separately.

=========================

/ * Use Substr and Instr * /.

=========================

I used substr and instr, but I'm getting the money results (no point in the address).

"America Mary. 1234 Southridge Park Dr. Samna Lorie.MO.31234..'


NAME ADDRESS CITY ZIP County SATE

---------                  --------                                ------------           ------           -------    -- -----

Mary America 1234 Southridge Park Dr. Samna Lorie MO 31234  NULL VALUE

But I need the results (no point in the address)

NAME ADDRESS CITY ZIP County SATE

---------                  --------                                ------------           ------           -------    -- -----

Mary America 1234 Southridge Park Dr.    Samna Lorie MO 31234  NULL VALUE

Hello

994122 wrote:

Hello

(1) how do to do this, use the substr and instr functions?

Thank you

You can't do all the work with SUBSTR and INSTR; you need regular expressions to obtain a string delimited by a #.

Once you have such a string, then you can use SUBSTR and INSTR (instead of REGEXP_SUBSTR) to get the separate secondary strings:

WITH got_delimited_string AS

(

SELECT REGEXP_REPLACE (val

, '\. ([^ .]| $)'

, '#\1'

) AS delimited_string

FROM the data

)

got_pos AS

(

SELECT delimited_string

, INSTR (delimited_string, "#", 1, 1) AS pos_1

, INSTR (delimited_string, "#", 1, 2), pos_2

, INSTR (delimited_string, "#", 1, 3) AS pos_3

, INSTR (delimited_string, "#", 1, 4) AS pos_4

, INSTR (delimited_string, "#", 1, 5) AS pos_5

, INSTR (delimited_string, "#", 1, 6) AS pos_6

OF got_delimited_string

)

SELECT SUBSTR (delimited_string, 1, pos_1 - 1) AS the name

SUBSTR (delimited_string, pos_1 + 1, pos_2 - (pos_1 + 1)) AS address

SUBSTR (delimited_string, pos_2 + 1, pos_3 - (pos_2 + 1)) AS city

SUBSTR (delimited_string, pos_3 + 1, pos_4 - (pos_3 + 1)) AS State

REPLACE (SUBSTR (delimited_string, pos_4 + 1, pos_5 - (pos_4 + 1))

, '.'

)                                                           AS zip

SUBSTR (delimited_string, pos_5 + 1, pos_6 - (pos_5 + 1)) AS the County

OF got_pos

ORDER BY delimited_string

;

Tags: Database

Similar Questions

  • How to use Substr and Instr to get data from a file

    Hi I have a script

    I get a file like this

    1.20, ram, sales

    I get a file as these data as a column

    I want to divide these data into 4 different columns as

    1 20 sales of ram

    Hello

    This query will help you.

    Select

    SUBSTR (C1, 0, INSTR(C1,',')-1).

    SUBSTR (C1, INSTR (C1, ',') + 1, INSTR(C1,',',1,2)-INSTR(C1,',',1,1)-1),

    SUBSTR (C1, INSTR(C1,',',1,2) + 1, INSTR(C1,',',1,3)-INSTR(C1,',',1,2)-1).

    SUBSTR (C1, INSTR(C1,',',1,3) + 1, INSTR(C1,',',1,4)-INSTR(C1,',',1,3)-1)

    SUBSTR (C1, INSTR(C1,',',1,3) + 1)

    BeO

    Select 1, 20, ram, C1 double sales

    )

    Remember that a comma is not really safe as field separator

    Post edited by: DecaXD

  • data of cutting using substring and instring, and storage in a new table

    Hi all

    I have an emp_address 2tables, address as below:
    ---------------------------------------------------------------
    create the table emp_address (emp_id varchar2 (10), address varchar2 (100));

    Insert into EMP_ADDRESS
    (EMP_ID, ADDRESS)
    Values
    ('101', 'street1 fremont CA 94538');
    Insert into EMP_ADDRESS
    (EMP_ID, ADDRESS)
    Values
    ("102", "Street.2 fremont, CA 94537');
    COMMIT;


    create the address table (emp_id varchar2 (10), street varchar2 (20), city varchar2 (15), State varchar2 (10), zip varchar2 (10));

    -----------------------------------------------------------------------------
    Emp_address data as below:

    emp_id address

    street1 101 fremont CA 94538

    102 fremont, CA 94537 Street.2

    ------------------------------------------------------------------------------
    now I read data emp_address and split the data of the address column and record these data in the address table like as below

    emp_id Street City State Zip Code
    street1 101 fremont, ca 94538
    102 fremont, ca 94537 Street.2

    -------------------------------------------------------------------


    I'm trying to divide these data using substring and instring. Actually my problem was between the data a few times I have 1tab or 2tabs and sometimes 3tab. If the number of tab spaces is not constant.

    So can u help me in this case.

    Thanks in adavnce

    position of reference BluShadow

    WITH emp_address AS (SELECT   '101' emp_id,
                                  'street1 fremont CA 94538' address
                         FROM     DUAL
                         UNION ALL
                         SELECT   '102',
                                  'street2  fremont CA 94537'
                         FROM     DUAL),
        emp_address_list_temp AS
          (SELECT       emp_id,
                        SUBSTR (
                          address,
                          DECODE (LEVEL,
                                  1, 1,
                                  INSTR (address, ' ', 1, LEVEL - 1) + 1
                                 ),
                          DECODE (
                            INSTR (address, ' ', 1, LEVEL),
                            0,
                            LENGTH (address),
                            INSTR (address, ' ', 1, LEVEL)
                            - DECODE (LEVEL,
                                      1, 0,
                                      INSTR (address, ' ', 1, LEVEL - 1)
                                     )
                            - 1
                          )
                        )
                          address,
                        LEVEL rn
           FROM         emp_address
           CONNECT BY   LEVEL <=
                          LENGTH (address) - LENGTH (REPLACE (address, ' ')) + 1
           GROUP BY     emp_id, address, LEVEL),
        emp_address_list AS
          (SELECT   emp_id,
                    address,
                    ROW_NUMBER () OVER (PARTITION BY emp_id ORDER BY rn) rn
           FROM     emp_address_list_temp
           WHERE    TRIM (address) IS NOT NULL)
    SELECT     emp_id,
               (SELECT   address
                FROM     emp_address_list e2
                WHERE    e2.emp_id = e1.emp_id
                     AND rn = 1)
                 street,
               (SELECT   address
                FROM     emp_address_list e2
                WHERE    e2.emp_id = e1.emp_id
                     AND rn = 2)
                 city,
               (SELECT   address
                FROM     emp_address_list e2
                WHERE    e2.emp_id = e1.emp_id
                     AND rn = 3)
                 state,
               (SELECT   address
                FROM     emp_address_list e2
                WHERE    e2.emp_id = e1.emp_id
                     AND rn = 4)
                 zip
    FROM       emp_address_list e1
    GROUP BY   emp_id
    
  • How to use headphones and speakers at the same time

    I want to use headphones at the same time that I use the speakers.

    I am hard of hearing and need the LOUD volume. When others are watching a film, projected on HDTV, they won't let me turn the volume up to where I need it, which is why, headphones and speakers at the same time.

    I use Windows 7, I want to stick with Windows 7, so I want a Windows 7 solution.

    If there is no solution for Windows 7 and there is a solution using Windows 10, then and then only, I will be upgrading to Windows 10.

    Using headphones and speakers was possible under Windows XP. I think that a kid at Microsoft, with a regular audience, thought this feature was redundant and removed. Large.

    Macs will play through the headphones and speakers, so maybe it's time to buy a Mac!

    Hi Bob,

    Thanks for posting your query on the Microsoft Community.

    With the description, I understand that you want to use headphones and speakers at the same time on your Windows 7 computer. I will certainly help you get this fixed number.

    I suggest you check the suggestions contained in below mentioned thread and check if this is useful:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-pictures/headphones-speakers-at-the-same-time/7ed31bcf-3762-430D-9c9f-e6967d670d0e

    Hope this information is useful. Please come back to write to us if you need more help, we will be happy to help you.

  • using substr and instr

    Hi all

    create table abc (str varchar2 (10))

    insert into abc values ('ABC - DEF')

    Insert into abc values('ABC/DEF')

    Insert into abc values ('ABC DEF')

    Insert into abc values('ABC.) DEF')

    insert into abc values ('ABC DEF')

    I need to put as ABCDEF for all values, if possible using sustr and instr

    Thank you

    Three ways:

    Select replace (str, translate(str,'~ABCDEFGHIJKLMNOPQRSTUVWXYZ','~')) in abc;  -assuming a single character is there in your data...

    -generic way to remove all of the other characters keeping uppercase alphabets

    SELECT TRANSLATE (str, ' ~' |) TRANSLATE (str, ' ~ ABCDEFGHIJKLMNOPQRSTUVWXYZ ',' ~'), ' ~') of ABC;

    -Using regular expressions

    Select regexp_replace(str,'[^[:alpha:]]') in abc;

    See you soon,.

    Manik.

  • A string into the text and numbers using SUBSTR and INSTR

    I have the sample data. I know it's terrible database designed for a combination of text and numbers in the same field, but I can't change the business process.

    That's what I have so far:

    set linesize 5000
    
    WITH table_data
         AS (SELECT 'R: JASON BOURNE 12341560' str FROM DUAL UNION ALL
             SELECT 'R: FATS DOMINO 23432342' str FROM DUAL UNION ALL
             SELECT 'R: MARTIN LUTHER KING 3334156' str FROM DUAL UNION ALL
             SELECT 'R: TOM CRUISE 6547123' str FROM DUAL UNION ALL
             SELECT 'R: TOMMY DE GROOT 1212124' str FROM DUAL UNION ALL
             SELECT 'R: GRIM REAPER 1345245' str FROM DUAL UNION ALL
             SELECT 'R: DOCTOR DEATH THE FIRST SMITH 24356178' str FROM DUAL)
    SELECT str
         , TRIM(SUBSTR(str, INSTR(str, ' ', 1, 1), INSTR (str, ' ', 1, 2) - INSTR (str, ' ', 1, 1))) first_name
         , REPLACE(SUBSTR(str, INSTR (str, ' ', 1, 2)+1, 999), SUBSTR(str,LENGTH(str)-6,7), '') last_name
         , SUBSTR(str,LENGTH(str)-6,7) emp_num
      FROM table_data;
    
    STR                                      FIRST_NAME    LAST_NAME                 EMP_NUM
    ---------------------------------------- -----------------------------------------------
    R: JASON BOURNE 12341560                 JASON         BOURNE 1                  2341560
    R: FATS DOMINO 23432342                  FATS          DOMINO 2                  3432342
    R: MARTIN LUTHER KING 3334156            MARTIN        LUTHER KING               3334156
    R: TOM CRUISE 6547123                    TOM           CRUISE                    6547123
    R: TOMMY DE GROOT 1212124                TOMMY         DE GROOT                  1212124
    R: GRIM REAPER 1345245                   GRIM          REAPER                    1345245
    R: DOCTOR DEATH THE FIRST SMITH 24356178 DOCTOR        DEATH THE FIRST SMITH 2   4356178
    
    7 rows selected.
    

    I need to:

    1 extract the first name - which is always the first name after the 'r' - I've got that little works very well.

    2 extract the name - should be the last word before the number, if e.g. for the last night, I wish only that 'SMITH' and 'KING' for the 3rd line and "GROOT" for the 5th line.

    3. remove the number at the end, regardless of the length - some of the examples above are 8 long numbers so my attempt above does not work.

    I can't use any REGEXP or REGEXP_SUBSTR because they are not registered in the EUL I'm using discoverer, I can only use INSTR AND SUBSTR.

    I was wondering if someone might be able to help please?

    Any advice much appreciated.

    Thank you

    AW, go on them, as it's Christmas, I'm feeling generous...

    SQL > ed
    A written file afiedt.buf

    1. WITH table_data (SELECT "r: JASON BOURNE 12341560' DOUBLE UNION ALL STR ')
    2. SELECT "r: FATS DOMINO 23432342' str OF DOUBLE UNION ALL.
    3. SELECT "r: MARTIN LUTHER KING 3334156' str OF DOUBLE UNION ALL.
    4. SELECT "r: TOM CRUISE 6547123' str OF DOUBLE UNION ALL.
    5. SELECT "r: TOMMY GROOT 1212124' str OF DOUBLE UNION ALL.
    6. SELECT "r: GRIM REAPER 1345245' str OF DOUBLE UNION ALL.
    7. SELECT "r: DOCTOR DEATH FIRST SMITH 24356178' FROM DUAL str.
    8                     )
    9 select substr (str, 1, instr(str,' ')-1) as a first name
    10, substr (substr (str, 1, instr(str,' ',-1)-1), instr (substr (str, 1, instr(str,' ',-1)-1),' ', 1) + 1) as last_name
    11, substr (str, instr (str, ' ',-1) + 1) as emp_num
    12 years of (select replace (str,'R: ') as str)
    table_data 13
    14*        )
    SQL > /.

    FIRST_NAME LAST_NAME EMP_NUM
    ---------------------------------------- ---------------------------------------- ----------------------------------------
    JASON BOURNE 12341560
    FATS                                     DOMINO                                   23432342
    MARTIN                                   KING                                     3334156
    TOM                                      CRUISE                                   6547123
    TOMMY                                    GROOT                                    1212124
    GRIM                                     REAPER                                   1345245
    DOCTOR SMITH 24356178

    7 selected lines.

  • Use Substr and InStr

    I have created table:

    create table wekaRules_productmgr)
    The rule ID number,
    WekaRule varchar2 (500),
    VARCHAR2 (250) antecedent.
    VARCHAR2 (250) resulting.
    );

    The table contains the following data with insert statements:

    INSERT INTO wekaRules_productmgr (ID rule, WekaRule)
    VALUES (1, ' PM_PRICE_REDUCTION_TYPE = None 9828 == > PM_COUPON_TYPE = None 9828 conf: (1) lift: (1.06) conv: (576.86)') lev: (0.05) [576];

    INSERT INTO wekaRules_productmgr (ID rule, WekaRule)
    VALUES (2, ' PM_AD_TYPE = None 9684 == > PM_PRICE_REDUCTION_TYPE = None 9684 conf: (1) lift: (1.12) conv: (1063.13)') lev: (0.1) [1063];

    INSERT INTO wekaRules_productmgr (ID rule, WekaRule)
    VALUES (3, ' PM_AD_TYPE = None 9684 == > PM_COUPON_TYPE = None 9684 conf: (1) lift: (1.06) conv: (568.41)') lev: (0.05) [568];

    The values for the last two columns in the wekaRules_productmgr table is contained in the string values for each statement. For example, in the # 1 folder, the values are (from left to right):
    history = PM_PRICE_REDUCTION_TYPE = None
    result = PM_COUPON_TYPE = None


    I need to find a way to analyze the values in each record and update in the appropriate table columns. So to case # 1, I need to update columns with the values given above, such as the records would look like:

    Rule ID History Resulting          
    1 PM_PRICE_REDUCTION_TYPE = None PM_COUPON_TYPE = None
    2 PM_AD_TYPE = None PM_PRICE_REDUCTION_TYPE = None
    3 PM_AD_TYPE = None PM_COUPON_TYPE = None

    I have tried this solution, but cannot very well:

    UPDATE wekaRules_productmgr SET history =
    (SELECT SUBSTR (wekarule, 1, (INSTR(wekarule,' ',1,1)-1)) 'history')
    OF wekaRules_productmgr);

    I also have a similar one for the suite. Does anyone have any suggestions? Any help is appreciated. Thank you!

    I saw there is anonther detachment of you the same theme. If this can help you:

     SELECT
           regexp_substr(wekarule,'[a-zA-Z_]+ *= *[a-zA-Z_]+',1,1) antecedent,
           regexp_substr(wekarule,'[a-zA-Z_]+ *= *[a-zA-Z_]+',1,2) consequent,
           LTRIM(REGEXP_SUBSTR(wekarule, 'conf:\([^\)]+'), 'conf:(') conf,
           LTRIM(REGEXP_SUBSTR(wekarule, 'lift:\([^\)]+'), 'lift:(') lift,
           LTRIM(REGEXP_SUBSTR(wekarule, 'lev:\([^\)]+'), 'lev:(') lev,
           LTRIM(REGEXP_SUBSTR(wekarule, 'conv:\([^\)]+'), 'conv:(') conv
    FROM   wekaRules_productmgr;
    

    Published by: hm on 11.10.2010 11:29

  • Help on using substr and instr functions

    Hello

    I'm trying to go back to the first three letters of the first word and all the last word in a description field. For example, if the description is 'grilled steak' the query should return "steak gri. That's what I have so far:

    SELECT SUPPLIER_ID, PRODUCT_CODE, SUBSTR (DESCRIPTION, 1, 3). ' ' || SUBSTR (DESCRIPTION, INSTR (DESCRIPTION, ' ', 3)) AS A DESCRIPTION
    OF L_FOODS;

    Unfortunately, if the first word is the final word, it returns something like "sod soda." Does anyone have any advice or suggestions? Any help would be appreciated.

    Hi and welcome to the forum!

    It is always helpful if you identify your version of Oracle. The solution below depends on 10.1 and upward.

    What you could do is include a conditional around your instr/substr functions that checks the number of spaces between words. If it is greater or equal two one then there are at least two words. For example:

    WITH test_data AS
    (
         SELECT 'grilled steak' AS DESCRIPTION FROM DUAL UNION ALL
         SELECT 'large pepperoni pizza' AS DESCRIPTION FROM DUAL UNION ALL
         SELECT 'soda' AS DESCRIPTION FROM DUAL
    )
    SELECT     (CASE
              WHEN LENGTH(REGEXP_REPLACE(TRIM(DESCRIPTION),'[^[:space:]]','')) > 0
              THEN SUBSTR(DESCRIPTION,1,3) || SUBSTR(DESCRIPTION,INSTR(DESCRIPTION,' ',-1))
              ELSE SUBSTR(DESCRIPTION,1,3)
         END) AS DESCRIPTION
    FROM     test_data
    

    Results

    SQL> /
    
    DESCRIPTION
    -----------------------
    gri steak
    lar pizza
    sod
    

    : EDITION:

    I also wanted to add this:

    SUBSTR(DESCRIPTION, INSTR(DESCRIPTION, ' ', 3))
    

    May not return the expected results. If your description field contains more than two words he will return all remaining words not only the LAST Word. See my solution above for what I believe is the correct version.

    HTH!

  • How to use layers and colors of the index to even

    I work a lot in pixel art. I use indexed images. I need to be able to work in layers while working with indexed colors.

    How to use the index while working with layers?

    You can't do it in Photoshop.

  • How to use reports and Jasper in the Apex to print PDF

    I again and here knowledge how to use jasper reports to print PDF files

    Please see Dietmar excellent tool. I'm just a happy camper.

    http://www.Opal-consulting.de/Apex/f?p=20090928:4:542360562486677:no:

  • How to use MouseEvent and KeyboardEvent on the same function?

    It's maybe a stupid question, but I'll ask her.

    I did a login (textfield and a button).

    mybutton.addEventListener(MouseEvent.CLICK, loginCheck); It's my button

    function loginCheck(event:MouseEvent):void {}
    My code for the function here

    }

    In order to make the connection by using the Enter key, I tried to add:

    myText.addEventListener (KeyboardEvent.KEY_DOWN, keyEnter);
    function keyEnter(event:KeyboardEvent): void
    {
    If (event.keyCode is Keyboard.ENTER)
    {
    loginCheck();
    }
    }

    But of course it won't work because loginCheck is a function of MouseEvent.

    How can I make it work?

    It does not appear that you will use one of the properties of type event mouse or keyboard in loginCheck, right? Then, you can simply set the type of the parameter in loginCheck() to the event instead and add the event argument in keyEnter() when calling loginCheck() from here-> loginCheck (event).

    rmybutton.addEventListene (MouseEvent.CLICK, loginCheck, false, 0, true); It's my button

    function loginCheck(event:Event):void {}
    logic of connection here

    }

    myText.addEventListener (KeyboardEvent.KEY_DOWN, keyEnter, false, 0, true);
    function keyEnter(event:KeyboardEvent): void
    {
    If (event.keyCode is Keyboard.ENTER)
    {
    loginCheck (event);
    }
    }

    TS

  • How to use arrays and loops in the loading multiple Images?

    I am struggling to load a sequential array of images appear as a moving image. Therefore, when you click the load images one after another.

    The code below is what I have so far, but he is unable to do what I want, that there is only a single loading image, which is the last image in the table, then, either because the images are stacked on top of each other, either because I just don't understand not the basics...

    And I'm not clear on what you said kglad, that my solution will be more complicated because I need to preload my image sequence and then use a loop to load it?

    import flash.net.URLRequest;

    import flash.display.Loader;

    var int count = 0;

    var imageArray:Array = ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg", "6.jpg", '7.jpg',

    "8.jpg", "9.jpg", "10.jpg", "11.jpg", "12.jpg", "13.jpg"];

    for (var i: uint = 0; i < imageArray.length; i ++) {}

    var btn:YourButton = new YourButton();

    BTN. Ivar = i;

    addChild (btn);

    BTN.x = 0;

    BTN.y = 0;

    btn.addEventListener (MouseEvent.CLICK, clickF);

    }

    var ldr:Loader = new Loader();

    addChild (ldr);

    LDR.x = 20;

    LDR.y = 20;

    function clickF(e:MouseEvent) {}

    LDR. Load (new URLRequest ("D:/flash cs5.5/image_sequence/twirlSeq/"+imageArray[e.currentTarget.ivar]));

    }

    function loadComplete(e:Event) {}

    first process image loaded, then...

    Count ++;

    if(Count < imageArray.Length) {}

    loadCurrentImage();  Load next image

    } else {}

    Sequencial full load, continue to the next activity

    }

    function loadCurrentImage() {}

    LDR. Load (imageArray [Count]);

    ldr.contentLoaderInfo.addEventListener (Event.COMPLETE, loadComplete);

    }

    }

    count 2% alternates between 0 and 1 as increments count.  which allows to load in ldr0 then ldr1 and then ldr0 etc.

    in this way the scene still has an image instead of flashing white between the charges that you would see if you used a loader.

  • How to use Notepad and utube at the same time on an ipad?

    Is there a way to mulitask with two apps on the iPad, I want to take notes while watching a utube video?

    only on the most recent iPads that supports multitasking side by side

  • Substr and InStr

    Hi all

    I have a table where a column has a data character in the format below:

    * '00003434' *.
    * '00123' *.
    * '0000045' *.

    If I want to eliminate all zeros on the left, how can I do using substr and instr? or is there an easier way?

    Thank you

    KK

    Try again with

    Select ltrim ('00003434 ', ' 0') of double;

  • Combination of substring and instring in RTF - dynamic signature images url

    I am unable to use a combination of substring and instring in RTF model.

    I have a BUYER_LAST_NAME column, which has a Jean Dupont value. I like to shoot 'john' on this channel.

    I tried to create a variable using <? xdoxslt:set_variable($_XDOCTX,_'new_name',_'')? >

    So I want to do a get variable using substr and InStr.

    <? xdoxslt:get_variable (substring _XDOCTX, BUYER_LAST_NAME, $(DOCUMENT_BUYER_LAST_NAME, 1, instring(BUYER_LAST_NAME,' ')-1))? >

    The command above does not work as a substring and instring aren't xdoxslt operations.

    I tried to do this using xdofx: <? xdofx:substr (BUYER_LAST_NAME, 1, Instr(BUYER_LAST_NAME,' ')-1)? >

    The above work, but I don't know how to make a variable defined using xdofx. Please help me on this.

    Published:

    I want to use this field in a dynamic signature display. But I can't call substring-before command as part of the url.

    URL: {(concat('${OA_MEDIA}','/purchase_order/signatures/',.//BUYER_FIRST_NAME,'_',.//BUYER_LAST_NAME,'.jpg')}

    I want to change the BUYER_LAST_NAME here.

    I'm working on

    URL: {concat (' ${OA_MEDIA} ',' / purchase_order/signatures /',. / / DOCUMENT_BUYER_FIRST_NAME, "_",. / /, '.jpg')}

    But it does not work.

    ->

    URL: {concat (' ${OA_MEDIA} ','/ purchase_order/signatures /',. / / DOCUMENT_BUYER_FIRST_NAME, '_', substring-before(.//DOCUMENT_BUYER_LAST_NAME, ' '), '.jpg')}

    who is working for me

Maybe you are looking for