Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling MDQ variables within a run-time map

Status
Not open for further replies.

jefflatkidsii

Programmer
Sep 21, 2006
3
US
Here's the background:

I have a simple SELECT query within an MDQ file where I'm pulling some data from our ERP system. Very standard method which we do often.

I'm trying to utilize the "Defined Variables" option for the first time and have some questions. Within the MDQ the query contains "Select * from SALES_ORD where USER_ORD_NO = #SALESORDERNO#". The defined variable being the item with enclosed with #'s.

At this point, I generate a type tree from this query, which I'm using as an input card into one of my maps. My question is, from this map how do I pass a value representing the defined variable to the MDQ. The source data which contains the value I want to use is a text file which is another input card from the same map. I'm actually able to get it to sort of work by configuring the command option of the input card with "-VAR SalesOrderNo=1". The problem with this method is that I'm hard-coding the value and I need to be instead, passing the variable piece of data from the map.

Any help would be greatly appreciated - and, if you need me to clarify further pls let me know.

 
Call this map from a higher level map and pas the -VAR parameter.

VALID(run("map.mmc","-OF1 outfile1" -ID1 '-VAR EXTRARULE2= ORDER BY SUM.ACC_NO'"),fail("failed Error = " + TEXT ( LASTERRORCODE ( ) ) + " " + LASTERRORMSG()))

where EXTRARULE2 is a variable to the query to allow extra SQL to be added to the query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top