Hi
I think that you can pass a varible with spaces, but how I have forgot right
now
but about #1
you can do this with a bit off tcl, and it is interesting as you can use
this as general technic to manipulate macro values, what you have to do is
to pass the macro into a tcl script, manipulate it and write out a new
macro. In your case ( if you replace all spaces with a 'X' ) you can put the
line below into the start section off your mapping file
INCLUDE [ puts "MACRO newMacro [ regsub -all -- {X} $(OldMacro) { } ]" ]
Note you can use any caracter as the 'space' value but be avare that some
caracters (\^;,.$? and more ) has a special mening in tcl / regsub in this
case you will have to escape it with a \ like this
INCLUDE [ puts "MACRO newMacro [ regsub -all -- {\.} $(OldMacro) { } ]" ]
this technic is extremy usefull to modify macro vlaues and I use it a lot.
a more advanced exampel on this could be that you use oratcl to lookup one
ore more values in a oracle databasen and then write one ore more macroes
into the mapping file
peter
>From: "Roland Martin" <[EMAIL PROTECTED]>
>Reply-To: [email protected]
>To: [email protected]
>Subject: [fme] Passing a variable with spaces
>Date: Tue, 6 Mar 2007 14:13:17 +0000
>
>Hi, me again.
>
>So, this is what I'm up to this time:
>- I have a postgis database
>- I want to extract different bits of it to a CAD file, using the published
>parameter to specify the 'where' clause
>
>The problem I'm having is that the where clause contains spaces. This is
>not
>a problem if you enter the text directly into the Properties/Parameters
>box,
>but if you try to pass it as a published parameter, Workbench immediately
>throws a wobbler:
>
> fme.exe export_postgis_DWG.fmw
> --SourceDataset_POSTGIS [db]
> --DestDataset_ACAD [file]
> --postgis_sql_where_clause "field = 'value'"
>
>2007-03-06 13:56:15| 0.7| 0.0|ERROR |Error executing SQL command
>('DECLARE [table]_crsr____ CURSOR FOR SELECT [fields] FROM [table] WHERE
>field'): 'ERROR: argument of WHERE must be type boolean, not type integer
>'.
>
>Clearly it's just trimming off everything after the space.
>
>So, 2 questions:
>1. is there an alternative character I can use that will still be
>understood? i.e. if I change all my spaces to (for example) carets, will
>FME
>and PostGIS still happily accept this as a query?
>2. is there any obvious way round this? The only alternative I can see is
>to
>somehow convert all the bits of the query into AttributeFilters, which
>would
>be very troublesome
>
>Thanks!
>Roland.
_________________________________________________________________
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/