在MediumBLOB列中插入图像

时间:2013-04-08 06:12:37

标签: mysql

我正在尝试使用以下查询在mysql数据库中插入记录,但是获取#1064-sql语法错误。

INSERT INTO RESOURCES(ID, NAME, RESTYPE, CONTENT) VALUES('4', 'Printer.TicketTotal', 0, LOAD_FILE('/home/anand/Openbravo-POS/main/src-pos/com/openbravo/pos/templates/Printer.TicketTotal.xml));

INSERT INTO RESOURCES(ID, NAME, RESTYPE, CONTENT) VALUES('4', 'Printer.TicketTotal', 0, $FILE{/home/anand/Openbravo-POS/main/src-pos/com/openbravo/pos/templates/Printer.TicketTotal.xml});

1 个答案:

答案 0 :(得分:1)

您错过了文件名末尾的' -

INSERT INTO RESOURCES(ID, NAME, RESTYPE, CONTENT) VALUES
  ('4',
  'Printer.TicketTotal',
  0, 
  LOAD_FILE('/home/anand/Openbravo-POS/main/src-pos/com/openbravo/pos/templates/Printer.TicketTotal.xml'));