Re: Stored procedure to set defaults
From: Cindy Winegarden (cindy.winegarden_at_mvps.org)
Date: 09/10/04
- Previous message: Dan Freeman: "Re: Stored procedure to set defaults"
- In reply to: TA: "Re: Stored procedure to set defaults"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 10 Sep 2004 18:18:36 -0400
Hi TA,
AFields() will give you an array of field names, types, etc. You can iterate
through the array and build a command to set your values.
Are you working against Fox data or some other kind? The default value for
character and memo types is a blank string, the default for dates is {}
(empty) and the default for numeric types is 0. In other words, if you
append a new record to a Fox table you'll probably get what you want
automatically.
-- Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP cindy.winegarden@mvps.org www.cindywinegarden.com "TA" <nospam.Tar@hotmail.com> wrote in message news:%23xnbMX3lEHA.2884@TK2MSFTNGP09.phx.gbl... >I dont know the basis of stored procedure.. maybe you can give me some > hints.. > > "Dan Freeman" <spam@microsoft.com> wrote in message > news:uKOIYR3lEHA.3432@TK2MSFTNGP14.phx.gbl... >> You should look up Type() in the help file. >> >> But you may be working a little too hard. Take a look at AFIELDS() while >> you're in there. <g> >> >> Dan >> >> TA wrote: >> > I have this stored procedure that sets defaults to blank strings for >> > all the columns in a table. I have some date columns in this table >> > also, how would I identify that the column is data or integer or >> > double or char.. >> > >> > PROCEDURE DefaultsALL >> > USE qtk EXCLUSIVE >> > FOR i = 1 TO FCOUNT() >> > fieldname = FIELD(i) >> > ALTER TABLE Qtk ALTER COLUMN (fieldname) set default ' ' >> > ENDFOR >> > ENDPROC >> >> > >
- Previous message: Dan Freeman: "Re: Stored procedure to set defaults"
- In reply to: TA: "Re: Stored procedure to set defaults"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|