You are not logged in.
Pages: 1
Sometimes, I need copy same records of my old database to a new database (database without record).
To do it I have create an application, however I have problem with ID. In fact I cannot create a new record and set the ID value. I cannot use TSQLRecord.ADD because it don't support ID (ID is not save), and I cannot use TSQLRecord.UPDATE bucause it support ID but the record not exist (the new database is black database).
I think in SQLIte is possible specify the ID of a new record, in fact I use an SQLIte editor (http://sqliteadmin.orbmu2k.de/ based on ZeosLib), this free tool allow to import record from CSV file and I can import also the ID field. In alternative in fact the new table (new database) will be different from old table (old database).
Is there a solution? Something to add a new record with specific ID, if this ID not exist.
Last edited by array81 (2012-04-09 12:02:43)
Offline
Since the code must be changed, I would give you some advice:
1) The user can choose if he want only add the new record or in alternative update it (if ID already exists);
2) If the user choose add only, the user must be if there is an error (if ID already exists);
3) If the user choose add or update (if ID already exists) the user can know if the record was added or updated;
Thanks for your work
Offline
A new ForceID parameter has been set for TSQLRest.Add() to allow adding a given ID.
See http://synopse.info/fossil/info/3f9985da02
It won't fulfill your point 3) in the current state, I think.
Offline
Thanks I will try it.
Point 3 did not help me but I thought it might be useful to prevent problems.
Offline
Is it possible add this feature also for batch procedure?
Last edited by array81 (2012-04-10 20:37:37)
Offline
That's it: I've added a new ForceID parameter for TSQLRest.Add() and TSQLRestClientURI.BatchAdd() to allow adding a record with a given ID.
Offline
Pages: 1