Public paste
Undefined
By: Guest | Date: Jun 22 2010 20:25 | Format: None | Expires: never | Size: 1.59 KB | Hits: 913

  1. learn("CREATE TABLE IF NOT EXISTS " +
  2.                     "People(" +
  3.                     "PID INTEGER PRIMARY KEY AUTOINCREMENT,"+
  4.                     "nick VARCHAR(16)"+
  5.                      //TEXT as ISO8601 strings ("YYYY-MM-DD HH:MM").
  6.                     "lastspoken CHARACTER(16),"+
  7.                     //The mode the bot was in last time speaking
  8.                     "lastmood varchar(10),"+
  9.                     "timesSpoken INTEGER NOT NULL);");
  10.  
  11.             //Answer questions
  12.             learn("CREATE TABLE IF NOT EXISTS " +
  13.                     "Questions(" +
  14.                     "QID INTEGER PRIMARY KEY AUTOINCREMENT,"+
  15.                      //TEXT as ISO8601 strings ("YYYY-MM-DD HH:MM").
  16.                     "why varchar(255),"+
  17.                     "what varchar(255),"+
  18.                     "how varchar(255),"+
  19.                     "are varchar(255),"+
  20.                     "who varchar(255),"+
  21.                     "where varchar(255),"+
  22.                     "subject varchar(255),"+
  23.                     "answer varchar(255));");
  24. //ERROR: Failed to execute: 'CREATE TABLE IF NOT EXISTS People(PID INTEGER PRIMARY KEY AUTOINCREMENT,nick VARCHAR(16)lastspoken CHARACTER(16),lastmood varchar(10),timesSpoken INTEGER NOT NULL);'
  25. ERROR: java.sql.SQLException: near "lastspoken": syntax error
  26. ERROR: Failed to execute: 'CREATE TABLE IF NOT EXISTS Questions(QID INTEGER PRIMARY KEY AUTOINCREMENT,why varchar(255),what varchar(255),how varchar(255),are varchar(255),who varchar(255),where varchar(255),subject varchar(255),answer varchar(255));'
  27. ERROR: java.sql.SQLException: near "where": syntax error