this is necessary to support the change in PostgreSQL from use Integer in _ID to use Numeric(10,0) AS Oracle

This commit is contained in:
vpj-cd 2007-01-24 00:41:08 +00:00
parent c75006fd69
commit d9a841cff3
3 changed files with 113 additions and 18 deletions

View File

@ -0,0 +1,79 @@
/************* bomPriceLimit Alias *******************/
CREATE OR REPLACE FUNCTION bomPriceLimit (M_Product_ID NUMERIC, M_PriceList_Version_ID INTEGER)
RETURNS NUMERIC AS $$
BEGIN
RETURN bomPriceLimit(ID(M_Product_ID),M_PriceList_Version_ID);
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION bomPriceLimit (M_Product_ID NUMERIC, M_PriceList_Version_ID NUMERIC)
RETURNS NUMERIC AS $$
BEGIN
RETURN bomPriceLimit(ID(M_Product_ID),ID(M_PriceList_Version_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
/************* bomPriceList *******************/
CREATE OR REPLACE FUNCTION bomPriceList (M_Product_ID NUMERIC, M_PriceList_Version_ID INTEGER)
RETURNS NUMERIC AS $$
BEGIN
RETURN bomPriceList(ID(M_Product_ID),M_PriceList_Version_ID);
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION bomPriceList (M_Product_ID NUMERIC, M_PriceList_Version_ID NUMERIC)
RETURNS NUMERIC AS $$
BEGIN
RETURN bomPriceList(ID(M_Product_ID),ID(M_PriceList_Version_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
/************* bomPriceStd *******************/
CREATE OR REPLACE FUNCTION bomPriceStd (M_Product_ID NUMERIC, M_PriceList_Version_ID INTEGER)
RETURNS NUMERIC AS $$
BEGIN
RETURN bomPriceStd(ID(M_Product_ID),M_PriceList_Version_ID);
END;
$$ LANGUAGE plpgsql VOLATILE;
CREATE OR REPLACE FUNCTION bomPriceStd (M_Product_ID NUMERIC, M_PriceList_Version_ID NUMERIC)
RETURNS NUMERIC AS $$
BEGIN
RETURN bomPriceStd(ID(M_Product_ID),ID(M_PriceList_Version_ID));
END;
$$ LANGUAGE plpgsql VOLATILE;
/************* bomQtyAvailable *******************/
CREATE OR REPLACE FUNCTION bomQtyAvailable (M_Product_ID NUMERIC, M_Warehouse_ID INTEGER, M_Locator_ID INTEGER)
RETURNS NUMERIC AS $$
BEGIN
RETURN bomQtyAvailable(ID(M_Product_ID),M_Warehouse_ID,M_Locator_ID);
END;
$$ LANGUAGE plpgsql VOLATILE;
/************* bomQtyOnHand *******************/
CREATE OR REPLACE FUNCTION bomQtyOnHand (M_Product_ID NUMERIC, M_Warehouse_ID INTEGER, M_Locator_ID INTEGER)
RETURNS NUMERIC AS $$
BEGIN
RETURN bomQtyOnHand(ID(M_Product_ID),M_Warehouse_ID,M_Locator_ID);
END;
$$ LANGUAGE plpgsql VOLATILE;
/************* bomQtyOrdered *******************/
CREATE OR REPLACE FUNCTION bomQtyOrdered (M_Product_ID NUMERIC, M_Warehouse_ID INTEGER, M_Locator_ID INTEGER)
RETURNS NUMERIC AS $$
BEGIN
RETURN bomQtyOrdered(ID(M_Product_ID),M_Warehouse_ID,M_Locator_ID);
END;
$$ LANGUAGE plpgsql VOLATILE;
/************* bomQtyReserved *******************/
CREATE OR REPLACE FUNCTION bomQtyReserved (M_Product_ID NUMERIC, M_Warehouse_ID INTEGER, M_Locator_ID INTEGER)
RETURNS NUMERIC AS $$
BEGIN
RETURN bomQtyReserved(ID(M_Product_ID),M_Warehouse_ID,M_Locator_ID);
END;
$$ LANGUAGE plpgsql VOLATILE;

View File

@ -75,6 +75,9 @@
</antcall> </antcall>
<antcall target="load"> <antcall target="load">
<param name="file.name" value="${basedir}/init.sql" /> <param name="file.name" value="${basedir}/init.sql" />
</antcall>
<antcall target="load">
<param name="file.name" value="${basedir}/aliasfunction.sql" />
</antcall> </antcall>
</target> </target>

View File

@ -31,82 +31,95 @@ SQLActions[ ] = {
CREATE OR REPLACE FUNCTION daysBetween(datetime1 TIMESTAMP WITH TIME ZONE , datetime2 TIMESTAMP WITH TIME ZONE) CREATE OR REPLACE FUNCTION daysBetween(datetime1 TIMESTAMP WITH TIME ZONE , datetime2 TIMESTAMP WITH TIME ZONE)
RETURNS INTEGER RETURNS INTEGER
AS 'org.compiere.sqlj.Adempiere.getDaysBetween(java.sql.Timestamp,java.sql.Timestamp)' AS 'org.compiere.sqlj.Adempiere.getDaysBetween(java.sql.Timestamp,java.sql.Timestamp)'
LANGUAGE java VOLATILE;; LANGUAGE java VOLATILE;
CREATE OR REPLACE FUNCTION addDays(day TIMESTAMP WITH TIME ZONE, days INTEGER) CREATE OR REPLACE FUNCTION addDays(day TIMESTAMP WITH TIME ZONE, days INTEGER)
RETURNS TIMESTAMP WITH TIME ZONE RETURNS TIMESTAMP WITH TIME ZONE
AS 'org.compiere.sqlj.Adempiere.addDays(java.sql.Timestamp,int)' AS 'org.compiere.sqlj.Adempiere.addDays(java.sql.Timestamp,int)'
LANGUAGE java VOLATILE;; LANGUAGE java VOLATILE;
CREATE OR REPLACE FUNCTION charAt(source VARCHAR, pos INTEGER) CREATE OR REPLACE FUNCTION charAt(source VARCHAR, pos INTEGER)
RETURNS VARCHAR RETURNS VARCHAR
AS 'org.compiere.sqlj.Adempiere.charAt (java.lang.String,int)' AS 'org.compiere.sqlj.Adempiere.charAt (java.lang.String,int)'
LANGUAGE java VOLATILE;; LANGUAGE java VOLATILE;
CREATE OR REPLACE FUNCTION nextID(AD_Sequence_ID INTEGER, System VARCHAR) CREATE OR REPLACE FUNCTION nextID(AD_Sequence_ID INTEGER, System VARCHAR)
RETURNS INTEGER RETURNS INTEGER
AS 'org.compiere.sqlj.Adempiere.nextID(int,java.lang.String)' AS 'org.compiere.sqlj.Adempiere.nextID(int,java.lang.String)'
LANGUAGE java VOLATILE;; LANGUAGE java VOLATILE;
/** Product **/ /** Product **/
CREATE OR REPLACE FUNCTION productAttribute (M_AttributeSetInstance_ID NUMERIC) CREATE OR REPLACE FUNCTION productAttribute (M_AttributeSetInstance_ID NUMERIC)
RETURNS VARCHAR RETURNS VARCHAR
AS 'org.compiere.sqlj.Product.attributeName(int)' AS 'org.compiere.sqlj.Product.attributeName(int)'
LANGUAGE java VOLATILE;; LANGUAGE java VOLATILE;
CREATE OR REPLACE FUNCTION bomPriceLimit (M_Product_ID NUMERIC, M_PriceList_Version_ID NUMERIC) /************* bomPriceLimit *******************/
CREATE OR REPLACE FUNCTION bomPriceLimit (M_Product_ID INTEGER, M_PriceList_Version_ID INTEGER)
RETURNS NUMERIC RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomPriceLimit(int,int)' AS 'org.compiere.sqlj.Product.bomPriceLimit(int,int)'
LANGUAGE java VOLATILE;; LANGUAGE java VOLATILE;
CREATE OR REPLACE FUNCTION bomPriceList (M_Product_ID NUMERIC, M_PriceList_Version_ID NUMERIC) /************* bomPriceList *******************/
CREATE OR REPLACE FUNCTION bomPriceList (M_Product_ID INTEGER, M_PriceList_Version_ID INTEGER)
RETURNS NUMERIC RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomPriceList(int,int)' AS 'org.compiere.sqlj.Product.bomPriceList(int,int)'
LANGUAGE java VOLATILE;; LANGUAGE java VOLATILE;
CREATE OR REPLACE FUNCTION bomPriceStd (M_Product_ID NUMERIC, M_PriceList_Version_ID NUMERIC) /************* bomPriceStd *******************/
CREATE OR REPLACE FUNCTION bomPriceStd (M_Product_ID INTEGER, M_PriceList_Version_ID INTEGER)
RETURNS NUMERIC RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomPriceStd(int,int)' AS 'org.compiere.sqlj.Product.bomPriceStd(int,int)'
LANGUAGE java VOLATILE; LANGUAGE java VOLATILE;
CREATE OR REPLACE FUNCTION bomQtyAvailable (M_Product_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC) /************* bomQtyAvailable *******************/
CREATE OR REPLACE FUNCTION bomQtyAvailable (M_Product_ID INTEGER, M_Warehouse_ID INTEGER, M_Locator_ID INTEGER)
RETURNS NUMERIC RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomQtyAvailable(int,int,int)' AS 'org.compiere.sqlj.Product.bomQtyAvailable(int,int,int)'
LANGUAGE java VOLATILE; LANGUAGE java VOLATILE;
/************* bomQtyAvailable with M_AttributeSetInstance_ID *******************/
CREATE OR REPLACE FUNCTION bomQtyAvailable (M_Product_ID NUMERIC , M_AttributeSetInstance_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC) CREATE OR REPLACE FUNCTION bomQtyAvailable (M_Product_ID NUMERIC , M_AttributeSetInstance_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomQtyAvailable(int,int,int,int)' AS 'org.compiere.sqlj.Product.bomQtyAvailable(int,int,int,int)'
LANGUAGE java VOLATILE; LANGUAGE java VOLATILE;
CREATE OR REPLACE FUNCTION bomQtyOnHand (M_Product_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC) /************* bomQtyOnHand *******************/
CREATE OR REPLACE FUNCTION bomQtyOnHand (M_Product_ID INTEGER, M_Warehouse_ID INTEGER, M_Locator_ID INTEGER)
RETURNS NUMERIC RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomQtyOnHand(int,int,int)' AS 'org.compiere.sqlj.Product.bomQtyOnHand(int,int,int)'
LANGUAGE java VOLATILE; LANGUAGE java VOLATILE;
/************* bomQtyOnHand with M_AttributeSetInstance_ID *******************/
CREATE OR REPLACE FUNCTION bomQtyOnHand (M_Product_ID NUMERIC, M_AttributeSetInstance_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC) CREATE OR REPLACE FUNCTION bomQtyOnHand (M_Product_ID NUMERIC, M_AttributeSetInstance_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomQtyOnHand(int,int,int,int)' AS 'org.compiere.sqlj.Product.bomQtyOnHand(int,int,int,int)'
LANGUAGE java VOLATILE; LANGUAGE java VOLATILE;
CREATE OR REPLACE FUNCTION bomQtyOrdered (M_Product_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC) /************* bomQtyOrdered *******************/
CREATE OR REPLACE FUNCTION bomQtyOrdered (M_Product_ID INTEGER, M_Warehouse_ID INTEGER, M_Locator_ID INTEGER)
RETURNS NUMERIC RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomQtyOrdered(int,int,int)' AS 'org.compiere.sqlj.Product.bomQtyOrdered(int,int,int)'
LANGUAGE java VOLATILE; LANGUAGE java VOLATILE;
/************* bomQtyOrdered with M_AttributeSetInstance_ID *******************/
CREATE OR REPLACE FUNCTION bomQtyOrdered (M_Product_ID NUMERIC, M_AttributeSetInstance_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC) CREATE OR REPLACE FUNCTION bomQtyOrdered (M_Product_ID NUMERIC, M_AttributeSetInstance_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomQtyOrdered(int,int,int,int)' AS 'org.compiere.sqlj.Product.bomQtyOrdered(int,int,int,int)'
LANGUAGE java VOLATILE; LANGUAGE java VOLATILE;
/************* bomQtyReserved *******************/
CREATE OR REPLACE FUNCTION bomQtyReserved (M_Product_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC) CREATE OR REPLACE FUNCTION bomQtyReserved (M_Product_ID INTEGER, M_Warehouse_ID INTEGER, M_Locator_ID INTEGER)
RETURNS NUMERIC RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomQtyReserved(int,int,int)' AS 'org.compiere.sqlj.Product.bomQtyReserved(int,int,int)'
LANGUAGE java VOLATILE; LANGUAGE java VOLATILE;
/************* bomQtyOrdered with M_AttributeSetInstance_ID *******************/
CREATE OR REPLACE FUNCTION bomQtyReserved (M_Product_ID NUMERIC, M_AttributeSetInstance_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC) CREATE OR REPLACE FUNCTION bomQtyReserved (M_Product_ID NUMERIC, M_AttributeSetInstance_ID NUMERIC, M_Warehouse_ID NUMERIC, M_Locator_ID NUMERIC)
RETURNS NUMERIC RETURNS NUMERIC
AS 'org.compiere.sqlj.Product.bomQtyReserved(int,int,int,int)' AS 'org.compiere.sqlj.Product.bomQtyReserved(int,int,int,int)'