Thanks Peter,
I have tried the INCLUDE solution and it works as i wanted.
André
I put below how i've done it
In the FMW header file
------------------------
.....
And the Where Clause
INCLUDE [source {$(FME_MF_DIR)
\Flights_TCL_Procedures.tcl};SetLobtFilter]
DEFAULT_MACRO DBIN_WhereClause_ORACLE8_DB_1
$(DBIN_WhereClause_ORACLE8_DB)
GUI TEXT DBIN_WhereClause_ORACLE8_DB_1 Where Clause:
ORACLE8_DB_1_WHERE_CLAUSE "$(DBIN_WhereClause_ORACLE8_DB_1)"
....
my SetLobtFilter procedure in Flights_TCL_Procedures.tcl file:
--------------------------------------------------------------
proc SetLobtFilter {} {
#Set Flight date to load to current Date minus 2 days
set FlightDate [clock format [clock scan "-2 days"] -format "%Y-%m-%
d"]
#Set WhereClause for FME
set StartDateFilter "to_date('$FlightDate 00:00:00','YYYY-MM-DD
HH24:MI:SS')"
set EndDateFilter "to_date('$FlightDate 23:59:59','YYYY-MM-DD
HH24:MI:SS')"
set DateFilter "LOBT >= $StartDateFilter AND LOBT <= $EndDateFilter"
#Output the WhereClause
puts "DEFAULT_MACRO DBIN_WhereClause_ORACLE8_DB_1 $DateFilter"
}
---------------------------------------
--- In [email protected], "peter laulund" <[EMAIL PROTECTED]>
wrote:
>
> Hi
>
> the short answer is no
>
> but you can use the INCLUDE [ tcl script .. ] syntax instead
>
> everything you print to stdout with puts is includede in tha
mapping file,
> so what you have to do is printing MACRO directives into your
mapping file,
> and you can then use teh MACRO values wherever you like
>
> I had a disscusion with MARK a few weeks ago about this subject,
look at
> this for some more see messagede #13332
>
> Peter
>
>
> >From: "dauzat1932" <[EMAIL PROTECTED]>
> >Reply-To: [email protected]
> >To: [email protected]
> >Subject: [fme] Problem passing variable from a FME_BEGIN_TCL to
the mapping
> >translation
> >Date: Mon, 26 Feb 2007 19:55:48 -0000
> >
> >
> >Hi,
> >
> >Is there a way to pass a variable defined in the FME_BEGIN_TCL
into
> >the mapping ?
> >
> >I am curently having problem with that. I have define a
> >FME_BEGIN_TCL which call a tcl script which calculate a date and
> >format a string as an Oracle where clause.
> >
> >I need to provide this string to the mapping to set
> >the WhereClause of the Source Dataset.
> >
> >Here is what i have put in the header of the Mapping
> >
> >....
> >#
>
>====================================================================
=
> ># The following lines instructs the FME to perfom some pre- and
post-
> >processing
> ># before and after the translation
> >FME_BEGIN_TCL source {$(FME_MF_DIR)\Begin_Tcl_
> >Load_CFMU_Flights.tcl}; set LobtFilter [BeginLoadFlights]
> >FME_END_TCL source {$(FME_MF_DIR)\End_Tcl_ Load_CFMU_Flights.tcl};
> >EndLoadFlights $LobtFilter
> >...
> >...
> ># And the Where Clause
> >#DEFAULT_MACRO DBIN_WhereClause_ORACLE8_DB_1
> >$(DBIN_WhereClause_ORACLE8_DB_ORACLE8_DB_1)
> >DEFAULT_MACRO DBIN_WhereClause_ORACLE8_DB_1 $LobtFilter
> >GUI TEXT DBIN_WhereClause_ORACLE8_DB_1 Where Clause:
> >ORACLE8_DB_1_WHERE_CLAUSE "$(DBIN_WhereClause_ORACLE8_DB_1)"
> >....
> >
> >The result is that the WhereClause is set to "$LobtFilter" instead
> >of the value of the LobtFilter.
> >
> >Any ideas ?
> >
> >Thanks, André
> >
> >
> >
> >
>
> _________________________________________________________________
> Få de bedste søgeresultater med MSN Search: http://search.msn.dk
>
For insights into what's up at Safe Software and what's on the development
horizon, visit Safe's blog at spatial-etl.blogspot.com.
Safe Software has also made slides available that outline enhancements planned
for FME 2007. The slides are from the "Road Ahead" presentation given on Day 2
of the FME Worldwide Users Conference. To view these slides, visit
www.safe.com/2006uc.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/fme/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/fme/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/