Post Reply 
 
Thread Rating:
  • 30 Votes - 2.8 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Curl execute Oracle database procedure
04-14-2017, 11:38 AM (This post was last modified: 04-14-2017 04:38 PM by NamDH.)
Post: #1
Curl execute Oracle database procedure
Hello.

I already have:
- Curl sample connected to Oracle database.
- Oracle database have some procedure and function.

Let's assume I created procedure in Oracle name PR_SELECT_DATA:
Code:
CREATE PROCEDURE PR_SELECT_DATA (TOTAL_RECORD OUT NUMBER) AS    
    BEGIN
        SELECT
            COUNT(*)    
        INTO
            TOTAL_RECORD
        FROM
            TOP_SALES_CUSTOMERS;    
    END;
/


Now I want to execute this procedure in Curl code, I expect something like:
Code:
connection.executeProcedure("PR_SELECT_DATA ");
connection.executeFunction("FUNCTION_NAME ");

I have tried:
Code:
{let statement:String =
     {
        String
            "DECLARE TOTAL_RECORD NUMBER;"         , "BEGIN        PR_SELECT_DATA (TOTAL_RECORD);        END;" }
}
{connection.execute "SH", statement}
but no luck.

I searched in this forum, no luck again.
Can anyone help me?
Find all posts by this user
Quote this message in a reply
04-18-2017, 08:52 AM
Post: #2
RE: Curl execute Oracle database procedure
I don't think Curl' ConnectedRecordSet supports stored procedure.
To do this, you need to create your own ConnectedRecordSet together with a server-side program/API to help you execute such a database procedure.
Find all posts by this user
Quote this message in a reply
04-21-2017, 11:18 AM
Post: #3
RE: Curl execute Oracle database procedure
(04-18-2017 08:52 AM)tdeng Wrote:  I don't think Curl' ConnectedRecordSet supports stored procedure.
To do this, you need to create your own ConnectedRecordSet together with a server-side program/API to help you execute such a database procedure.
I found the way to execute store procedure and function Oracle.

To execute Procedure:
Code:
{let rs:RecordSet=
    {connection.create-record-set "DATABASE_NAME", "call PROCEDURE_NAME()"}
}

I have tried procedure with update statement and it successful.

To call Function:
Code:
{let rs:RecordSet=
    {connection.create-record-set "DATABSE_NAME","SELECT FUNCTION_NAME() AS ABC FROM DUAL"}
}
{rs.load}

{for r:Record in rs do
    {outfmt {format "%s, ", r["ABC"]}}
}

It will show return value of function in CURL console.
Find all posts by this user
Quote this message in a reply
04-21-2017, 03:40 PM
Post: #4
RE: Curl execute Oracle database procedure
WOW, Congratulations! That's cool, and new to me Smile
Thank you for sharing your information with us!
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  TLS通信下でCould not deserialize the object from Curl.発生 MIT 3 1,873 03-10-2017 08:35 AM
Last Post: MIT
  Protecting SSL private key in a Curl script aensys 1 766 02-10-2017 02:02 PM
Last Post: heavybugtracker
  curl library 7.36.0: curl_easy_perform() function call failed when used for getting a joezhao 1 1,304 10-19-2016 09:41 AM
Last Post: dyoshida
  Curl IDE からのランチャが見つかりません umemura 1 1,735 06-30-2016 10:12 AM
Last Post: umemura
  Curl RTE Install smtit 1 1,415 05-06-2016 12:36 PM
Last Post: dice256
  Curl RTE Command line smtit 1 1,685 04-19-2016 09:35 AM
Last Post: dice256
  What OS that CURL can support for deloyment? tiennv 1 3,226 08-22-2015 02:12 AM
Last Post: tdeng
  Curl RTEのPPAPIプラグインについて でり 1 3,119 06-09-2015 11:03 AM
Last Post: でり
  cURL Client app Michael-2015 1 2,659 04-16-2015 12:27 PM
Last Post: dyoshida
  Could not deserialize the object from Curl. umemura 4 4,895 04-11-2015 04:45 AM
Last Post: Sumerjobs
Forum Jump:


User(s) browsing this thread:
1 Guest(s)