Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to create table with primary key and index expr.

Status
Not open for further replies.

ron9999

Programmer
Feb 14, 2003
89
AT
Hi All,
trying to create a table like that:

CREATE TABLE UPDATE (start t(8),;
describtion c(50) PRIMARY KEY ,;
KEY n(8.2))

first error, index to long
so, I cut describtion to describtio

Now I like to make the index-expression
ALLTR(describtion)?

where and how must I use this

tia
Ronald
 
ron9999

Try :
CREATE TABLE UPDATE (start t(8),;
describtio c(50) PRIMARY KEY ,;
KEY n(8.2))

Your tag name should not exceed 10 characters and since you are not specifying the Tag name it takes on the field name which is 11 characters.
A couple of othe issues, I wouldn't use Key words like "update" and "Key", it might cause confusion when it comes time to update the table update.
Another point is if you are create a table that will be part of a database, the database should be open prior to the above code.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
thank you Mike,
but I don't know the syntax how to create an index-expression like Alltr(descriptio)

Tia
Ron
 


If you need to have a field that is designated as a Primary key field:
1. The table needs to be part of a database.
2. The clause must be placed within the parentheses containing the column definitions.
3. The index tag name cannot be longer than 10 characters.

If you want a table that is free (not part of a database)you cannot have a Primary Key, nor can you field exceed 10 characters long

Code:
CREATE TABLE UPDATE2 (start t(8),; 
describtio c(50),;
KEY n(8.2))
INDEX ON ALLTRIM(describtio) TAG describtion



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
thank you Mike,
the table is a part of a database (database is open)
I had to change the TAG to describtio now it works
thank you again
Ronald Weinrich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top