Drop table and recreate if exist in sqflite flutter2019 Community Moderator ElectionFlutter Sqflite multiple table modelsFlutter - How to update the table structure in Sqflite?How to do a database insert with SQFlite in FlutterHow to get the number of rows in a database table with Flutter SQFliteHow to do a database update with SQFlite in FlutterHow to do a database query with SQFlite in FlutterHow to create multiple tables in a database in sqflite?Flutter: How to load data in main.dart and sync json to sqfliteHow to get the total of column values in sqflite in flutter?How can I know if row is exist in flutter sqflite?
They call me Inspector Morse
Set and print content of environment variable in cmd.exe subshell?
Latest web browser compatible with Windows 98
Solving "Resistance between two nodes on a grid" problem in Mathematica
Is it possible to have an Abelian group under two different binary operations but the binary operations are not distributive?
Are babies of evil humanoid species inherently evil?
Does "variables should live in the smallest scope as possible" include the case "variables should not exist if possible"?
Can you reject a postdoc offer after the PI has paid a large sum for flights/accommodation for your visit?
Why is Beresheet doing a only a one-way trip?
What Happens when Passenger Refuses to Fly Boeing 737 Max?
Placing subfig vertically
Time travel short story where dinosaur doesn't taste like chicken
Fourth person (in Slavey language)
Things to avoid when using voltage regulators?
Are the terms "stab" and "staccato" synonyms?
Why doesn't this Google Translate ad use the word "Translation" instead of "Translate"?
Regex for certain words causes Spaces
How do I express some one as a black person?
Reverse string, can I make it faster?
How strictly should I take "Candidates must be local"?
Why the color red for the Republican Party
What are some noteworthy "mic-drop" moments in math?
Extra alignment tab has been changed to cr. } using table, tabular and resizebox
PTIJ: Why can't I eat anything?
Drop table and recreate if exist in sqflite flutter
2019 Community Moderator ElectionFlutter Sqflite multiple table modelsFlutter - How to update the table structure in Sqflite?How to do a database insert with SQFlite in FlutterHow to get the number of rows in a database table with Flutter SQFliteHow to do a database update with SQFlite in FlutterHow to do a database query with SQFlite in FlutterHow to create multiple tables in a database in sqflite?Flutter: How to load data in main.dart and sync json to sqfliteHow to get the total of column values in sqflite in flutter?How can I know if row is exist in flutter sqflite?
I want to drop table before populating server data if exist.
the Queries I'm trying
deleteOptionTable() async
final db = await database;
db.rawDelete("Delete * from option");
dropTable() async
final db = await database;
db.query('SELECT * FROM cloudnet360.db WHERE name =option and type=table');
I have tried something like this but nothing is happening.
void _insertOption(OptionsGroupList option) async
int idd = dbHelper.dropTable();
print('DROP TABLE: $idd');
PreferencesConnector myprefs= PreferencesConnector();
String merchantid=await myprefs.readString('merchantid');
String hashkey=await myprefs.readString('hashkey');
Map<String, dynamic> row =
DatabaseHelper.columnGroupId:option.grouprowid ,
DatabaseHelper.columnGroupName: option.groupname,
DatabaseHelper.columnIsRequired:option.isrequired ,
DatabaseHelper.columnMerchantId: merchantid,
DatabaseHelper.columnMerchantHashKey: hashkey,
;
int id = await dbHelper.insertOption(row);
print('inserted option row id: $id');
add a comment |
I want to drop table before populating server data if exist.
the Queries I'm trying
deleteOptionTable() async
final db = await database;
db.rawDelete("Delete * from option");
dropTable() async
final db = await database;
db.query('SELECT * FROM cloudnet360.db WHERE name =option and type=table');
I have tried something like this but nothing is happening.
void _insertOption(OptionsGroupList option) async
int idd = dbHelper.dropTable();
print('DROP TABLE: $idd');
PreferencesConnector myprefs= PreferencesConnector();
String merchantid=await myprefs.readString('merchantid');
String hashkey=await myprefs.readString('hashkey');
Map<String, dynamic> row =
DatabaseHelper.columnGroupId:option.grouprowid ,
DatabaseHelper.columnGroupName: option.groupname,
DatabaseHelper.columnIsRequired:option.isrequired ,
DatabaseHelper.columnMerchantId: merchantid,
DatabaseHelper.columnMerchantHashKey: hashkey,
;
int id = await dbHelper.insertOption(row);
print('inserted option row id: $id');
Don't understand flutter but ... the select statement in dropTable() will drop the table??
– AIMIN PAN
Mar 7 at 7:46
@AIMINPAN I'm unable to drop the table .
– farhana
Mar 7 at 7:59
did you tryint idd = await dbHelper.dropTable();? I assume it's async
– TruongSinh
Mar 7 at 11:16
add a comment |
I want to drop table before populating server data if exist.
the Queries I'm trying
deleteOptionTable() async
final db = await database;
db.rawDelete("Delete * from option");
dropTable() async
final db = await database;
db.query('SELECT * FROM cloudnet360.db WHERE name =option and type=table');
I have tried something like this but nothing is happening.
void _insertOption(OptionsGroupList option) async
int idd = dbHelper.dropTable();
print('DROP TABLE: $idd');
PreferencesConnector myprefs= PreferencesConnector();
String merchantid=await myprefs.readString('merchantid');
String hashkey=await myprefs.readString('hashkey');
Map<String, dynamic> row =
DatabaseHelper.columnGroupId:option.grouprowid ,
DatabaseHelper.columnGroupName: option.groupname,
DatabaseHelper.columnIsRequired:option.isrequired ,
DatabaseHelper.columnMerchantId: merchantid,
DatabaseHelper.columnMerchantHashKey: hashkey,
;
int id = await dbHelper.insertOption(row);
print('inserted option row id: $id');
I want to drop table before populating server data if exist.
the Queries I'm trying
deleteOptionTable() async
final db = await database;
db.rawDelete("Delete * from option");
dropTable() async
final db = await database;
db.query('SELECT * FROM cloudnet360.db WHERE name =option and type=table');
I have tried something like this but nothing is happening.
void _insertOption(OptionsGroupList option) async
int idd = dbHelper.dropTable();
print('DROP TABLE: $idd');
PreferencesConnector myprefs= PreferencesConnector();
String merchantid=await myprefs.readString('merchantid');
String hashkey=await myprefs.readString('hashkey');
Map<String, dynamic> row =
DatabaseHelper.columnGroupId:option.grouprowid ,
DatabaseHelper.columnGroupName: option.groupname,
DatabaseHelper.columnIsRequired:option.isrequired ,
DatabaseHelper.columnMerchantId: merchantid,
DatabaseHelper.columnMerchantHashKey: hashkey,
;
int id = await dbHelper.insertOption(row);
print('inserted option row id: $id');
asked Mar 7 at 7:42
farhanafarhana
2,63552235
2,63552235
Don't understand flutter but ... the select statement in dropTable() will drop the table??
– AIMIN PAN
Mar 7 at 7:46
@AIMINPAN I'm unable to drop the table .
– farhana
Mar 7 at 7:59
did you tryint idd = await dbHelper.dropTable();? I assume it's async
– TruongSinh
Mar 7 at 11:16
add a comment |
Don't understand flutter but ... the select statement in dropTable() will drop the table??
– AIMIN PAN
Mar 7 at 7:46
@AIMINPAN I'm unable to drop the table .
– farhana
Mar 7 at 7:59
did you tryint idd = await dbHelper.dropTable();? I assume it's async
– TruongSinh
Mar 7 at 11:16
Don't understand flutter but ... the select statement in dropTable() will drop the table??
– AIMIN PAN
Mar 7 at 7:46
Don't understand flutter but ... the select statement in dropTable() will drop the table??
– AIMIN PAN
Mar 7 at 7:46
@AIMINPAN I'm unable to drop the table .
– farhana
Mar 7 at 7:59
@AIMINPAN I'm unable to drop the table .
– farhana
Mar 7 at 7:59
did you try
int idd = await dbHelper.dropTable();? I assume it's async– TruongSinh
Mar 7 at 11:16
did you try
int idd = await dbHelper.dropTable();? I assume it's async– TruongSinh
Mar 7 at 11:16
add a comment |
1 Answer
1
active
oldest
votes
Indeed your dropTable method does not seem to actually drop any table:
To delete (drop) a table:
DROP TABLE IF EXISTS my_table
To clear a table content:
DELETE FROM my_table
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55038488%2fdrop-table-and-recreate-if-exist-in-sqflite-flutter%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Indeed your dropTable method does not seem to actually drop any table:
To delete (drop) a table:
DROP TABLE IF EXISTS my_table
To clear a table content:
DELETE FROM my_table
add a comment |
Indeed your dropTable method does not seem to actually drop any table:
To delete (drop) a table:
DROP TABLE IF EXISTS my_table
To clear a table content:
DELETE FROM my_table
add a comment |
Indeed your dropTable method does not seem to actually drop any table:
To delete (drop) a table:
DROP TABLE IF EXISTS my_table
To clear a table content:
DELETE FROM my_table
Indeed your dropTable method does not seem to actually drop any table:
To delete (drop) a table:
DROP TABLE IF EXISTS my_table
To clear a table content:
DELETE FROM my_table
answered Mar 8 at 18:52
alextkalextk
1,8361220
1,8361220
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55038488%2fdrop-table-and-recreate-if-exist-in-sqflite-flutter%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Don't understand flutter but ... the select statement in dropTable() will drop the table??
– AIMIN PAN
Mar 7 at 7:46
@AIMINPAN I'm unable to drop the table .
– farhana
Mar 7 at 7:59
did you try
int idd = await dbHelper.dropTable();? I assume it's async– TruongSinh
Mar 7 at 11:16