Srivats Chandrasekaran wrote:
> Is there neway i can assign default values to
> input parameters without modifying the code too
> much.
I don't really know what qualitative value "too much" stands for, but you could use COALESCE in your INSERT statement, which will place the default value if there is a NULL received in the input parameter:
INSERT INTO nb_seller_master(
nb_seller_name,
nb_seller_addrress_1,
nb_seller_addrress_2,
nb_seller_city,
nb_seller_state,
nb_seller_zip
)
VALUES(
COALESCE(nb_seller_name_gb, 'No name'),
COALESCE(nb_seller_address_1_gb, 'No Address 1'),
COALESCE(nb_seller_address_2_gb, 'No Address 2'),
COALESCE(nb_seller_city_gb, 'No City'),
COALESCE(nb_seller_state_gb, 'No State'),
COALESCE(nb_seller_zip_gb, 'No Zip')
);
Jay Pipes
Community Relations Manager, North America, MySQL Inc.
Got Cluster?
http://www.mysql.com/cluster
Personal:
http://jpipes.com