dbTalk Databases Forums  

VFP6 .dbc Validation Errors

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss VFP6 .dbc Validation Errors in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gene Wirchenko
 
Posts: n/a

Default VFP6 .dbc Validation Errors - 01-27-2006 , 05:06 PM






It is nice to finally have FK RI working. This leads to the next
questions which deal with error recovery.

1) If a column constraint is violated (error 1582), I get back a
text message, but the column name would be nice, too. (Yes, I could
simply return the column name and look up that in an error message
table, but I am hoping for something simpler.)

2) Is it possible to find out which trigger failed? If I have a
table with two FKs, how do I tell which is wrong? In this case, there
is no unique text returned. Even getting the column name would help.
(If I violate the uniqueness primary key constraint, error 1884
returns the column name. I want something like that here.)

3) Is there any guarantee of which order the constraints are checked
/ the errors are thrown? If not, what has been your observation of
the order?

Sincerely,

Gene Wirchenko


Reply With Quote
  #2  
Old   
Olaf Doschke
 
Posts: n/a

Default Re: VFP6 .dbc Validation Errors - 01-28-2006 , 12:36 PM






Hi Gene,

first of all vfp creates vfp code in the dbc, so everything
the ri code does can be seen and/or modified the way you'd
like it. This also regards the order of tests. Other third party
ri code builders may be a better choice, as they normally
create code better understandable. TaxRI and AMRI are
two I know of. AMRI eg creates a public var _RI_Message
which makes it easy to react to trigger errors.

Quote:
1) If a column constraint is violated (error 1582)
Try Sys(2018) or see what AERROR() stores in the elements
of the array created.

Quote:
2) Is it possible to find out which trigger failed?
definately with AERROR(). See what the helps says
on element 5. Normally that is NULL, but with error
1539 this has info about the trigger type.

Quote:
3) Is there any guarantee of which order the constraints
are checked / the errors are thrown?
See my initial remarks. I think vfp first checks the
full record (all FKs) in their field order, then it recurses
for cascades. But I'm not that familiar with vfp native RI
code. I only know there were an error with multiple
cascades not rolling back deletes when stepping to some
restrict. As you use vfp6 you may still have these errors.
I'd recommend to use some other RI builder.

Bye, Olaf.




Reply With Quote
  #3  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: VFP6 .dbc Validation Errors - 01-30-2006 , 02:25 PM



On Sat, 28 Jan 2006 19:36:05 +0100, "Olaf Doschke"
<T2xhZi5Eb3NjaGtlQFNldG1pY3MuZGU (AT) strconv (DOT) 14
<T2xhZi5Eb3NjaGtlQFNldG1pY3MuZGU (AT) strconv (DOT) 14> wrote:

Quote:
first of all vfp creates vfp code in the dbc, so everything
the ri code does can be seen and/or modified the way you'd
like it. This also regards the order of tests. Other third party
ri code builders may be a better choice, as they normally
create code better understandable. TaxRI and AMRI are
two I know of. AMRI eg creates a public var _RI_Message
which makes it easy to react to trigger errors.
Pointers?

Quote:
1) If a column constraint is violated (error 1582)
Try Sys(2018) or see what AERROR() stores in the elements
of the array created.
I am already looking at those two. They are not giving quite
enough information.

Quote:
2) Is it possible to find out which trigger failed?
definately with AERROR(). See what the helps says
on element 5. Normally that is NULL, but with error
1539 this has info about the trigger type.
It says what kind of trigger failed (insert, update, or delete),
but not why. If I have two FKs in a row, which one was wrong?

[snip]

Sincerely,

Gene Wirchenko



Reply With Quote
  #4  
Old   
Olaf Doschke
 
Posts: n/a

Default Re: VFP6 .dbc Validation Errors - 01-30-2006 , 04:56 PM



Quote:
Pointers
You can find TaxRI at UT (www.universalthread.com), Download-ID 9923
You can find AMRI at ftp://ftp.prolib.de/Public/VFP/AMRI400.zip

Bye, Olaf.




Reply With Quote
  #5  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: VFP6 .dbc Validation Errors - 01-30-2006 , 08:42 PM



On Mon, 30 Jan 2006 23:56:40 +0100, "Olaf Doschke"
<b2xhZi5kb3NjaGtlQHQtb25saW5lLmRl.strconv.14 (AT) t-online (DOT) de> wrote:

Quote:
Pointers
You can find TaxRI at UT (www.universalthread.com), Download-ID 9923
You can find AMRI at ftp://ftp.prolib.de/Public/VFP/AMRI400.zip
Thanks. I have downloaded them and will have a look later.

Sincerely,

Gene Wirchenko



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.