Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call store procedure from oracle with output sys_refcursor #341

Open
RiPav opened this issue Jun 26, 2019 · 0 comments
Open

call store procedure from oracle with output sys_refcursor #341

RiPav opened this issue Jun 26, 2019 · 0 comments

Comments

@RiPav
Copy link

RiPav commented Jun 26, 2019

Hello,
I created some procedure in oracle database aum which return sys_refcursor.
create or replace procedure aum
IS
v_code NUMBER;
v_errm VARCHAR2(200);
rc sys_refcursor;
BEGIN
open rc for select username from dba_users;
dbms_sql.return_result(rc);
EXCEPTION
WHEN OTHERS THEN
v_code := SQLCODE;
v_errm := SUBSTR(SQLERRM, 1, 200);
DBMS_OUTPUT.PUT_LINE (v_code || ' ' || v_errm);
END;
/

My configuration in logstash is
input {
jdbc {
jdbc_validate_connection => true
jdbc_driver_library => "/etc/logstash/ojdbc8.jar"
jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
jdbc_connection_string => "jdbc:oracle:thin:@//xxxxxcom:1521/xxx"
jdbc_user => "system"
jdbc_password => "xxxxx"
statement => "{call system.aum}"
schedule => "*/3 * * * *"
}
}
output {
file {
path => "/tmp/my_out_file3.txt"
codec => "rubydebug"
}
}

Is't possible to see result set from DB send to file ?
I see from log logstash, that call was, but file is empty.
Thanks for any advice or comment
Richard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant