Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling an Oracle stored proc - stuck on this for 2 days
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01510933
Message ID:
01510948
Views:
82
Across ODBC or OLEDB?!? No way... But if you have access to Oracle server and you have write own function...
//----------------------------------------
// ORACLE PART
//----------------------------------------
DROP TYPE VT11_T
/
DROP TYPE VT11_O
/

CREATE OR REPLACE TYPE VT11_O IS OBJECT
 (appconfig_pk INT,  config_description VARCHAR2(50),  config_value VARCHAR2(150))
/
CREATE OR REPLACE TYPE VT11_T AS TABLE OF VT11_O
/

CREATE OR REPLACE FUNCTION Victor_test11
RETURN VT11_T
AS
 loBaseTree VT11_T;
BEGIN
  Select VT11_O(appconfig_pk, config_description,  config_value)
      BULK COLLECT INTO loBaseTree
    FROM appconfig
    ORDER BY appconfig_pk;
 RETURN loBaseTree;

EXCEPTION
 WHEN OTHERS THEN
 loBaseTree.DELETE;
 RETURN loBaseTree;
END;
/
SELECT * FROM TABLE(Victor_test11)
/

*----------------------------------------
* VFP PART
*----------------------------------------
=SQLEXEC(handle,"SELECT * FROM TABLE(Victor_test11)")
MartinaJ

>I am having a problem figuring out how to call an Oracle stored procedure from VFP - and I've been stuck on this for 2 days now - really driving me nuts as this should be something very simple.
>
>Here is my stored proc:
>
>CREATE OR REPLACE PROCEDURE KPOPS.Victor_test10 (p_recordset out Types.cursor_type) AS
>
>BEGIN
> Open p_recordset FOR
> Select appconfig_pk,
> config_description,
> config_value
> FROM appconfig
> ORDER BY appconfig_pk;
>
>END Victor_test10;
>
>
>I have a "package" called TYPES that has this in it (for the cursor data type)
>
>CREATE OR REPLACE PACKAGE KPOPS.victor_test_package1 IS
> type test_type_name is ref cursor return appconfig%rowtype;
> END victor_test_package1;
>
>
>....If I goto to SQL PLUS and run this it works:
>
>>variable c refcursor
>>exec kpops.victor_test10(:C)
>
>So HOW THE HELL do I run this stupid thing from VFP ? Nothing I've seen works.
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform