Jump to content

modifer produit onglet caractérisqtiques


Jluis

Recommended Posts

salut ,  

je voudrais modifier  les caractéristiques des plusieurs produits  Prix HT  , Prix Promotionnel HT ,  Prix TTC ..     à partir  d'un fichier  csv externe .

 

update psdms_feature_value_lang t1

				    LEFT JOIN
							psdms_feature_product t2
					ON      t1.id_feature_value = t2.id_feature_value
				    SET value ='95090€'
					WHERE   t2.id_product = 1 AND  t2.id_feature = 510

le code sql précedent met à jour un produit admettant au préalable un id_feature 510 :  correspondanat au  " TARIF TTC HORS PROMO" .

comment procéder si le produit n'admet pas id_feature  ? l'onglet les valeurs de l'ongle caractéristique sont vides 

Link to comment
Share on other sites

des propositions concernant ce code svp 


CREATE PROCEDURE processorders()
BEGIN
   
   DECLARE ordernumbers CURSOR
   FOR
   SELECT * FROM psdms_feature_product ;
   
    dept_rec  ordernumbers%ROWTYPE;
   
   o ordernumbers%ROWTYPE;
   
   OPEN ordernumbers;

   REPEAT
     
    FETCH ordernumbers INTO o;
   
    IF (o.id_product ) THEN
      IF (o.id_feature  == 510) THEN
   
					update psdms_feature_value_lang t1

				    LEFT JOIN
							psdms_feature_product t2
					ON      t1.id_feature_value = t2.id_feature_value
				    SET value ='95090€'
					WHERE   t2.id_product = 1 AND  t2.id_feature = 510

    ELSE

    
insert into  psdms_feature_value ( id_feature ) values (510);
insert into  psdms_feature_product ( id_feature, id_product , id_feature_value) values (o.id_feature , o.id_product , o.id_feature_value )

END IF;
    
END IF;
   
 UNTIL done END REPEAT;
 
   CLOSE ordernumbers;
  END;
END;

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...