G'day Konstantin,

At 19:24 15/07/02 +0000, you wrote:
>It is not a bug. The name of index is a string - "#999999"

You are right!   But try treating it as a string and enclosing
it in quotes and see what happens.

Unfortunately my joy at the problem disappearing was short lived.
I had another FK that was not able to be removed programmatically
or at the R>.   It was only able to be removed at the Object Manager
as the constraint name could not be found.   When I run this code
through TRACE the correct constraint name is set (as verified in
the Designer) but R:BASE claims it cannot be found.

Anyone have any idea what causes this?   Is anyone able to duplicate it?

Here is my code equivalent:

$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


>Next code is beta solution.
>--------------------------------------
>SET VAR vTableID INTEGER
>SELECT SYS_TABLE_ID INTO vTableID ivTableID FROM SYS_TABLES +
>  WHERE SYS_TABLE_NAME = 'Table_Name'
>SET VAR vConstraintName TEXT
>SELECT SYS_INDEX_NAME INTO vConstraintName IvConstraintName +
>  FROM SYS_INDEXES WHERE SYS_TABLE_ID = .vTableID +
>                     AND SYS_COLUMN_NAME = 'Column_Name'
>SET VAR vCommand TEXT = +
>('ALTER TABLE Table_Name DROP CONSTRAINT' & .vConstraintName)
>&vCommand
>--
>CLEAR VAR vTableID,ivTableID,vConstraintName,IvConstraintName,vCommand
>-----------------------------------------------
>
>[EMAIL PROTECTED]
>(503) 253 4875
>Konstantin Gudjev

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/

Reply via email to