Search found 27 matches

by kerino
10.08.2008, 14:50
Forum: Firebird
Topic: How to check if constraint exists before adding
Replies: 2
Views: 1256

How to check if constraint exists before adding

Hi, I'm using Zeos and Firebird. I create a table with a constraint e.g. 'ALTER TABLE Table1 ADD CONSTRAINT FK_TEST1 FOREIGN KEY (Field1) REFERENCES Table2(Field2)' When I run the program again, the constraint already exists so I get an error. How can I change the statement to avoid the error please...
by kerino
01.07.2008, 08:50
Forum: 6.5.1 (alpha) - 6.6.x (beta)
Topic: Referencing other tables
Replies: 5
Views: 1114

Hi Sandeep,

Exactly what I wanted - it works great !!

Many thanks
Kerin
by kerino
30.06.2008, 15:08
Forum: 6.5.1 (alpha) - 6.6.x (beta)
Topic: Referencing other tables
Replies: 5
Views: 1114

Hi, I've had a look at creating a view, but still seem to have the same problem i.e. how do I reference a field from another table. Is there another way to do this? The actual conversion factor is a variable in the Delphi program, so is there any way I can reference this in the computed field? Many ...
by kerino
30.06.2008, 12:20
Forum: 6.5.1 (alpha) - 6.6.x (beta)
Topic: Referencing other tables
Replies: 5
Views: 1114

Hi Ben, I forgot to say I'm using Firebird, Zeos, Delphi5. What the problem is, is that I have a column which holds a dimension in inches, but I need to display it in inches, cm, mm etc. (user selectable) I thought a computed column would do the trick, but I'm open to suggestions. I'll take a look a...
by kerino
30.06.2008, 11:54
Forum: 6.5.1 (alpha) - 6.6.x (beta)
Topic: Referencing other tables
Replies: 5
Views: 1114

Referencing other tables

Hi, I have a table T1, which has a column 'dNum', and computed column. I also have another table CT, which just contains a single field 'Conv' holding a conversion factor. How can I define the computed column to hole (dNum * CT.Conv)? If I use ... 'CREATE TABLE T1 (' ...etc. 'Comp1 COMPUTED BY (dNum...
by kerino
27.06.2008, 15:42
Forum: 6.5.1 (alpha) - 6.6.x (beta)
Topic: Computed Column problem
Replies: 13
Views: 2378

Well spotted - I've been looking for ages, but sometimes you just can't see it!

Now everything has sprung into life, so I would like to thank you all for being such a help.
It's the first time I've used this forum, but I'm sure it won't be the last.

Thanks again - Kerin
by kerino
27.06.2008, 14:53
Forum: 6.5.1 (alpha) - 6.6.x (beta)
Topic: Computed Column problem
Replies: 13
Views: 2378

Well, I used db_Index etc. constants to avoid the possibility of getting the names wrong, so I don't think thats the problem. The error message is saying it cant recognise the token VALUE. I've now greatly simplified the program, and here it is:- // First create the table ZQuery1.SQL.Text := 'CREATE...
by kerino
27.06.2008, 11:13
Forum: 6.5.1 (alpha) - 6.6.x (beta)
Topic: Computed Column problem
Replies: 13
Views: 2378

Thanks for helping, but I'm still not there yet. I added a ZUpdateSQL component, and set the ZQuery1.UpdateObject := ZUpdateSQL1 in the properties list. Then I do ZUpdateSQL1.InsertSQL.Text := 'INSERT INTO Table1 (DINDEX,DNAME,DNUMBER) VALUES(:DINDEX,:DNAME,:DNUMBER);'; and then ZQuery1.SQL.Text := ...
by kerino
26.06.2008, 18:59
Forum: 6.5.1 (alpha) - 6.6.x (beta)
Topic: Computed Column problem
Replies: 13
Views: 2378

Thanks for the advice. I have never used ZUpdateSQL before, and after spending a pleasant couple of hours with Google, I've been unable to unearth information on how to use this component. I guess I do something like:- ZUpdateSQL1.InsertSQL.Text := 'INSERT INTO Table1'; ZUpdateSQL1.InsertSQL.Add(for...
by kerino
26.06.2008, 10:41
Forum: 6.5.1 (alpha) - 6.6.x (beta)
Topic: Computed Column problem
Replies: 13
Views: 2378

Computed column problem

Hi Mark, Thanks for replying. I just tried:- ZQuery1.SQL.Text := 'SELECT * FROM Table1'; ZQuery1.Open; ZQuery1.Edit; ZQuery1.Append; ZQuery1[db_Index] := 1; ZQuery1[db_Name] := 'Name1'; ZQuery1[db_Num] := 123.456; ZQuery1.CommitUpdates; and made sure the UpdateMode was set to umUpdateChanged, and it...
by kerino
26.06.2008, 10:27
Forum: Off Topic
Topic: User not able to register
Replies: 3
Views: 26194

New account success

Thanks Sandeep & Mark, it only took me two attempts to create an account this time, and hopefully it won't get deleted.
I have successfully posted my query.
by kerino
26.06.2008, 10:20
Forum: 6.5.1 (alpha) - 6.6.x (beta)
Topic: Computed Column problem
Replies: 13
Views: 2378

Computed Column problem

I'm rather new to Zeos & Firebird. I create a new database and a table as follows:- ZQuery1.SQL.Text := 'CREATE TABLE Table1 ('; ZQuery1.SQL.Add(db_Index+' INTEGER PRIMARY KEY,'); ZQuery1.SQL.Add(db_Name+' VARCHAR(10),'); ZQuery1.SQL.Add(db_Num+' DECIMAL (10,2),'); ZQuery1.SQL.Add(format('%s FLO...