سؤال

I am creating a table in BB 10 cascades like

  const QString query("CREATE TABLE IF NOT EXISTS push (seqnum INTEGER PRIMARY KEY AUTOINCREMENT, pushdate TEXT, type TEXT, pushtime TEXT,alertId TEXT, extension TEXT, content BLOB, unread INTEGER);");

now how can i check if table created/existed already? Is there any query for that?

help me, Thanks

هل كانت مفيدة؟

المحلول

Try SELECT count(*) FROM sqlite_master WHERE type='table' AND name='table_name';

This will return 0, if the table doesn't exist, 1 if it does.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top