?
Solved

creating tables

Posted on 2003-03-16
6
Medium Priority
?
441 Views
Last Modified: 2011-04-14
how can i create interbase table

can you correct this one.

   Query1.SQL.clear;
   Query1.SQL.Add('CREATE TABLE '+EMPRECORD+' (');
   Query1.SQL.Add('BADGENO CHAR(6),');
   Query1.SQL.Add('FIRSTNAME CHAR(50),');
   Query1.SQL.Add('MIDDLENAME CHAR(50),');
   Query1.SQL.Add('LASTNAME CHAR(50),');
   Query1.SQL.Add('BDATE TIMESTAMP,');
   Query1.SQL.Add('DEPARTMENT CHAR(70),');
   Query1.SQL.Add('PLANTNAME CHAR(50),');
   Query1.SQL.Add('SHIFTCODE CHAR(10),');
   Query1.SQL.Add('PICTURE CHAR(200))');
   Query1.ExecSQL;

   Query1.SQL.clear;
   Query1.SQL.Add('CREATE UNIQUE INDEX EMPRECORD_BADGENO');
   Query1.SQL.Add('ON '+EMPRECORD);
   Query1.SQL.Add('{"BADGENO"}');
   Query1.ExecSQL;


whats the error of my code?
how can i create indexes?
how can i make a 3 field unique?

can you give me a sample working codes please.

0
Comment
Question by:ryan_sabarre
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 

Author Comment

by:ryan_sabarre
ID: 8149652
help me
0
 
LVL 10

Accepted Solution

by:
kacor earned 200 total points
ID: 8149987
Hi ryan_sabarre,

1. whats the error of my code?
try
  Query1.SQL.clear;
  Query1.SQL.Add('CREATE UNIQUE INDEX EMPRECORD_BADGENO');
  Query1.SQL.Add('ON EMPRECORD (BADGENO)');
  Query1.ExecSQL;

2. how can i create indexes?
CREATE [UNIQUE] [ASC[ENDING] | DESC[ENDING]] INDEX index
ON table ( col [, col …]);

3. how can i make a 3 field unique?
CREATE UNIQUE INDEX index_name ON table_name (field1, field2, field3);

I hope it helps
wbr
Janos
0
 
LVL 10

Expert Comment

by:kacor
ID: 8149994
2. how can i create indexes?
CREATE [UNIQUE] [ASC[ENDING] | DESC[ENDING]] INDEX index
ON table ( col1, col 2, ...);

sorry for the mistake

Janos

0
 

Expert Comment

by:CleanupPing
ID: 9316750
ryan_sabarre:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question