[#1011113] Provide a install or replace functionallity

View Trackers | Feature Requests | Download .csv | Monitor

Date:
2011-11-08 08:40
Priority:
3
State:
Open
Submitted by:
Christian Meier (cikic)
Assigned to:
Johann Oskarsson (myrkraverk)
Category:
PL/Java
Group:
Summary:
Provide a install or replace functionallity

Detailed description
If you have an ant tasks for installing your project, you can not know if this is the first install or a replace. So I have added a install_or_replace function which I would really like to see deployed with this project :)

CREATE OR REPLACE FUNCTION sqlj.install_or_replace_jar(i_jar_url character varying, i_jar_name character varying, i_ddl boolean)
RETURNS integer AS
$BODY$
declare
jar_id int;
begin
select jarid into jar_id from sqlj.jar_repository where jarname = i_jar_name;

if jar_id is null then
raise notice 'New installation %', jar_id;
perform sqlj.install_jar(i_jar_url, i_jar_name, i_ddl);
else
raise notice 'Update exisisting installation id %', jar_id ;
perform sqlj.replace_jar(i_jar_url, i_jar_name, i_ddl);
end if;

select jarid into jar_id from sqlj.jar_repository where jarname = i_jar_name;
return jar_id;
end;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;


Thanks
Chris

Followup

Message
Date: 2011-11-09 16:50
Sender: Johann Oskarsson

Thank you.

The SQLJ schema is part of the SQL/JRT standard and it stipulates the two install and update functions.

This functionality should definitely be part of the project though maybe not exactly like this.

I'm leaving the ticket open as a reminder to do something about it.

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge