# How to create a getTag to get the values in aloop

**URL:** <https://forum.inductiveautomation.com/t/how-to-create-a-gettag-to-get-the-values-in-aloop/41378>\
**Category:** General Discussion\
**Created:** [December 10, 2020, 8:03am UTC](https://forum.inductiveautomation.com/t/how-to-create-a-gettag-to-get-the-values-in-aloop/41378 "2020-12-10T08:03:45Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![valarmathi2696](https://avatars.discourse-cdn.com/v4/letter/v/77aa72/32.png) [@valarmathi2696](https://forum.inductiveautomation.com/u/valarmathi2696)\
**Post date:** [December 10, 2020, 8:03am UTC](https://forum.inductiveautomation.com/t/how-to-create-a-gettag-to-get-the-values-in-aloop/41378/1 "2020-12-10T08:03:45Z")

</div>

[```  
I have to create getTags so that it populates xml sample as below where the UCIDATA  
have multiple entries.

549300B2SAXGWM7G5218 BMO2100005345880 N 50 BMO2100005345087 Y 50 ```

I have to pass getag values so that the UCIDATA tags alone gets replicated twice or thrice as per the no.of UCI values.how do I do that?

I declared a cursor with srcid from a table which is a unique value for each of the UCI values entered in that table.

```auto
EXEC SQL DECLARE GET_UCI CURSOR   
                     FOR        
                     SELECT MNUSU_SRCID,MNUSU_UCI,MNUSU_LEI,MNUSU_SIA_FLG,
                                MNUSU_INT_PCT_SHARE
                     FROM MF_NFU_UCI_UPDATES_STG
                     WHERE MNUSU_SRCID = :in_srcid 

int fetchUCIDATA()
    {
        EXEC SQL OPEN GET_UCI;
        EXEC SQL FETCH GET_UCI INTO :MNUSU_UCI:ind_MNUSU_UCI,:MNUSU_LEI:ind_MNUSU_LEI,:MNUSU_SIA_FLG:ind_MNUSU_SIA_FLG,:MNUSU_INT_PCT_SHARE:ind_MNUSU_INT_PCT_SHARE;                                   
        return ( sqlca.sqlcode);
        }

getTags_1( UCI, ( char * ) MNUSU_UCI.arr, tagUCI );     
getTags_1( SIAFLG, ( char * ) MNUSU_SIA_FLG.arr, tagSIAFlag );      
getTags_1( INTPCT, ( char * ) MNUSU_INT_PCT_SHARE.arr, tagINTPCT );     
getTags_1(LEI, ( char * ) MNUSU_LEI.arr,tagLEI );       
getTags_3( UCIData ,tagUCI,tagSIAFlag,tagINTPCT,tagUCIData);            
getTags_2(CDICDATA,tagLEI,tagUCIData,tagCDICDATA);      
t_UCIData = t_UCIData||UCIData (1 to 11 times)

Please help me with the right syntax and logic to loop.How to pass the syntax here so that the UCIDATA tags gets concatenated for multiple UCI values.
```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 10, 2020, 1:02pm UTC](https://forum.inductiveautomation.com/t/how-to-create-a-gettag-to-get-the-values-in-aloop/41378/2 "2020-12-10T13:02:22Z")

</div>

I don’t recognize anything in your SQL. Is this related to Ignition? (Are you posting on the right forum?)

If it _is_ related to Ignition, you’re going to have to post a lot more information for us to make sense of it.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [December 10, 2020, 1:27pm UTC](https://forum.inductiveautomation.com/t/how-to-create-a-gettag-to-get-the-values-in-aloop/41378/3 "2020-12-10T13:27:59Z")

</div>

This looks like spam

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 10, 2020, 1:38pm UTC](https://forum.inductiveautomation.com/t/how-to-create-a-gettag-to-get-the-values-in-aloop/41378/4 "2020-12-10T13:38:34Z")

</div>

Since it didn’t link to anything, it didn’t occur to me that it might be spam.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [December 10, 2020, 1:47pm UTC](https://forum.inductiveautomation.com/t/how-to-create-a-gettag-to-get-the-values-in-aloop/41378/5 "2020-12-10T13:47:47Z")

</div>

Posting in the Archived Topics is something of a flag.

---

<div class="post-metadata">

**Author:** ![valarmathi2696](https://avatars.discourse-cdn.com/v4/letter/v/77aa72/32.png) [@valarmathi2696](https://forum.inductiveautomation.com/u/valarmathi2696)\
**Post date:** [December 10, 2020, 2:17pm UTC](https://forum.inductiveautomation.com/t/how-to-create-a-gettag-to-get-the-values-in-aloop/41378/6 "2020-12-10T14:17:02Z")

</div>

Its related to oracle pro\*c

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 10, 2020, 2:31pm UTC](https://forum.inductiveautomation.com/t/how-to-create-a-gettag-to-get-the-values-in-aloop/41378/7 "2020-12-10T14:31:51Z")

</div>

So, generally off topic for this forum, and certainly for this category. Would have been acceptable in the general discussion category, I suppose. Good luck with your Pro\*C problem.

---

<div class="post-metadata">

**Author:** ![chasondeshotel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/chasondeshotel/32/20032_2.png) [@chasondeshotel](https://forum.inductiveautomation.com/u/chasondeshotel)\
**Post date:** [December 10, 2020, 2:45pm UTC](https://forum.inductiveautomation.com/t/how-to-create-a-gettag-to-get-the-values-in-aloop/41378/8 "2020-12-10T14:45:12Z")

</div>

> [@pturmel](#):
>
> Since it didn’t link to anything, it didn’t occur to me that it might be spam.

Last line, links to an insecure page 😲

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 10, 2020, 3:31pm UTC](https://forum.inductiveautomation.com/t/how-to-create-a-gettag-to-get-the-values-in-aloop/41378/9 "2020-12-10T15:31:41Z")

</div>

I looked at the edits, and I don’t see a complete URL. Just `http://`. My browser won’t open that. What would?

---

<div class="post-metadata">

**Author:** ![chasondeshotel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/chasondeshotel/32/20032_2.png) [@chasondeshotel](https://forum.inductiveautomation.com/u/chasondeshotel)\
**Post date:** [December 10, 2020, 3:36pm UTC](https://forum.inductiveautomation.com/t/how-to-create-a-gettag-to-get-the-values-in-aloop/41378/10 "2020-12-10T15:36:14Z")

</div>

Note the lack of `s` in `https`. Clearly the work of spam bots

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 10, 2020, 3:49pm UTC](https://forum.inductiveautomation.com/t/how-to-create-a-gettag-to-get-the-values-in-aloop/41378/11 "2020-12-10T15:49:09Z")

</div>

Sarc? Spam bots don’t reply to comments nor edit their OP to fix problems.

---

<div class="post-metadata">

**Author:** ![chasondeshotel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/chasondeshotel/32/20032_2.png) [@chasondeshotel](https://forum.inductiveautomation.com/u/chasondeshotel)\
**Post date:** [December 10, 2020, 4:07pm UTC](https://forum.inductiveautomation.com/t/how-to-create-a-gettag-to-get-the-values-in-aloop/41378/12 "2020-12-10T16:07:36Z")

</div>

I wouldn’t put it past them; they’ve already rigged _two_ US elections!

But yeah, jokes. OP wasn’t spammy. 0/10 Nigerian princes
