Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create INSERT with datetime type field?
Message
 
 
To
22/08/2005 08:52:33
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01042503
Message ID:
01042641
Views:
44
>
>For SQL server see the parametric approach. It also handles headaches for conversion if field on VFP side is either date or datetime. ie:
>
>
>* f1: char, f2: datetime, f3:datetime
>cInsertCmd = "insert into myTable (f1, f2, f3) values (?m.Value1, ?m.Value2, ?m.Value3)"
>SQLPrepare(m.lnHandle,m.cInsertCmd)
>m.ldStart=date()
>for ix=1 to 5
>  m.Value1 = cdow(m.ldStart+m.ix-1)
>  m.VAlue2 = m.ldStart + m.ix - 1
>  m.Value3 = datetime() - (m.ix * 3600)
>  SQLExec(m.lnHandle)
>endfor
Cetin

Can you please explain what is the purpose of the "for ix=1" loop? Why do you call SQLExec without an insert command there? Can you do that?

Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform