dbTalk Databases Forums  

How can I pass data into a boolean variable in SSIS from Oracle?

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss How can I pass data into a boolean variable in SSIS from Oracle? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
greenmtnsun
 
Posts: n/a

Default How can I pass data into a boolean variable in SSIS from Oracle? - 01-30-2009 , 05:28 PM






I have data in a table in Oracle that I want to query tp simply find out if
something is true or false. Then, I want to tell SSIS to evaluate whether
its true or false and decide if it should execute a certain step.

So far, the only way I have been able to do that is as follows:
1. In oracle, create a view that basically does something like this select *
from table1.
2. In SQL Server I do the following:

declare @ARE_THERE_DUP_ACTIVE_ACCOUNTS as BIT

SELECT @ARE_THERE_DUP_ACTIVE_ACCOUNTS = (CASE WHEN
SUM(ARE_THERE_DUP_ACTIVE_ACCOUNTS)>0 THEN 1
ELSE 0
END
)
FROM
(
SELECT Count(*) as ARE_THERE_DUP_ACTIVE_ACCOUNTS from
LINKED_SERVER..SCHEMA.table1
UNION ALL
SELECT 0
) sub_select

select @are_there_dup_active_accounts as Are_There_Dup_Active_Accounts

3. Then I create an EXECUTE SQL step in SSIS.
4. I create a variable, in this case it's name is
Are_There_Dup_Active_Accounts as boolean
5. I create a step after the execute that I want to execute conditionally
and I link the first step into the second.
6. Then I create a precedence and evaluate on a Expression like this...
@[User::ARE_THERE_INC_BILL_STAGE_RUNS]

From there, the second step will run conditionally, depending on the results
of the SQL query. When this is SQL server data, its easy, but when its
Oracle, I am left with doing extra steps like creating a useless view and
granting privileges for the linked server just so that I can use SQL server's
TSQL which is compatible with SSIS's boolean data type.

Does anyone know of a better way?

Reply With Quote
  #2  
Old   
Todd C
 
Posts: n/a

Default RE: How can I pass data into a boolean variable in SSIS from Oracle? - 02-03-2009 , 07:33 AM






Why can't your Execute SQL Task go against Oracle directly and return a 0 or
1 as appropriate, and use an Integer variable instead of boolean?
Set your precedence constraint as "@[User::...]==1"
--
Todd C

[If this response was helpful, please indicate by clicking the appropriate
answer at the bottom]


"greenmtnsun" wrote:

Quote:
I have data in a table in Oracle that I want to query tp simply find out if
something is true or false. Then, I want to tell SSIS to evaluate whether
its true or false and decide if it should execute a certain step.

So far, the only way I have been able to do that is as follows:
1. In oracle, create a view that basically does something like this select *
from table1.
2. In SQL Server I do the following:

declare @ARE_THERE_DUP_ACTIVE_ACCOUNTS as BIT

SELECT @ARE_THERE_DUP_ACTIVE_ACCOUNTS = (CASE WHEN
SUM(ARE_THERE_DUP_ACTIVE_ACCOUNTS)>0 THEN 1
ELSE 0
END
)
FROM
(
SELECT Count(*) as ARE_THERE_DUP_ACTIVE_ACCOUNTS from
LINKED_SERVER..SCHEMA.table1
UNION ALL
SELECT 0
) sub_select

select @are_there_dup_active_accounts as Are_There_Dup_Active_Accounts

3. Then I create an EXECUTE SQL step in SSIS.
4. I create a variable, in this case it's name is
Are_There_Dup_Active_Accounts as boolean
5. I create a step after the execute that I want to execute conditionally
and I link the first step into the second.
6. Then I create a precedence and evaluate on a Expression like this...
@[User::ARE_THERE_INC_BILL_STAGE_RUNS]

From there, the second step will run conditionally, depending on the results
of the SQL query. When this is SQL server data, its easy, but when its
Oracle, I am left with doing extra steps like creating a useless view and
granting privileges for the linked server just so that I can use SQL server's
TSQL which is compatible with SSIS's boolean data type.

Does anyone know of a better way?

Reply With Quote
  #3  
Old   
greenmtnsun
 
Posts: n/a

Default RE: How can I pass data into a boolean variable in SSIS from Oracl - 02-03-2009 , 12:41 PM



Because I wasn't previously able to do that until someone on the forum said
to use a double equal sign. == I was using = which wasn't working.

I was only able to get a boolean through this thing because of that.

Thanks. I should have said that someone said the same thing over in the
MSDN forum.

"Todd C" wrote:

Quote:
Why can't your Execute SQL Task go against Oracle directly and return a 0 or
1 as appropriate, and use an Integer variable instead of boolean?
Set your precedence constraint as "@[User::...]==1"
--
Todd C

[If this response was helpful, please indicate by clicking the appropriate
answer at the bottom]


"greenmtnsun" wrote:

I have data in a table in Oracle that I want to query tp simply find out if
something is true or false. Then, I want to tell SSIS to evaluate whether
its true or false and decide if it should execute a certain step.

So far, the only way I have been able to do that is as follows:
1. In oracle, create a view that basically does something like this select *
from table1.
2. In SQL Server I do the following:

declare @ARE_THERE_DUP_ACTIVE_ACCOUNTS as BIT

SELECT @ARE_THERE_DUP_ACTIVE_ACCOUNTS = (CASE WHEN
SUM(ARE_THERE_DUP_ACTIVE_ACCOUNTS)>0 THEN 1
ELSE 0
END
)
FROM
(
SELECT Count(*) as ARE_THERE_DUP_ACTIVE_ACCOUNTS from
LINKED_SERVER..SCHEMA.table1
UNION ALL
SELECT 0
) sub_select

select @are_there_dup_active_accounts as Are_There_Dup_Active_Accounts

3. Then I create an EXECUTE SQL step in SSIS.
4. I create a variable, in this case it's name is
Are_There_Dup_Active_Accounts as boolean
5. I create a step after the execute that I want to execute conditionally
and I link the first step into the second.
6. Then I create a precedence and evaluate on a Expression like this...
@[User::ARE_THERE_INC_BILL_STAGE_RUNS]

From there, the second step will run conditionally, depending on the results
of the SQL query. When this is SQL server data, its easy, but when its
Oracle, I am left with doing extra steps like creating a useless view and
granting privileges for the linked server just so that I can use SQL server's
TSQL which is compatible with SSIS's boolean data type.

Does anyone know of a better way?

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.