View source | Discuss this page | Page history | Printable version   
Toolbox
Main Page
Upload file
What links here
Recent changes
Help

PDF Books
Show collection (0 pages)
Collections help

Search

ERP 2.50:Acceptance Testing/Attribute set script postgreSQL

Script for 2.40/2.3x

 
 CREATE OR REPLACE FUNCTION create_attributeSet()
  RETURNS void AS
 $BODY$ DECLARE
 
 v_attributeset_id NUMERIC(10);
 v_client_id NUMERIC(10);
 
 BEGIN
 
 SELECT MAX(AD_CLIENT_ID) INTO v_client_id FROM AD_CLIENT;
 
 SELECT COALESCE(MAX(M_ATTRIBUTESET_ID),999999)+1 INTO v_attributeset_id FROM   M_ATTRIBUTESET;
 
 INSERT INTO M_ATTRIBUTESET (M_ATTRIBUTESET_ID, AD_CLIENT_ID, AD_ORG_ID,  ISACTIVE, CREATED,CREATEDBY, UPDATED, UPDATEDBY, NAME, ISLOT, ISGUARANTEEDATE,  ISSERNO)
 VALUES(v_attributeset_id, v_client_id, 0, 'Y', now(),  100,now(),100,'Lots','Y','Y','N');                            
 
 PERFORM AD_UPDATE_SEQUENCE();
 
 END ; $BODY$
 LANGUAGE 'plpgsql' VOLATILE;
 
 SELECT create_attributeSet();
 
 DROP FUNCTION create_attributeSet();

Script for 2.50

 
 CREATE OR REPLACE FUNCTION create_attributeSet()
   RETURNS void AS
 $BODY$ DECLARE
 
 v_attributeset_id varchar(32);
 v_client_id varchar(32);
 
 BEGIN
 
 SELECT AD_CLIENT_ID INTO v_client_id FROM AD_CLIENT WHERE created=(SELECT max(created) FROM ad_client);
 
 SELECT get_uuid() INTO v_attributeset_id;
 
 INSERT INTO M_ATTRIBUTESET (M_ATTRIBUTESET_ID, AD_CLIENT_ID, AD_ORG_ID,  ISACTIVE, CREATED,CREATEDBY, UPDATED, UPDATEDBY, NAME, ISLOT, ISGUARANTEEDATE,  ISSERNO)
 VALUES(v_attributeset_id, v_client_id, 0, 'Y', now(),  100,now(),100,'Lots','Y','Y','N');                            
 
 END ; $BODY$
 LANGUAGE 'plpgsql' VOLATILE;
 
 SELECT create_attributeSet();
 
 DROP FUNCTION create_attributeSet();

Retrieved from "http://wiki.openbravo.com/wiki/ERP_2.50:Acceptance_Testing/Attribute_set_script_postgreSQL"

This page has been accessed 3,854 times. This page was last modified on 3 April 2012, at 10:59. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.