G'day Paul, Here is a block I wrote for dropping the key on a received table and column name pair.
$COMMAND
Cnstrnt1
-- Deletes PK\FK constraint for a column
-- Called by:
-- CnstrntG in GlobBlok.apx
*( Calling code:
SET VAR vTableName TEXT = ''
SET VAR vColName TEXT = ''
RUN Cnstrnt1 IN GlobBlok.apx
)
-- Created by Tom Grimshaw 04-06-2002
-- Modification history
--
SET MANY='*'
SET SINGLE='?'
SELECT sys_table_id INTO +
vTableID INDICATOR vi1 +
FROM SYS_TABLES +
WHERE SYS_TABLE_NAME = .vTableName
LABEL RetrCFK4
DECLARE cFK4 CURSOR FOR +
SELECT SYS_INDEX_NAME +
FROM SYS_INDEXES +
WHERE SYS_TABLE_ID = .vTableID +
AND SYS_COLUMN_NAME = .vColName +
AND SYS_INDEX_NAME CONTAINS '#'
IF SQLCODE = -708 THEN
-- Cursor already defined
DROP CURSOR cFK4
GOTO RetrCFK4
ENDIF
OPEN cFK4
LABEL GoAgain
FETCH cFK4 INTO +
vConstraintName IND viC1
IF SQLCODE <> 0 THEN
GOTO ChckCol
ENDIF
SET VAR vCmd TEXT = ('ALTER TABLE' & .vTableName & +
'DROP CONSTRAINT ' + .vConstraintName)
&vCmd
GOTO GoAgain
LABEL ChckCol
DROP CURSOR cFK4
SET MANY='%'
SET SINGLE='_'
RETURN
At 10:04 01/11/02 -0500, you wrote:
Can somebody give me some direction solving an index problem? I expect to
work on this over the week-end. A reload does not seem to work.
Ran autochk on a 4.5++ database and received messages on several tables as
follows:
"Examining table POL
"Index: ppdate
"Primary Key #32
"A Pramary [sic] Key was found in a table not known to have a Primary Key
"An index entry contains invalid columns
"A foreign key is referencing the wrong table"
All messages are referencing primary key #32.
Any advice appreciated. Many thanks.
Paul Hill
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/
Warmest regards,Tom Grimshaw
coy: Just For You Software
tel: 612 9552 3311
fax: 612 9566 2164
mobile: 0414 675 903
post: PO Box 470 Glebe NSW 2037 Australia
street: 3/66 Wentworth Park Rd Glebe NSW 2037
email: [EMAIL PROTECTED]
web: www.just4usoftware.com.au
"... the control of impulse -- is the first principle of civilization."-- Will Durant,
Pulitzer Prize winning philosopher, writer and historian
the most needed product in the world can be found at
www.thewaytohappiness.org
This email and any files transmitted with it are confidential to the intended recipient and may be privileged. If you have received this email inadvertently or you are not the intended recipient, you may not disseminate, distribute, copy or in any way rely on it. Further, you should notify the sender immediately and delete the email from your computer. Whilst we have taken precautions to alert us to the presence of computer viruses, we cannot guarantee that this email and any files transmitted with it are free from such viruses.
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/
