On 05/10/2012 02:02 PM, bmillemathias....@orange.com wrote:
Hi there,
I’m working to script recurrent operations we do on virtuoso (like data
loading, clearing graph, backup, …) with a mix of virtuoso/PL stored
procedures and shell scripts; it works almost fine but I’m stuck because
I don’t know:
* how to know if a command inside a stored procedure succeed or failed.
If you're using system()[0] then this seems to return 0 on success,
non-zero otherwise.
* how to return status result from the stored procedure back to the shell.
Could you point me some documentation / help ?
To make virtuoso execute my procedures, I do this way:
echo “DB.DBA.sp_clear_graph(‘<_http://foobar.net_>’) | isql-vt –U
$myuser $mygraph”
If your procedure either has a return value or calls result()[1], these
will appear when you select the procedure rather than merely calling it:
Compare:
SQL> create procedure tdh_test() { return 123; };
echo 'tdh_test();' | isql-vt
echo 'select tdh_test();' | isql-vt
Additional tips:
1) "recurrent". Might the Scheduler help at all?
2) "backup". Is the online backups facility any use?
Both are accessible in the Conductor under the SysAdmin tab.
HTH!
[0] http://docs.openlinksw.com/virtuoso/fn_system.html
[1] http://docs.openlinksw.com/virtuoso/fn_result.html
~Tim
--
Tim Haynes
Product Development Consultant
OpenLink Software
<http://www.openlinksw.com/>
<http://twitter.com/openlink>