Goracle.v2 - How do i Query a SP with a cursor?

Greetings everyone.
I didn’t find any tutorial except the API documentation:

I would appreciate it very much if someone could help me with that in general,
Or specific to the question.

I have a PHP code that works fine :

$sqlStr = oci_parse($conn , 'BEGIN DB_API.GetSitesInfo(:P_USERID , :P_SITEID  , :p_cv_DeviceDetails) ; END;') ;
oci_bind_by_name($sqlStr , ':P_USERID' , $USERID );
oci_bind_by_name($sqlStr , ':P_SITEID' , $SITEID );
// The relevant row: 
$OUTPUT_CUR = oci_new_cursor($conn);
oci_bind_by_name($sqlStr , ':p_cv_DeviceDetails' , $OUTPUT_CUR , -1, OCI_B_CURSOR );

oci_execute($sqlStr) ; 
oci_execute($OUTPUT_CUR) ; 

How do I do that in golang?
I Have tried several assignments to “res” but nothing worked :frowning:

res := db.NewCursor() // No such thing. tried res = interface{} and res := "" too 
cur , err := db.Query("BEGIN DB_API.GetSitesInfo(:P_USERID , :P_SITEID  , :p_cv_DeviceDetails) ; END;", 1, 2, &res)

Many thanks ahead

I have the same question. How to call packaged procedures and functions… and when a return or parameter is of type SYS_REFCURSOR.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.