MySQL Forums
Forum List  »  Italian

Aiuto urgente !!! Errore su SET ... e dintorni
Posted by: Giovanni Chiozza
Date: November 28, 2012 04:38AM

Ciao a tutti,
sto cercando di inserire nuovi record e aggiornare eventuali presenti con questo codice.
Non sono super esperto ma volevo aggiungere un comando che impostasse la data di inserimento insert_date a CURRDATE() o qualcosa di simile. Idem per update_date.
Ho provato in vari modi ma non ho preparazione sufficiente a capire il perchè non funzia.
L'errore di sintassi o di concetto... è sempre su SET . Io vorrei che la query scrivesse su tutti i record date and time ma non sono capace. Ecco il codice

INSERT INTO members(officeID , section_ID , registration_typeID , new_renewal , memberName , contactLastName , userName , titleID , borndate , bornplace , borncountry , sexID , citizenshipID , phone , fax , mobile01 , mobile02 , addressLine1 , addressLine2 , e_mail , fbname , twname , skype , image , city , state , postalCode , country , vatcode , residence , fiscalcode , national_federationID , medical_date , subscr_date , year_card , year_card_actual , member_card , license_card_01 , license_card_02 , license_card_03 , license_card_04 , license_card_05 , affiliated01 , affiliated02 , affiliated03 , affiliated04 , affiliated05 , category_01 , category_02 , shirt_name , shirt_number , shirt_size , pants_size , helmet_size , boots_size , gloves_size, insert_date )
SET
update_date = CURDATE()

SELECT officeID , section_ID , registration_typeID , new_renewal , memberName , contactLastName , userName , titleID , borndate , bornplace , borncountry , sexID , citizenshipID , phone , fax , mobile01 , mobile02 , addressLine1 , addressLine2 , e_mail , fbname , twname , skype , image , city , state , postalCode , country , vatcode , residence , fiscalcode , national_federationID , medical_date , subscr_date , year_card , year_card_actual , member_card , license_card_01 , license_card_02 , license_card_03 , license_card_04 , license_card_05 , affiliated01 , affiliated02 , affiliated03 , affiliated04 , affiliated05 , category_01 , category_02 , shirt_name , shirt_number , shirt_size , pants_size , helmet_size , boots_size , gloves_size
FROM members_fim_csv


ON DUPLICATE KEY
UPDATE new_renewal, borndate, sexID, citizenshipID, phone, fax, mobile01, addressLine1, e_mail, city, residence, national_federationID, subscr_date, update_date
SET
insert_date = CURDATE()


Grazie
Giovannino



Edited 1 time(s). Last edit at 11/28/2012 04:44AM by Giovanni Chiozza.

Options: ReplyQuote


Subject
Views
Written By
Posted
Aiuto urgente !!! Errore su SET ... e dintorni
1945
November 28, 2012 04:38AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.