delete a record

Sylvain Perque sylvain.perque at ac-reims.fr
Wed Apr 4 03:28:14 CDT 2007


Well, when I said a TEXT field, in that field there's only a word, for
exemple a name.
The sort works if I delete nothing in the database.
But when I delete something I can't sort properly with the TEXT field, and I
can't sort properly with DATETIME field for all new records created by my
program.
I am sure I do something wrong when I delete a record, and I really need
some help.

Here is the operations I do :

-- init
Valentina = new (Xtra("Valentina"))
Valentina.Init(3 * 1024 * 1024, "", "")
gDb = new (Xtra "VDatabase", #kLocal)
gDb.open("myPath\nameOfDatabase.vdb")
query = "select * from nameTable ORDER BY TDBDateTime"
gCursor = void
gCursor = gDb.sqlSelect(query, #kServer, #kReadWrite, #kRandom)

-- pTDBNom = gCursor.field("TDBNom")
-- pTDBPrenom = gCursor.field("TDBPrenom")
-- pTDBClasse = gCursor.field("TDBClasse")
pTDBDate = gCursor.field("TDBDateTime")
-- pTDBTexte = gCursor.field("TDBTexte")
-- pTDBIndexTxt = gCursor.field("TDBIndexTxt")

-- Go to the first record.
gCursor.firstRecord()

repeat while ... --here I test the date I want to delete, using pTDBdate
gCursor.NextRecord()
end repeat

-- when I find the record, I delete it
gCursor.deleteRecord()

gDB.flush()
gCursor = void
gDb.close()
gDb = void
Valentina.shutDown()


I know I can do better with a better query, but can you see what appen ?
I only do simple things.
Thanks.
Sylvain


----- Original Message ----- 
From: "Ruslan Zasukhin" <sunshine at public.kherson.ua>
To: <valentina at lists.macserve.net>
Sent: Tuesday, April 03, 2007 11:18 PM
Subject: Re: delete a record


> On 3/4/07 5:34 PM, "Sylvain Perque" <sylvain.perque at ac-reims.fr> wrote:
>
> >  Win 2000
> >  Director MX 2004
> > V4MD v2 (05/05/2005) I bought it the 17 05 2006 and didn't update it.
> >
> > gDb.sqlExecute("REINDEX TABLE name_of_my_table")
> > or gDb.sqlExecute("REINDEX DATABASE")
> > or gDb.sqlExecute("REINDEX FIELD name_of_the_DateTimeField")
> > didn't solve the problem.
> >
> >
> > It doesn't sort with a DateTime field and with a Text and DateTime
field.
> > I tried with only a text field, but it don't works.
>
> Wait. Please note
>
> TEXT field usually is Indexed By Words.
>
> Indexed By words field cannot be sorted.
>
>
> -- 
> Best regards,
>
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
>
> Valentina - Joining Worlds of Information
> http://www.paradigmasoft.com
>
> [I feel the need: the need for speed]
>
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
>



More information about the Valentina mailing list