OpenLink Virtuoso SP + Informix SP = result ???
Posted in 2000
Topics: Stored Procedures & SPL
Hi Informixers. Mainly it's not Informix question sorry fot that. Our company checks possibilities to use Virtuoso product from OpenLink with our Informix and MSSQL databases. The product looks not too bad except one thing that is a documentation. There is a problem. I have to keep part of my stored procedures on Informix side and run the SP from Virtuoso's SP. The documentation has a few words about rexecute, rnext, rmoreresults and no one examples for the functions. The problem is I don't know how to get results from executed procedure. My test procedure in Virtuoso looks like: rexecute ('test', 'execute function Test()', sql_state,error_message,NULL, num_cols, stmt_meta,NULL,cursor_handle); I'm able to see on Informix side that the procedure ('Test') has been executed on Informix instance. while (sql_state<>'SQL_NO_DATA_FOUND') { rnext (cursor_handle, row_array,sql_state,sql_error); ID:=aref(aref(row_array,1),1); ----ID:=get_keyword(1,row_array); But how can I get result from the execution ????? --rmoreresults (cursor_handle,sql_state,sql_error,num_cols, stmt_meta_array); } Any help will be very appreciated. Eugene Sent via Deja.com http://www.deja.com/ Before you buy.
Eugene, This can be done using the Virtuoso resultset handling functions. Have you checked Chapter 12, section 4 in the docs regarding "Handling result sets"? This involves coding the resultset in a loop using RESULT_NAMES() and RESULT(). Hope this helps. Regards, Stephen S Support Consultant, Openlink Software In article <8qo3sp$1rg$1@nnrp1.deja.com>, Eugene Nechayev <4new@my-deja.com> wrote: > Hi Informixers. > > Mainly it's not Informix question sorry fot that. > > Our company checks possibilities to use Virtuoso product from OpenLink > with > our Informix and MSSQL databases. The product looks not too bad except > one thing that is a documentation. There is a problem. > > I have to keep part of my stored procedures on Informix side and run > the SP from > Virtuoso's SP. The documentation has a few words about rexecute, > rnext, rmoreresults > and no one examples for the functions. The problem is I don't know how > to get > results from executed procedure. My test procedure in Virtuoso looks > like: > > rexecute ('test', 'execute function Test()', > sql_state,error_message,NULL, num_cols, stmt_meta,NULL,cursor_handle); > > I'm able to see on Informix side that the procedure ('Test') has been > executed on Informix instance. > > while (sql_state<>'SQL_NO_DATA_FOUND') > { > > rnext (cursor_handle, row_array,sql_state,sql_error); > > ID:=aref(aref(row_array,1),1); > ----ID:=get_keyword(1,row_array); > > But how can I get result from the execution ????? > > --rmoreresults (cursor_handle,sql_state,sql_error,num_cols, > stmt_meta_array); > } > > Any help will be very appreciated. > > Eugene > > Sent via Deja.com http://www.deja.com/ > Before you buy. > Sent via Deja.com http://www.deja.com/ Before you buy.
Stephen, Yes,yes and again yes :) I've checked the chapter first. Anyway the chapter isn't helpful in my case. I have to run Informix stored procedure from Virtuoso stored procedure, but in Virtuoso I'd like to have a normal cursor, not a 'a vector of vectors of the rows' (Virtual database concepts, VDB Stored Procedures & Functions) that is an array of unpredictable size on Virtuoso side in other words . In documentation we have only _one_ hint ;-) '-open a cursor with rexecute. -loop over the results with rnext -if rmoreresults does not return an error or SQL_NO_DATA_FOUND continue the loop with rnext, otherwise -close the cursor with rclose ' but I haven't found how can I make the construction with rexecute,rnext and rmoreresults. Any help will be very appreciated. Eugene Nechayev, Informix DBA, Meridex Networking. In article <8qqmkg$51c$1@nnrp1.deja.com>, schatzy@my-deja.com wrote: > Eugene, > > This can be done using the Virtuoso resultset handling functions. Have > you checked Chapter 12, section 4 in the docs regarding "Handling > result sets"? This involves coding the resultset in a loop using > RESULT_NAMES() and RESULT(). > > Hope this helps. > > Regards, > Stephen S > Support Consultant, Openlink Software > > In article <8qo3sp$1rg$1@nnrp1.deja.com>, > Eugene Nechayev <4new@my-deja.com> wrote: > > Hi Informixers. > > > > Mainly it's not Informix question sorry fot that. > > > > Our company checks possibilities to use Virtuoso product from OpenLink > > with > > our Informix and MSSQL databases. The product looks not too bad > except > > one thing that is a documentation. There is a problem. > > > > I have to keep part of my stored procedures on Informix side and run > > the SP from > > Virtuoso's SP. The documentation has a few words about rexecute, > > rnext, rmoreresults > > and no one examples for the functions. The problem is I don't know > how > > to get > > results from executed procedure. My test procedure in Virtuoso looks > > like: > > > > rexecute ('test', 'execute function Test()', > > sql_state,error_message,NULL, num_cols, stmt_meta,NULL,cursor_handle); > > > > I'm able to see on Informix side that the procedure ('Test') has been > > executed on Informix instance. > > > > while (sql_state<>'SQL_NO_DATA_FOUND') > > { > > > > rnext (cursor_handle, row_array,sql_state,sql_error); > > > > ID:=aref(aref(row_array,1),1); > > ----ID:=get_keyword(1,row_array); > > > > But how can I get result from the execution ????? > > > > --rmoreresults (cursor_handle,sql_state,sql_error,num_cols, > > stmt_meta_array); > > } > > > > Any help will be very appreciated. > > > > Eugene > > > > Sent via Deja.com http://www.deja.com/ > > Before you buy. > > > > Sent via Deja.com http://www.deja.com/ > Before you buy. > Sent via Deja.com http://www.deja.com/ Before you buy.