create or replace PROCEDURE  SP_TBLREGISTEREDUSER_UPDATE
(
  P_GENDER                              VARCHAR2,
  P_FIRSTNAME                           VARCHAR2,
  P_MIDDLENAME                          VARCHAR2,
  P_SURNAME                             VARCHAR2,
  P_EMAIL                                       VARCHAR2,
  P_PHONENO                             VARCHAR2,
  P_FAXNO                                       VARCHAR2,
  P_LOGIN                                       VARCHAR2,
  P_PASSWORD                            VARCHAR2,
  P_PASSWORDREMINDER              VARCHAR2,
  P_PROFESSIONALINFORMATION   VARCHAR2,
  P_COMPANY_NAME                        VARCHAR2,
  P_PRIMARYACTIVITY                     VARCHAR2,
  P_ACTIVITY1                           VARCHAR2,
  P_ACTIVITY2                           VARCHAR2,
  P_ACTIVITY3                           VARCHAR2,
  P_ACTIVITY4                           VARCHAR2,
  P_ACTIVITY5                           VARCHAR2,
  P_REGADDRESS                          VARCHAR2,
  P_REGCITY                             VARCHAR2,
  P_REGPINCODE                          VARCHAR2,
  P_REGSTATE                            VARCHAR2,
  P_REGCOUNTRY                          VARCHAR2,
  P_REGPHONENO                          VARCHAR2,
  P_REGFAXNO                            VARCHAR2,
  P_FACTADDRESS                         VARCHAR2,
  P_FACTCITY                            VARCHAR2,
  P_FACTPIN                             VARCHAR2,
  P_FACTSTATE                           VARCHAR2,
  P_FACTCOUNTRY                         VARCHAR2,
  P_FACTPHONE                           VARCHAR2,
  P_FACTFAX                             VARCHAR2,
  P_URL                                         VARCHAR2,
  P_PRODUCTBROUGHTBYURCO     VARCHAR2,
  P_PRODUCTSOLDBYURCO            VARCHAR2,
  P_YOURPOSITION                        VARCHAR2,
  P_YOURFUNCTION                        VARCHAR2,
  P_FREEMAILID                          VARCHAR2,
  P_FREENEWSLETTER                      VARCHAR2,
  P_ERRORDESC      OUT                  VARCHAR2
)
AS
  NOT_A_VALID_USER EXCEPTION;
BEGIN
  --CREATED ON 6:57 PM 8/29/99
  /**** SHAILENDRA HAS CONVERT INTO LOWER ***/
  UPDATE TBLREGISTEREDUSER SET
  GENDER =   P_GENDER,
  FIRSTNAME =   P_FIRSTNAME,
  MIDDLENAME =   P_MIDDLENAME ,
  SURNAME =   P_SURNAME ,
  EMAIL =   P_EMAIL ,
  PHONENO =   P_PHONENO,
  FAXNO =   P_FAXNO ,
  PASSWORD =   P_PASSWORD ,
  PASSWORDREMINDER =   P_PASSWORDREMINDER,
  PROFESSIONALINFORMATION =   P_PROFESSIONALINFORMATION ,
  COMPANY_NAME =   P_COMPANY_NAME,
  PRIMARYACTIVITY =   P_PRIMARYACTIVITY,
  ACTIVITY1 =   P_ACTIVITY1,
  ACTIVITY2 =   P_ACTIVITY2,
  ACTIVITY3 =   P_ACTIVITY3 ,
  ACTIVITY4 =   P_ACTIVITY4 ,
  ACTIVITY5 =   P_ACTIVITY5 ,
  REGADDRESS =   P_REGADDRESS,
  REGCITY =   P_REGCITY,
  REGPINCODE =   P_REGPINCODE,
  REGCOUNTRY =   P_REGCOUNTRY ,
  REGPHONENO =   P_REGPHONENO ,
  REGFAXNO =   P_REGFAXNO ,
  FACTADDRESS =   P_FACTADDRESS,
  FACTCITY =   P_FACTCITY,
  FACTPIN =   P_FACTPIN ,
  FACTCOUNTRY =   P_FACTCOUNTRY,
  FACTPHONE  =   P_FACTPHONE,
  FACTFAX =   P_FACTFAX ,
  URL =   P_URL,
  PRODUCTBROUGHTBYURCO =   P_PRODUCTBROUGHTBYURCO,
  PRODUCTSOLDBYURCO =   P_PRODUCTSOLDBYURCO,
  YOURPOSITION =   P_YOURPOSITION ,
  YOURFUNCTION =   P_YOURFUNCTION  ,
  FREEEMAILID =   P_FREEMAILID ,
  FREENEWSLETTER =   P_FREENEWSLETTER,
  FKLOGIN_LASTUPDATEDBY =   P_LOGIN,
  LASTUPDATED_ON = SYSDATE,
  REGSTATE =   P_REGSTATE ,
  FACTSTATE =   P_FACTSTATE
  WHERE UPPER(LTRIM(RTRIM(LOGIN))) =  UPPER(LTRIM(RTRIM(P_LOGIN))) ;
  IF SQL%NOTFOUND THEN
    RAISE NOT_A_VALID_USER;
  END IF;
  COMMIT;
  P_ERRORDESC:='SUCCESS';
EXCEPTION
  WHEN NOT_A_VALID_USER THEN
  P_ERRORDESC:='  NOT_A_VALID_USER ';
  DBMS_OUTPUT.PUT_LINE(P_ERRORDESC);
  WHEN OTHERS THEN
  P_ERRORDESC:='OPERATION FAILED '||SUBSTR(SQLERRM,1,100);
  DBMS_OUTPUT.PUT_LINE(P_ERRORDESC);
END SP_TBLREGISTEREDUSER_UPDATE;
/
