You can translate the question and the replies:

Denodo stored procedure with input parameters to execute vcs(dvcscommit) command:

When i execute below stored procedure: (view_path IN VARCHAR, commit_message IN VARCHAR) AS ( param1 VARCHAR; param2 VARCHAR; ) BEGIN EXECUTE 'connect database poc'; EXECUTE 'dvcscommit ''@param1'' LOGMESSAGE ''@param2''' PARAMETERS ( param1, param2 ) VALUES ( view_path, commit_message ); END; It thorws an error: QUERY [SELECTION] [ERROR] VCS_COMMIT [STORED_PROCEDURE] [ERROR] VCS_COMMIT [STORED PROCEDURE] [ERROR] Received exception with message 'error checking @param1 in: Syntax error: Exception parsing query near 'VQLnull'' When i modify the same procedure to execute DVCSCOMMIT with one fixed and one value from the parameter, it works fine: (commit_message IN VARCHAR) AS ( param1 VARCHAR; param2 VARCHAR; ) BEGIN EXECUTE 'connect database poc'; EXECUTE 'dvcscommit ''/databases/poc/folder.git/views/iv_final_view_to_commit'' LOGMESSAGE ''@param2''' PARAMETERS ( param1, param2 ) VALUES ( view_path, commit_message ); END; Has someone tried anythign similar and how were you able to fix it. Thanks

1 Answer

Thank you for the respone. With this i was able to come up with a working version of my stored procedure. Putting it here if it hels someone who is trying to achieve the same. CREATE OR REPLACE VQL PROCEDURE vcs_commit FOLDER = '/git' (db_name IN VARCHAR, view_name IN VARCHAR, commit_message IN VARCHAR, length OUT INT, path OUT VARCHAR) AS ( CURSOR split_cursordata IS 'with array_view as (SELECT split('','', '':param1'') AS view_name FROM dual()) select TRIM(string) as input_view from flatten array_view as v(v.view_name)'; split_out split_cursordata%ROWTYPE; CURSOR path_cursordata IS 'select view_path from poc.bv_get_elements where database_name ='':param2'' and name ='':param3'''; path_out path_cursordata%ROWTYPE; p_len INT; p_path VARCHAR; p_current_view VARCHAR; ) BEGIN p_len:=len(view_name); OPEN split_cursordata PARAMETERS ( param1 ) VALUES ( view_name ); LOOP FETCH split_cursordata INTO split_out; p_current_view:=split_out.input_view; OPEN path_cursordata PARAMETERS ( param2, param3 ) VALUES ( db_name, p_current_view ); LOOP FETCH path_cursordata INTO path_out; p_path:=path_out.view_path; RETURN ROW ( length, path) VALUES (p_len, p_path); EXECUTE 'dvcscommit '':param4'' LOGMESSAGE '':param5''' PARAMETERS ( param4, param5 ) VALUES ( p_path, commit_message ); EXIT WHEN path_cursordata%NOTFOUND; END LOOP; CLOSE path_cursordata; EXIT WHEN split_cursordata%NOTFOUND; END LOOP; CLOSE split_cursordata; END; Best Regards, PC
user
31-01-2024 11:07:13 -0500
You must sign in to add an answer. If you do not have an account, you can register here