Thread: getting NULL?
View Single Post
  #1  
Old 02-22-2007, 04:07 AM
dismal dismal is offline
Junior Member
 
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
dismal is on a distinguished road
Default getting NULL?

Hello friends,
I have the following stored procedure:

CREATE FUNCTION get_delivery_payment(parm int)
RETURNS double
BEGIN
DECLARE total_subtotal double;
DECLARE total_shipping double;
DECLARE total_warranty double;
DECLARE total_misc double;
DECLARE total double;
SELECT SUM(invoice_products.sell_price * invoice_products.qty) INTO total_subtotal FROM invoice_products, products, invoices WHERE invoice_products.associated_invoice_id = parm AND invoice_products.associated_invoice_id = invoices.id AND invoice_products.associated_product_id = products.id AND products.is_taxable = 1;
SELECT SUM(invoice_products.sell_price * invoice_products.qty) INTO total_shipping FROM invoice_products, invoices, products WHERE invoice_products.associated_invoice_id = parm AND invoice_products.associated_invoice_id = invoices.id AND invoice_products.associated_product_id = products. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  Webmaster Forums - View Single Post - getting NULL?
Thread: getting NULL?
View Single Post
  #1  
Old 02-22-2007, 04:07 AM
dismal dismal is offline
Junior Member
 
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
dismal is on a distinguished road
Default getting NULL?

Hello friends,
I have the following stored procedure:

CREATE FUNCTION get_delivery_payment(parm int)
RETURNS double
BEGIN
DECLARE total_subtotal double;
DECLARE total_shipping double;
DECLARE total_warranty double;
DECLARE total_misc double;
DECLARE total double;
SELECT SUM(invoice_products.sell_price * invoice_products.qty) INTO total_subtotal FROM invoice_products, products, invoices WHERE invoice_products.associated_invoice_id = parm AND invoice_products.associated_invoice_id = invoices.id AND invoice_products.associated_product_id = products.id AND products.is_taxable = 1;
SELECT SUM(invoice_products.sell_price * invoice_products.qty) INTO total_shipping FROM invoice_products, invoices, products WHERE invoice_products.associated_invoice_id = parm AND invoice_products.associated_invoice_id = invoices.id AND invoice_products.associated_product_id = products. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote