I'm getting a syntax error: Syntax error near 17:38
insert into tbl_otp('mobile', 'otp', 'exp') values (9932111111, 333333, 2019-04-09 17:38:34)
I'm getting a syntax error: Syntax error near 17:38
insert into tbl_otp('mobile', 'otp', 'exp') values (9932111111, 333333, 2019-04-09 17:38:34)
Single quotes denote string literals, so you shouldn't use them for column names. You should, however, surround the date literal with quotes:
insert into
tbl_otp(mobile, otp, exp) -- no quotes
values (9932111111, 333333, '2019-04-09 17:38:34') -- quotes
insert into tbl_otp(`mobile`, `otp`, `exp`)
values ('9932111111', '333333', '2019-04-09 17:38:34')
Need to backquote your column names and single-quote your values, though the latter is just to be safe.
PARTITION a reserved word, to find that our codebase had a query without backticks around field names where one of the field names was "partition". We had to push a new build to literally everybody, for a two character fix that should never have been necessary in the first place. Wasn't nice!put the date value in quotes and remove quotes from column names:
insert into tbl_otp(mobile, otp, exp) values (9932111111, 333333, '2019-04-09 17:38:34')