March 10, 2009 at 2:21 pm
Can I use variable in my OLE DB Command?
Like this:
update
mst.TRANSIT_DIM
set
TRANS_END_DT = @[User::v_PROC_END_DT],
ACTIVE_ROW_FL = 0,
UPDATE_DT = GetDate()
where
TRANSIT_NUM = ?
March 11, 2009 at 6:58 am
I don't believe you can unless you are setting up your SQL Statement to be from a variable and you build the variable ahead of the OLE DB Command step.
I believe you can do it like this:
update
mst.TRANSIT_DIM
set
TRANS_END_DT = ?,
ACTIVE_ROW_FL = 0,
UPDATE_DT = GetDate()
where
TRANSIT_NUM = ?
And now you have 2 parameters in the command and parameter 0 would have the @[User::v_PROC_END_DT] assigned to it.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
March 11, 2009 at 8:05 am
I don't really understand where these
Param_0
Param_1
Param_2
in OLE DB Command are coming from.
Is it whenever you have "?" in your command it creates a new Param?
OK. But then I would need to have a Derived Column
"cnv_PROC_END_DT" = @[User::v_PROC_END_DT] so that I can connect my Param_0 to something?
Right?
I thought I could eliminate this Derived Column step and
assign @[User::v_PROC_END_DT] value to "TRANS_END_DT" directly inside the command.
Please see my attachment.
Connecting [cnv_PROC_END_DT] to Param_0
and [TRANSIT_NUM] to Param_1
does the job but I do it blindly.
I don't understand how TRANS_END_DT gets updated properly
because I don't connect it to anything in GUI.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply