Friday, March 9, 2012

Parameters in an OLE DB Command

Hello!

Is there a way to use an OLE DB Command transform to execute the following SQL query?

"Select sum(length(" + @.[User::varDBName] + ":informix.cyh_t.u_obj)) from " + @.[User::varDBName] + ":informix.cyh_t, " + @.[User::varDBName] + ":informix.cch_t
where " +
@.[User::varDBName] + ":informix.cch_t.d_obj = {D '" + @.[User::strQueryDate] + "'} and " +
@.[User::varDBName] + ":informix.cch_t.n_objid = " + @.[User::varDBName] + ":informix.cyh_t.n_objid"

I get a DB number from an OLE DB Source, do a lookup to get the DB name and then I want to use the OLE DB command to get a result from the query but I can't seem to get this to work. Am I using the wrong transform?

Thanks.

Not quite sure what you want to do here but issuing a SELECT statement from an OLE DB Command won't do anything. It won't insert records into the pipeline for you. If that is what you want to do then LOOKUP is more suitable.

-Jamie

|||Are you querying the same database for all of your information? Or are you going at multiple databases? You might be better off doing some of this work in the control flow if you have different databases. If they are the same databases, then just issue a compound query.|||

Thank you both for your replies. I think I have a flaw with my flow. I am querying multiple databaes so I'll try reworking the flow.

Thanks again!

No comments:

Post a Comment