Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert without nulls from NET
Message
 
 
To
27/07/2009 15:58:52
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01414410
Message ID:
01414855
Views:
28
>>>Yes, its a VFP database table.
>>>It is a single record INSERT.
>>>
>>>I thought perhaps I could write a stored procedure and a trigger that would remove the nulls after they were inserted but so far my attempts at this have not been successful.
>>
>>Have you looked at set null and defined needed behaviour for your table ?
>>Or you might
>>loGather = createobject ("empty")
>>insert into a cursor, 
>>for lnRun = 1 to fcount()
>>   lcFild = fieldnum(lnRun)
>>   lcVal = eval (lcFld) && some tricks with nvl ??
>>   if !isnull(lcVal)
>>      = addproprty(loGather, lcFld, lcVal)
>>   endif
>>next
>>insert from name loGather
>>or similar tricks....
>>
>>HTH
>>
>>thomas
>
>Well, it appears a SP like this will work.
>procedure ExecuteSQL(SQLstatement)
>set null off
>execscript(SQLStatement)
>Now the question is what kind of security holes does this create? Any thoughts? If I knew how to set null off by default maybe I wouldn't need the SP.

Can you apply this setting as part of the connection string or just run this execscript once you opened a connection?
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform