Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To Get The Name Of An Auto Increment Field
Message
 
To
24/01/2008 19:01:34
Al Doman (Online)
M3 Enterprises Inc.
North Vancouver, British Columbia, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01285380
Message ID:
01285390
Views:
16
Ok, here's the problem with this.

I'm working on a legacy app. I'm writing a process that automatically inserts records into
a DBF.

There is a default value for the PK field:
new_pk("custpoc","poc_pk")
which calls a stored proc that returns the row's PK value.

My process forms an INSERT statement, which is throwing an error "Uniqueness of index POC_PK is violated."

Not all tables are calling this stored proc, so this presents a problem.

I'm trying to make my process generic so that I can use it in any app. I need a way to
exclude the PK column from the insert statement when this rule is in place.

Anyone?





>>How do I return the name of a table's AutoInc field?
>
>Spin through the results of AFIELDS() or COPY STRUCTURE EXTENDED and look for rows with Step > 0.
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform