Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
FD1690464541
Contributor
Contributor

PL/SQL integration : how to read variable of PL/SQL script ?

Hello,

I spent several hours searching and couldn't find the answer to my problem.

I have a PL/SQL script that retrieves and processes different data in recursive tables with multiple cursors. It's very efficient.

Before Talend, data were output via the console. 

I'd like to retrieve this data in a Talend Open Studio flow so that I can carry out further processing.

I've tried several components but I can't access the variables defined in the PL/SQL script. I'm at the end of what I can test.

Does anyone have a solution (without making a temporary table or stored procedure)?

Thanks in advance,

PS : any information about how to integrate Oracle bulk treatment is also welcome.

Labels (3)
2 Replies
Anonymous
Not applicable

@Franck Deroche​ , try to use tSystem or tOracleRow to execute the PL/SQL script. if the data were output on the console, will try to capture the console's output data , and then extract the required data from the output string.

LWillie1691662979
Contributor
Contributor

In Talend Open Studio, you can interact with PL/SQL scripts and retrieve data from them using the tOracleRow component. The tOracleRow component allows you to execute custom SQL or PL/SQL statements and capture the output.

 

Here's how you can read variables from a PL/SQL script using the tOracleRow component:

 

Add tOracleRow Component:

Drag and drop the tOracleRow component from the palette onto your Talend job design.

 

Configure Connection:

Set up the database connection by linking the tOracleRow component to a tOracleConnection component or by configuring the connection directly in the tOracleRow component.

 

Define PL/SQL Script:

In the tOracleRow component, click on the "Edit Schema" button and define the schema of the output data (if applicable). In the "Query" field, enter your PL/SQL script that retrieves the data you need. You Myjdfaccount Login can include variables in the PL/SQL script.

 

DECLARE

  my_variable NUMBER := 123;

BEGIN

  -- Your PL/SQL logic here

END;

 

 

Access Output:

If your PL/SQL script produces output data that you want to access, define the output schema in the tOracleRow component's "Output" tab. Map the output variables to the corresponding columns in your output schema.

 

Further Processing:

After retrieving the data using tOracleRow, you can connect it to other components in your Talend job for further processing.

 

Regarding Oracle bulk treatment, you can use the tOracleBulk component in Talend to perform bulk data operations in Oracle databases. This component allows you to load data into Oracle tables efficiently using bulk loading methods.

 

Remember that Talend provides extensive documentation and resources, so you can refer to Talend's documentation for more detailed guidance and examples on using the tOracleRow and tOracleBulk components with Oracle databases and PL/SQL scripts.