sifuhall 0 Posted July 29, 2014 Report Share Posted July 29, 2014 I'm inserting a record into a database. The record has 2 date fields and they get inserted correctly, however I get this error message after the insert. Any ideas? Quote Link to post Share on other sites
Bot-Factory 602 Posted July 29, 2014 Report Share Posted July 29, 2014 Is that with the native ubot SQL plugin? If yes, I would open a support ticket with the ubot guys. Dan Quote Link to post Share on other sites
sifuhall 0 Posted July 29, 2014 Author Report Share Posted July 29, 2014 Thanks, Dan Quote Link to post Share on other sites
arunner26 51 Posted July 31, 2014 Report Share Posted July 31, 2014 This is how I do it for the current date/time. MySQL table: CREATE TABLE MailingInProcess ( ID int AUTO_INCREMENT NOT NULL, MailingName varchar(50) NOT NULL COMMENT 'Mailing Name', MailAccountUsername varchar(100) NOT NULL COMMENT 'Mail Account Username', MailAccountPassword varchar(50) NOT NULL COMMENT 'Mail Account Password', MailConnectionType varchar(50) NOT NULL COMMENT 'Mail Connection Type', MailServer varchar(100) NOT NULL COMMENT 'Mail Server', MailServerPort int NOT NULL COMMENT 'Mail Server Port', Email varchar(150) COMMENT 'Email', Source varchar(50) NOT NULL COMMENT 'Source', Industry varchar(50) NOT NULL COMMENT 'Industry', State varchar(50) NOT NULL COMMENT 'State', SentFrom varchar(100) DEFAULT ' ' COMMENT 'Sent From', SubjectText varchar(100) DEFAULT ' ' COMMENT 'Subject Text', BodyText varchar(1700) DEFAULT ' ' COMMENT 'Body Text', CreatedDate timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP 'Created Date', DateMailed timestamp 'Date Mailed', /* Keys */ PRIMARY KEY (ID)) ENGINE = InnoDB; UBOT Studio UPDATE: define UpdateMailer { set(#IDtoUpdate, $table cell(&OneMailer, 0, 0), "Global") set(#MailerUpdateQuery, "UPDATE MailingInProcess SET DateMailed = Current_Timestamp WHERE ID = {#IDtoUpdate};", "Global") plugin command("DatabaseCommands.dll", "connect to database", #ConnectionString) { plugin command("DatabaseCommands.dll", "query", #MailerUpdateQuery) }} Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.