call a stored procedure with passing parameter

More
9 years 1 month ago #11175 by orlandoc
Here are my objectives:
1.) Generate a GUID value
2.) using "Reader" under Transformation, select a stored procedure and pass the GUID value
3.) this stored procedure will return number of columns and rows
4.) from "Reader" to "Validator" node to validate some value returned by the stored procedure
5.) from "validator" to "transformer" to select some fields and save it to another table.

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #11176 by admin
Perhaps you can post dummy stored procedure source?

Than we will be able to create a working example for you

Mike

Mike
ETL Architect

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago - 9 years 1 month ago #11182 by orlandoc
CREATE TABLE TBL_DATA
(
A VARCHAR(50),
B VARCHAR(24),
X INT IDENTITY(1,1) PRIMARY KEY
)


GO


CREATE PROC tsp_GetWork
(
@P VARCHAR(50)
)
AS
SELECT * FROM TBL_DATA
WHERE A = @P

GO

INSERT INTO TBL_DATA (A,B) SELECT 'DANIEL','CANADA'
INSERT INTO TBL_DATA (A,B) SELECT 'JUDY','CANADA'
INSERT INTO TBL_DATA (A,B) SELECT 'ORLANDO','CANADA'
INSERT INTO TBL_DATA (A,B) SELECT 'STEVE','USA'
INSERT INTO TBL_DATA (A,B) SELECT 'JEB','USA'
Last edit: 9 years 1 month ago by orlandoc.

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #11186 by admin
Theres is no need to use stored procedure in your case
But if you want to you can do something like this





Mike

Mike
ETL Architect
Attachments:

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #11187 by orlandoc
my requirement is to pass a GUID to the stored procedure.
Now, how do i generate a GUID and pass it to a variable <VariableName> and pass it to a Data Reader?

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #11188 by admin
Download and install latest version

and use script object to assign value to the variable



Mike

Mike
ETL Architect
Attachments:

Please Log in or Create an account to join the conversation.