Skip to main content

Hi

I'm having an issue using a User Paramater inside the END SQL with the Oracle Writer.

 

I can use it in the WHERE clause on the Reader no problem but using the same format on the END SQL is causing me some problem. I'm sure it is something simple that I've missed! 

Reader WHERE:

USERUPDATED = '$(P_USERNAME)'

Writer END SQL:

DELETE FROM DB_UPDATED WHERE USERUPDATED = '$(P_USERNAME)'

It literally tries to find the string $(P_USERNAME)

Here is the contrived example (yes I would normally do this in SQL!):

http://db.tt/kWQgcu3j

Hi Mark,

 

 

I've experienced some of the same issues, although not necessarily at the same place as you do). It seems that FME is not always entirely consequent in the way it expands parameter macros.

 

 

The only solution I know of is to create a Python scripted parameter that returns the entire contents and then to bind it to to the desired setting using right-click / link to parameter.

 

 

Example python scripted parameter

 

 

username = FME_MacroValuesr"P_USERNAME"]

 

end_sql = "DELETE FROM DB_UPDATED WHERE USERUPDATED = '" + username + "'"

 

return end_sql

 

 

David

Hi David 

Fast repsonse as always - Do you live on here ? :-)

Your suggestion was what was similar to something I thought of but thought there must be something simple I'd missed!

My workaround was a Private Parameter (not Python Scripted) configured:

DELETE FROM DB_UPDATED WHERE USERUPDATED ='$(P_USERNAME)'

and link this to the END SQL

Mark


Hi Mark,

 

 

your solution is equally elegant, but you've probably discovered by now that I am a big fan of Python in FME, so there you go ;-)

 

 

David

 

 

PS: it's a question of being efficient while FME does its thing 🙂

Have just realised it isn't a single query to execute :-( 

Might use a SQLExecutor and a trigger of Creator with Create at End = Yes 


Hi Mark,

 

You're correct that this doesn't work now. I'm not sure why but from my talks with the developers it seems that this could be implemented. So this is filed as PR#43215 and I will let you know when the fix is in place.

 

 

Regards

 

 

Mark

 

 

Product Evangelist

 

Safe Software Inc
Hi Mark,

 

 

I mailed the Safe Support Team and got an answer confirming this. Thanks for the reply on here.

 

 

Mark

 

 

 


Reply