I am using C++ Builder 5 and Interbase 5.6
I have a table and a big Problem ;)
CREAT TABLE CUSTOMER
(
CustomerID NOT NULL PRIMARY KEY,
Name VARCHAR(30),
Street VARCHAR(30),
City VARCHAR(30)
)
how can I autoincrement the CustomerID whenever
a new Record is inserted (using a generator&insert trigger or a
generator
in the InsertSQL of the TIBUpdateSQL ) with avoiding the
"EDatabaseerror - CustomerID must have a value"
(which is logical because it is defined NOT NULL - But it must be NOT
NULL
because it is the PRIMARY KEY)
I want to be able to Update and Insert using TIBUpdateSQL and
TIBQuery - and the CustomerID shall autoincrement when a new
Customer is inserted.
It would be real great If someone could help me or point me to
another solution. Do I have a general mistake in my concept?
Thanks
Erik
--
Martijn Tonies
Upscene Productions
For InterBase Workbench,
the developer tool for InterBase
http://www.interbaseworkbench.com
For Delphi Components and InterBase tools:
http://www.upscene.com
"Erik Huber" <er...@wwww.at> wrote in message
news:390E2189...@wwww.at...
Martijn Tonies <no_spam_m.tonies@_no_spam_upscene.demon.nl> wrote in message
news:8eq81u$sp...@bornews.borland.com...
Remember, when working with C/S database, you don't have a live view on data
like with dBase or Paradox. You query the database, it gives you a resultset
and that's it... No more, no less. So, if you insert a record (with an
insert statement), you'll _have_ to get the newest resultset from the
server, hence, re-query...
--
Martijn Tonies
Upscene Productions
For InterBase Workbench,
the developer tool for InterBase
http://www.interbaseworkbench.com
For Delphi Components and InterBase tools:
http://www.upscene.com
"cai" <pha...@163.net> wrote in message news:3910e8e7@dnews...
On the client program, select the field that is the primary key and set the
property to "not required". Then you will not have to enter a value. Of
course, the database, itself, will require the primary key to have a value,
but that's what the trigger will handle.
While you are at it, you might as well set the client side property of the
primary key to "read only".
Richard D. Heath