[vwnc] Oracle stored procedures Glorp/Exdi vw7.6

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] Oracle stored procedures Glorp/Exdi vw7.6

Steve Aldred-3
Has anybody successfully used VW7.6 to call Oracle stored procedures?

We know Glorp is missing this functionality but we can't see how
OracleEXDI can do it either.

An example would be great.

thanks
Steve
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] Oracle stored procedures Glorp/Exdi vw7.6

Frank Urbach
What about create a wrapper function in the database and then calling this from within a normal sql-statement.

Cheers,
  Frank

-- send from a Blackberry
------Originalnachricht------
Von: [hidden email]
An: [hidden email]
An: [hidden email]
Antwort an: [hidden email]
Gesendet: 5. Aug. 2008 04:21
Betreff: [vwnc] Oracle stored procedures Glorp/Exdi vw7.6

MessageID: <IFC4D1B6>

Has anybody successfully used VW7.6 to call Oracle stored procedures?

We know Glorp is missing this functionality but we can't see how
OracleEXDI can do it either.

An example would be great.

thanks
Steve
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc



---
Edelstahlwerke Schmees GmbH
Geschäftsleitung Clemens Schmees
Sitz D-01796 Pirna
Handelsregister Dresden HRB 54
www.schmees.com

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] Oracle stored procedures Glorp/Exdi vw7.6

Wallen, David
In reply to this post by Steve Aldred-3

Sorry I don't have any quick examples right off. Assuming that you've
gone through the DatabaseAppDevGuide.pdf (the Oracle chapter section
that discusses PLSQL), it would help if you posted the interface
declaration of a stored proc you're trying to use, along with the
Smalltalk code you're using to call it.

- Dave

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
Behalf

> Of Steve Aldred
> Sent: Monday, August 04, 2008 7:22 PM
> To: vwnc-list
> Subject: [vwnc] Oracle stored procedures Glorp/Exdi vw7.6
>
> Has anybody successfully used VW7.6 to call Oracle stored procedures?
>
> We know Glorp is missing this functionality but we can't see how
> OracleEXDI can do it either.
>
> An example would be great.
>
> thanks
> Steve
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] Oracle stored procedures Glorp/Exdi vw7.6

clemens@heeg.de
In reply to this post by Steve Aldred-3
Hello,

PL/SQL in Oracle EXDI does not differe from plain SQL that much.
This example shows how to use PL/SQL. Basically you have to:

1) parse the statement
2) bind the input parameter
3) create the buffer for the output parameters
4) bind the output parameters
5) execute the statement
6) read the output parameters.

The PLSQL package sinply count the size of the array passed as parameter

CREATE OR REPLACE PACKAGE PACK_SIZE
-- -------------------------------------------------------------------------
---
-- Exampe package for showing OracleEXDI Bug in handling Arrays when
-- caching the session cursors
--
-- -------------------------------------------------------------------------
---
AS
        TYPE NUM_T_type IS TABLE OF NUMBER index by pls_integer;
        PROCEDURE GET_SIZE (p_NumTab IN NUM_T_type, p_Size out NUMBER);
END PACK_SIZE;
/

CREATE OR REPLACE PACKAGE BODY PACK_SIZE
AS
        PROCEDURE GET_SIZE (p_NumTab IN NUM_T_type, p_Size out NUMBER)
        IS
        BEGIN
                p_Size := p_NumTab.COUNT;
        END GET_SIZE;
END PACK_SIZE;
/

The following workspace executes the procedure in the package

| connection session data count |
(connection := OracleConnection new)
        environment: <the database>;
        username: <the user>;
        password: <the users password>;
        connect.

session := connection getSession.
[session preparePLSQL: 'begin PACK_SIZE.GET_SIZE(:data, :size); end;'.

data := OrderedCollection new: 10.
1 to: 10 do: [:index | data add: index].
session bindVariable: #size value: 0.
session bindVariable: #data value: data type: Integer size: nil.
session execute.
session answer.
count := (session bindVariable: #size)] ensure: [session disconnect].

Hope this helps

Clemens Hoffmann


Original Message:
-----------------
From: Steve Aldred [hidden email]
Date: Tue, 05 Aug 2008 12:21:40 +1000
To: [hidden email]
Subject: [vwnc] Oracle stored procedures Glorp/Exdi vw7.6


Has anybody successfully used VW7.6 to call Oracle stored procedures?

We know Glorp is missing this functionality but we can't see how
OracleEXDI can do it either.

An example would be great.

thanks
Steve
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


--------------------------------------------------------------------
mail2web LIVE – Free email based on Microsoft® Exchange technology -
http://link.mail2web.com/LIVE



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] Oracle stored procedures Glorp/Exdi vw7.6

Steve Aldred-3
Thanks Clemens,

That's just what we needed.

Thanks to the others who replied as well.

cheers
Steve

> Hello,
>
> PL/SQL in Oracle EXDI does not differe from plain SQL that much.
> This example shows how to use PL/SQL. Basically you have to:
>
> 1) parse the statement
> 2) bind the input parameter
> 3) create the buffer for the output parameters
> 4) bind the output parameters
> 5) execute the statement
> 6) read the output parameters.
>
> The PLSQL package sinply count the size of the array passed as parameter
>
> CREATE OR REPLACE PACKAGE PACK_SIZE
> -- -------------------------------------------------------------------------
> ---
> -- Exampe package for showing OracleEXDI Bug in handling Arrays when
> -- caching the session cursors
> --
> -- -------------------------------------------------------------------------
> ---
> AS
> TYPE NUM_T_type IS TABLE OF NUMBER index by pls_integer;
> PROCEDURE GET_SIZE (p_NumTab IN NUM_T_type, p_Size out NUMBER);
> END PACK_SIZE;
> /
>
> CREATE OR REPLACE PACKAGE BODY PACK_SIZE
> AS
> PROCEDURE GET_SIZE (p_NumTab IN NUM_T_type, p_Size out NUMBER)
> IS
> BEGIN
> p_Size := p_NumTab.COUNT;
> END GET_SIZE;
> END PACK_SIZE;
> /
>
> The following workspace executes the procedure in the package
>
> | connection session data count |
> (connection := OracleConnection new)
> environment: <the database>;
> username: <the user>;
> password: <the users password>;
> connect.
>
> session := connection getSession.
> [session preparePLSQL: 'begin PACK_SIZE.GET_SIZE(:data, :size); end;'.
>
> data := OrderedCollection new: 10.
> 1 to: 10 do: [:index | data add: index].
> session bindVariable: #size value: 0.
> session bindVariable: #data value: data type: Integer size: nil.
> session execute.
> session answer.
> count := (session bindVariable: #size)] ensure: [session disconnect].
>
> Hope this helps
>
> Clemens Hoffmann
>  

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc