Selected tasks database table - TaskDepender

Selected tasks database table

From TaskDepender
Jump to: navigation, search
 
Line 1: Line 1:
''This page describes the temporary table that is created to hold the ids of the selected tasks.''
+
__NOTOC__''This page describes the temporary table that is created to hold the ids of the selected tasks.''
  
 
== Description ==
 
== Description ==
Line 7: Line 7:
 
== Design ==
 
== Design ==
  
The ids of the selected tasks are stored in a temporary table. These ids are references to the ids in the [[Tasks database]].
+
The ids of the selected tasks are stored in a temporary table. These ids are references to the ids in the [[Tasks database table|tasks table]]. The usage will be entering and deleting a task and deleting all elements.
  
 
== Implementation ==
 
== Implementation ==
 +
 +
=== Creating the table ===
  
 
<syntaxhighlight lang="sql">
 
<syntaxhighlight lang="sql">
Line 16: Line 18:
 
   Id INTEGER REFERENCES Tasks(Id) ON DELETE CASCADE
 
   Id INTEGER REFERENCES Tasks(Id) ON DELETE CASCADE
 
)
 
)
 +
</syntaxhighlight>
 +
 +
=== Add a task ===
 +
 +
<syntaxhighlight lang="sql">
 +
INSERT INTO SelectedTasks VALUE(%d)
 +
</syntaxhighlight>
 +
 +
=== Delete a task ===
 +
 +
<syntaxhighlight lang="sql">
 +
DELETE FROM SelectedTasks WHERE Id=%d
 +
</syntaxhighlight>
 +
 +
=== Clear table ===
 +
 +
<syntaxhighlight lang="sql">
 +
DELETE FROM SelectedTasks
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Latest revision as of 18:33, 16 October 2011