[Kexi] Delete records from table (empty table)

Jarosław Staniek js at iidea.pl
Wed Feb 13 17:13:50 CET 2008


John Jason Jordan said the following, On 2008-02-13 17:04:
> On Wed, 13 Feb 2008 11:17:13 +0100
> Jarosław Staniek <js at iidea.pl> dijo:
> 
>> Jan Gromadzki said the following, On 2008-02-13 10:58:
>>> On Tue, 12 Feb 2008 18:05:55 -0800
>>> John Jason Jordan <johnxj at comcast.net> wrote:
>>>
>>>> Kexi 1.1.3 (KOffice 1.6.3) (Using KDE 3.5.8) on Ubuntu Gutsy x86_64
>>>>
>>>> Back in the bad old MS Access days if I wanted to empty all records
>>>> from a table I did so with a query. I have spent the past hour poking
>>>> all over Kexi trying to figure out how to make a quick
>>>> click-click-click way to empty a table of all records. Is it with a
>>>> query? Do I have to learn SQL syntax to do so?
>>> The simplest way to delete all the data from a table in Kexi 1.1.3 is
>>> to save design of that table (after changing anything in it). This is
>>> not a feature probably but only consequence of the early stage of the
>>> project,
> 
> Someone else mentioned to use DROP TABLE and then recreate it. I'm
> still figuring out Kexi so I was not aware that it could save the
> design of a table even after it was deleted. That might be another way
> to accomplish what I need.

This is perhaps the worst way (perhaps except removing the whole or formatting 
the hard drive ;) )

> 
>> As I have mentioned there is even simpler and non-hacky command: "Edit->Clear 
>> Table Contents".
> 
> Thanks. This gets the job done. However, I need to delete the contents
> of my table ("worktable") repeatedly. It would be faster and easier if
> I could get the DELETE query to work. "DELETE from worktable;" and all
> other variations of it that I have tried have failed. I used the
> instructions on http://www.sqlite.org/lang.html.
> 
> Also, I can't find much about the query design window in the Handbook.
> I am now trying to create a query that will select records from a source
> table and insert them into worktable based on the values in a field in
> the source table. 

Only SELECT queries work, no DELETE, UPDATE, CREATE queries for now in the gui.

 > I see Column, Table, Visible, Sorting, and Criteria,
> but I can't figure out how to use the columns and rows to accomplish
> what I want. Also, I keyed fields in the source table by dragging them
> to the identical fields in worktable, but when I look at the SQL it
> seems to be trying to select from worktable. Yet the arrows on the
> lines between the two tables in the design window definitely point to
> worktable. If I drag the other direction (arrows pointing to the source
> table) I get the same results. 
> 
> And finally, I can't figure out how to specify the criteria. There is a
> field "4_susan" that contains "LQ1-xx" where xx is a two digit number
> number. I want all and only the records from the source table where
> "LQ1-" occurs in this field. This should be bonehead simple but i can't
> figure out how to do it.

IIRC 4_susan can only be a caption, the name would be like _4_susan, unless 
you picked your own name. Look at your table design window.

> Is there a place where the use of the query design window is explained
> in more detail?

This isn't, because people find it so convenient to ask here and disappear 
without writing one, you know :)

-- 
regards / pozdrawiam, Jaroslaw Staniek
  Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
  Kexi & KOffice (http://www.kexi.pl/en, http://www.koffice.org/kexi)
  KDE Libraries for MS Windows (http://windows.kde.org)



More information about the Kexi mailing list