Skip to main content

Retrieving personal information using a stored procedure

This scenario describes a Job that retrieves a personal information record from a specified table using a stored procedure according to the id value defined in the input flow.

For more technologies supported by Talend, see Talend components.

In this scenario, the table to retrieve data from contains the personal information. To reproduce this scenario, you can write the data into the table from a CSV file like the following. For how to write data into a MS SQL table, see Inserting data into a database table and extracting useful information from it.

id;name;sex;age
1;Ford;Male;25
2;Rose;Female;30
3;Sabrina;Female;28
4;Teddy;Male;32
5;Kate;Male;35

In this scenario, the stored procedure used to retrieve the personal information is as follows:

CREATE PROCEDURE [dbo].[QueryPerson]
@id int,
@name varchar(50)
AS
BEGIN
SET NOCOUNT ON
SELECT * FROM dbo.person where id=@id
END

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!