Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stored Procedures in automation server or stand alone DBC
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Stored Procedures in automation server or stand alone DBC
Miscellaneous
Thread ID:
00429747
Message ID:
00429747
Views:
62
I have developed a database with no VFP front end which will be accessed by a JDBC application, therefore there is no Fox progran front end.
My problem is that I want to store a procedure that will concantenate the contents of 5 character fields upon data entry and store the result into a sixth field which will then be the primary key.

sample code for the procedure is similar to the following:

If !empty(field1)
Ver1 = Alltrim(field1)
else
Var1 = ""
endif
if !empty(field2)
Var2 = alltrim(field2)
else
Var2 = ""
endif
if !empty((field3)
Var3 = alltrim(field1)
else
Var3 = ""
endif
if !empty(field4)
Var4 = alltrim(field4)
else
Var4 = ""
endif
var5 = version && this will be a single digit integer in character format
var6 = var1+"_"+var2+"_"+var3+"_"+var4+"_"+var5
** Need code here to test field 6 to see if it already exists, and if so, determine the VAL(var5), incrfement it by one, then store
** the new value as CHR into var5. and if a new value, refresh the var6 value and insert it into the correct field.
** This needs to be a update trigger so as to do it automatically upon the table update. It needs to do the calculation both on append
** or on a record update. Error trapping code to intercept primary key errors has to be included too, and the SQL insert does an append blank, which adds a blank field before the update trigger.

Has any one run across this before?
MSCE, MCSP, Microsoft Channel Partner

Relax, Boss. We will meet the deadline! What? You want to add MORE? What do you mean, Over Budget?

Opinions and comments are the sole responsibility of the sender, and accuracy, correctness, or pertinence is considered coincidental.
Reply
Map
View

Click here to load this message in the networking platform