Re: [Sqlrelay-discussion] Error messages are not visible
Brought to you by:
mused
|
From: Maciej W. <mac...@co...> - 2005-09-12 17:24:19
|
> Try it from sqlrsh and see if it works. This, for example works for me:
I'm not able to check it now (I have no sqlrelay, oracle environment here),
but I'll check this later.
> You should be able to run the function and get it's result without using
> a select, like this:
Yes, I know it works this way but the point is that in our apps we already
have some 'select xxx from dual' statements and I'm afraid about them. The
problem is not only with "cannot perform a DML
operation inside a query" but AFAIR with other exceptions too.
I can write script that will change inproper (dual)
statements to correct ones and tell programmers not to use such things
but it'll be nice if sqlrelay will work with this.
--
Maciej Wisniowski
Firstworks/4access wrote:
>I wonder if the problem is specific to the python API. Try it from
>sqlrsh and see if it works. This, for example works for me:
>
>0> create table testtable (col1 varchar2(20)); Rows Returned :
>0
> Fields Returned : 0
> System time : 400000
>
>0> create or replace function test(var1 in varchar) return varchar is
>begin insert into testtable values (var1); return 'hello'; end;;
> Rows Returned : 0
> Fields Returned : 0
> System time : 410000
>
>0> select test('hi') from dual; ORA-14551: cannot perform a DML
>operation inside a query
>ORA-06512: at "TESTUSER.TEST", line 1
>
>Attempted Query:
>select test('hi') from dual
>
> Rows Returned : 0
> Fields Returned : 0
> System time : 420000
>
>0>
>
>
>By "works", I mean, I get the error.
>
>You should be able to run the function and get it's result without using
>a select, like this:
>
>from SQLRelay import PySQLRClient
>from SQLRelay import PySQLRDB
>con=PySQLRClient.sqlrconnection('localhost',9000,'','test','test',0,1)
>cur=PySQLRClient.sqlrcursor(con)
>res = cur.prepareQuery('begin :out=PCK_TESTY_STEROWNIKA.PROC_3(:in1, :in2); end;')
>cur.inputBind('in1', 'jkkkak', 10, 0)
>cur.inputBind('in2', 1, 10,2)
>cur.defineOutputBind('out',20)
>res = cur.executeQuery()
>out = cur.getOutputBind('out')
>
>Dave
>
>
|