stored procedure

Joejoe79sa

Member
Joined
Mar 24, 2007
Messages
7
Programming Experience
Beginner
Hi guys, this is a stored procedure i created that has to eccept values from my client app and then update the tblcustomers table. the customer table has 3 coloms named CustomerID,CustomerName and CustomerType.

CREATE PROCEDURE SP_UPDATECUSTOMER(
CUSTOMER_ID VARCHAR(30),
CUSTOMER_NAME VARCHAR(30),
CUSTOMER_TYPE VARCHAR(30))
AS
BEGIN
/*set default values*/

if (CUSTOMER_ID is null) then CUSTOMER_ID = 'N/A';
if (CUSTOMER_NAME is null) then CUSTOMER_NAME = 'N/A';
if (CUSTOMER_TYPE is null) then CUSTOMER_TYPE ='N/A';

/*COMMIT NEW VALUES*/

insert into TBLCUSTOMER(
CUSTOMERID,CUSTOMERNAME,CUSTOMERTYPE
)VALUES(
CUSTOMER_ID,CUSTOMER_NAME,CUSTOMER_TYPE
);

END
;


Any idea why im getting this error:
Dynamic SQL Error.
SQL error code = -206.
Column unknown.
CUSTOMER_ID.


Thanks again!!
 
Heh.. you want an ID field that can be null? Not a good idea..

You dont say what DB you have, and you didnt post it in a relevant database forum. Might I suggest you PM a mod (JohnH is active today) and ask him to move it to the relevant database forum
 
Back
Top