0

I am new to Oracle SQL Procedures and trying to workout on few problems on my own. Currently I am having a trouble in solving a particular problem. I want to write a procedure where it would take a particular value from the output of 1st API and use it as an input on the 2nd API.

I wrote two procedure one for 1st API and 2nd for 2nd API but I dont know how to connect each other.

Procedure 1

PROCEDURE dev1(
OUT result CURSOR (
    Id VARCHAR(100)
    )
)
BEGIN
    OPEN result FOR 
        SELECT 
            Id
        FROM      
            REST_API1;
END  

Procedure 2

PROCEDURE Details_Dev_para2(
IN progID VARCHAR(255), 
OUT result CURSOR 
)
BEGIN
    OPEN result FOR 
        SELECT 
            *
        FROM      
            REST_API2;
END  

I want the output ID from 1st API to be the Input in ProgID for 2nd API

Nik
  • 155
  • 1
  • 10
  • You got to call the first proc in the second one. Store the value of first in variable and pass it to second. See this existing one https://stackoverflow.com/questions/3415232/call-a-stored-procedure-with-another-in-oracle – sandy v Jul 25 '19 at 03:07
  • Hi @sandyv the link that you shared is dealing with a Table and there they are storing the data. Here it is in JSON format, well I have parsed it into table format but the output ID from API1 would be the Input in API2. I dont know how to connect these two in a single procedure – Nik Jul 25 '19 at 18:30

0 Answers0