SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


help with expression builder in SSIS 2008


help with expression builder in SSIS 2008

Author
Message
avishain
avishain
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 115
Hello there,,

i got a variable which is an Expression.

my expression is this:

'||'''DateVar'''||'

i got another variable which is the DateVar and looks like :

02/07/2013

i want to populate the expression and to get this expression:
'||''02/07/2013'''||'

when im trying to do that like this:
'||''@[user:BigGrinateVar]'''||'

i dont get what i need....(i doesnt treat the variable as a variable but as a text)

i think i should use an escape character...

can someone help plz?

thank you
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)

Group: General Forum Members
Points: 64410 Visits: 13298
avishain (10/23/2013)
Hello there,,

i got a variable which is an Expression.

my expression is this:

'||'''DateVar'''||'

i got another variable which is the DateVar and looks like :

02/07/2013

i want to populate the expression and to get this expression:
'||''02/07/2013'''||'

when im trying to do that like this:
'||''@[user:BigGrinateVar]'''||'



Dont't use the single quotes.

"||" + @[user:BigGrinateVar] + "||".

I assume @[user:BigGrinateVar] has the string data type. If not, you need to add a cast.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
avishain
avishain
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 115
thank you very much,

but i have to keep this format since i execute this string via EXCECUTE SQL TASK ( i send it to an oracel DB to run a "PACKAGE" (stored procedure)


so i have to keep this format in order to run it in the oracle...
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)

Group: General Forum Members
Points: 64410 Visits: 13298
avishain (10/23/2013)
thank you very much,

but i have to keep this format since i execute this string via EXCECUTE SQL TASK ( i send it to an oracel DB to run a "PACKAGE" (stored procedure)


so i have to keep this format in order to run it in the oracle...



If you want some decent help, you'll need to give more information.
How does the entire query need to look like?


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
avishain
avishain
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 115
the first pic is the query that runs inside the oracle .

the second is how it should be in the ssis


i need to replace all the dates in that query to variables...

cause i want it to be dynamic
Attachments
1.jpg (12 views, 42.00 KB)
2.jpg (11 views, 84.00 KB)
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)

Group: General Forum Members
Points: 64410 Visits: 13298
Just make sure that each part of the query that is not dynamic is a string properly enclosed with double quotes.
The variables need to be concatenated to the strings using +. Make sure those variables are either strings or casted to strings.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search