# Pass Parameters to the XML Graph in Clover ETL

**URL:** <https://forum.cloverdx.com/t/pass-parameters-to-the-xml-graph-in-clover-etl/1065>\
**Category:** CloverDX Platform\
**Created:** [May 15, 2012, 12:00am UTC](https://forum.cloverdx.com/t/pass-parameters-to-the-xml-graph-in-clover-etl/1065 "2012-05-15T00:00:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![naveenvijay](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@naveenvijay](https://forum.cloverdx.com/u/naveenvijay)\
**Post date:** [May 15, 2012, 12:00am UTC](https://forum.cloverdx.com/t/pass-parameters-to-the-xml-graph-in-clover-etl/1065/1 "2012-05-15T00:00:00Z")

</div>

How to pass parameters to Graph in Clover ETL.

Basically I have a query embedded in graph and I want a variable which will be taken from the code and passed the the QUERY in XML.

For example I have information coming from several tables with certain patter like YYYY\_MM. So currently in my query I give values as LIKE ‘YYYY\_MM’. This query resides inside XML graph file and I use JAVA REFORMAT to read the file and get the information from the Database. I want this YYYY\_MM in my graph file to be parsed dynamically using a variable or using code. Basically it should come from system date and year.

Thanks,  
Naveen

---

<div class="post-metadata">

**Author:** ![vacekm](https://avatars.discourse-cdn.com/v4/letter/v/bbce88/32.png) [@vacekm](https://forum.cloverdx.com/u/vacekm)\
**Post date:** [May 16, 2012, 1:45pm UTC](https://forum.cloverdx.com/t/pass-parameters-to-the-xml-graph-in-clover-etl/1065/2 "2012-05-16T13:45:01Z")

</div>

Hello Naveen,

I’m not really sure in which component you want to insert your parameter. Are you using the Clover Designer or are you creating the graph files otherwise?

Either way, there’s a way that you can set the parameter during run through Java. But since parameters are resolved on initialization of components, you have to call your desired graph by RunGraph component. There are two sample graphs showing it in this thread:  
[viewtopic.php?f=4&t=5444](http://forum.cloveretl.com/viewtopic.php?f=4&t=5444)

---

<div class="post-metadata">

**Author:** ![naveenvijay](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@naveenvijay](https://forum.cloverdx.com/u/naveenvijay)\
**Post date:** [May 16, 2012, 4:16pm UTC](https://forum.cloverdx.com/t/pass-parameters-to-the-xml-graph-in-clover-etl/1065/3 "2012-05-16T16:16:42Z")

</div>

I use everything through java. I do not use the ctl for that. So I have a graph file which has my SQL Query Embedded (GRF) → REF → TEXT FILE.

But the query I have written I want that to be dynamic so it can pick the year and time from the system when its is running instead of manually appending it.

I have attached my graph file in this example.

If u see in that I am passing a year in my query and I want that to be passed a parameter/variable.

---

<div class="post-metadata">

**Author:** ![naveenvijay](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@naveenvijay](https://forum.cloverdx.com/u/naveenvijay)\
**Post date:** [May 17, 2012, 4:34pm UTC](https://forum.cloverdx.com/t/pass-parameters-to-the-xml-graph-in-clover-etl/1065/4 "2012-05-17T16:34:21Z")

</div>

Any updates on this?

Thanks,  
Naveen

---

<div class="post-metadata">

**Author:** ![vacekm](https://avatars.discourse-cdn.com/v4/letter/v/bbce88/32.png) [@vacekm](https://forum.cloverdx.com/u/vacekm)\
**Post date:** [May 18, 2012, 8:18am UTC](https://forum.cloverdx.com/t/pass-parameters-to-the-xml-graph-in-clover-etl/1065/5 "2012-05-18T08:18:09Z")

</div>

Hello,

can you provide us with the example file, where you’re trying to do this? We’ll take a look at it and then we can understand exactly on where do you want to get it from and into what component to insert it. There’s several ways to do this, but it depends on the case.
