Hello,
Viktor Ustynov wrote:
> How can I get oracle cursor from the out parameter of stored procedure?
The test suite for Oracle (src/backeds/oracle/test-oracle.cpp) contains
an example with cursor (test4), which could (?) work with our parameter
of a stored procedure.
> I tryed following example:
>
> ===========
> int main()
> {
> session sql(oracle, "service=DEV1 user=vust password=vust");
>
> try {
>
> int i = 10;
> statement cursor( sql );
>
> statement st = ( sql.prepare << "begin test.test1( :i, :o_cursor
> ); end;",
> use( i, "i"),
> use( cursor, "o_cursor")
> );
The example in tests has the into() element, not use(). Did you try it?
In addition, the cursors will need to declare its own data bindings
(presumably into(), as shown in the test suite).
The example code from the test suite is:
statement stInner(sql);
statement stOuter = (sql.prepare <<
"select cursor(select name from soci_test order by id)"
" from soci_test where id = 1",
into(stInner));
stInner.exchange(into(name));
stOuter.execute();
stOuter.fetch();
std::vector<std::string> names;
while (stInner.fetch()) { names.push_back(name); }
Regards,
--
Maciej Sobczak * www.msobczak.com * www.inspirel.com
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users