Re: Remote View Boolean Fields by Anders
Anders
Wed Jan 17 08:27:20 CST 2007
What letter did the View Designer set the PostgreSQL Boolean data type to
before you changed it to "L"?
As PostgreSQL has a Bit data type you could try a query with
CAST(Booleancolumn AS Bit) and see if VFP makes sense of that automatically,
or allows you to set the output as "L".
-Anders
"Curtis" <csch_nu@hotmail.com> skrev i meddelandet
news:eMCTbojOHHA.4940@TK2MSFTNGP03.phx.gbl...
> Yes, I modified the code to put the type of "L" or logical in. It gives me
> the error I mentioned below.
>
> The only thing I found works is to cast the boolean field in Postgresql to
> an integer and then in the view designer cast the integer to a foxpro
> logical. That seems to work in VFP 9 only, is there any other way that
> might work?
>
> Thanks,
> Curtis
> "Anders Altberg" <A@A> wrote in message
> news:uyhVrGcOHHA.780@TK2MSFTNGP03.phx.gbl...
>> That's the code the View Designer shows if it has decided that this is a
>> Logical field, unless you put the "L" in there. That should work.
>> If you're calling DBSetProp from the Command window you need to replace
>> the reference Thisview with the actual name of the view.
>> -Anders
>>
>>
>> "Curtis" <csch_nu@hotmail .com> skrev i meddelandet
>> news:Oo2LJFbOHHA.4724@TK2MSFTNGP02.phx.gbl...
>>> You would think that it would but it is a boolean in Postgresql and when
>>> trying to set the DataType to logical in Foxpro I get the "data type
>>> conversion required by DataType property for field is invalid" error.
>>>
>>> This is the code I use
>>>
>>> DBSetProp(ThisView+".closed","Field","DataType","L")
>>>
>>> Doesn't make any sense to me either.
>>>
>>> I did discover VFP 9 will allow an integer field from Postgresql to be
>>> converted to a foxpro logical but for whatever reason it doesn't it I
>>> can't specify logical as a datatype for a boolean datatype in
>>> Postgresql.
>>> "Anders Altberg" <A@A> wrote in message
>>> news:ux1RfyYOHHA.5064@TK2MSFTNGP04.phx.gbl...
>>>> "View.field" means "name_of_your_view.name_of_the_column". The Help has
>>>> this example:
>>>> DBSETPROP('mytable.icost', 'field', ; 'DataType', 'N(4,2)')
>>>>
>>>>
>>>> I don't see why VFP would refuse to convert a Boolean to Logical. It is
>>>> practically a built-in feature.
>>>>
>>>>
>>>>
>>>> "Curtis" <csch_nu@hotmail.com> skrev i meddelandet
>>>> news:%239Sq%23UYOHHA.536@TK2MSFTNGP02.phx.gbl...
>>>>> This produces an error "Type conversion required by the DataType
>>>>> property for field " " is invalid"
>>>>> "Anders Altberg" <A@A> wrote in message
>>>>> news:ObhCJDYOHHA.4376@TK2MSFTNGP02.phx.gbl...
>>>>>> Hi Curtis,
>>>>>> OPEN DATABASE <<with your remote view>>
>>>>>> DBSETPROP("View.field", "FIELD", "DataType", 'L' )
>>>>>> -Anders
>>>>>>
>>>>>> "Curtis" <csch_nu@hotmail.com> skrev i meddelandet
>>>>>> news:u0K8VjXOHHA.5064@TK2MSFTNGP04.phx.gbl...
>>>>>>> We are using PostgreSQL is there anyway to specify a cast to
>>>>>>> logical?
>>>>>>>
>>>>>>> "Anders Altberg" <A@A> wrote in message
>>>>>>> news:ezCAZ1UOHHA.1248@TK2MSFTNGP02.phx.gbl...
>>>>>>>> What backend database are you using. Between Microsoft SQL Server
>>>>>>>> and Visual FoxPro , VFP's Logical data type is automatically
>>>>>>>> converted to an from SQL Server's Bit data type.
>>>>>>>>
>>>>>>>> -Anders
>>>>>>>>
>>>>>>>> "Curtis" <csch_nu@hotmail.com> skrev i meddelandet
>>>>>>>> news:ew1qQfPOHHA.1872@TK2MSFTNGP04.phx.gbl...
>>>>>>>>>I am currently using VFP 7.0, I can not seem to get a remote view
>>>>>>>>>field to convert to foxpro logical. I get an error saying "Type
>>>>>>>>>conversion required by DataType field is invalid". Why won't
>>>>>>>>>foxpro convert an SQL boolean type to its logical type. It wants to
>>>>>>>>>convert it to a character field length of one, which will not work
>>>>>>>>>in our case because we have existing code that relys on this field
>>>>>>>>>being a "logical" data type.
>>>>>>>>>
>>>>>>>>> Thanks in advance,
>>>>>>>>> Curtis
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>