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

Re: Remote View Boolean Fields by Anders

Anders
Tue Jan 16 03:04:27 CST 2007

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
>



Re: Remote View Boolean Fields by Curtis

Curtis
Tue Jan 16 08:15:52 CST 2007

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
>>
>
>



Re: Remote View Boolean Fields by Anders

Anders
Tue Jan 16 09:11:31 CST 2007

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
>>>
>>
>>
>
>



Re: Remote View Boolean Fields by Linn

Linn
Tue Jan 16 09:34:59 CST 2007

Curtis,

I did this in the context of a record details form. What I did was create
custom form properties for each of my logical type fields and in the Init()
of the form, queried the remote table and simply did an IF/THEN and saved a
.F. or .T. in the custom property for a PostgreSQL 0 or 1. If that makes
sense. But I was doing this for a single record at a time.

If you are trying to convert the query itself, for multiple records in the
return set couldn't you use a CASE statement in the SELECT statement? I
haven't tried this because I'm not working with PostgreSQL any longer but I
think this might work:

SELECT MyLogical = CASE WHEN Remote_Boolean = 0 THEN .F. ELSE .T. END
FROM PSQL_Table

When working with Microsoft SQL Server I've used CAST or CONVERT but don't
know if it would work with PostgreSQL.

Hope this helps,
Linn

"Curtis" <csch_nu@hotmail.com> wrote in message
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
>>>
>>
>>
>
>



Re: Remote View Boolean Fields by Curtis

Curtis
Tue Jan 16 09:44:41 CST 2007

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
>>>>
>>>
>>>
>>
>>
>
>



Re: Remote View Boolean Fields by Anders

Anders
Tue Jan 16 10:31:03 CST 2007

"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
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Re: Remote View Boolean Fields by Curtis

Curtis
Tue Jan 16 14:59:56 CST 2007

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
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Re: Remote View Boolean Fields by Anders

Anders
Tue Jan 16 16:56:06 CST 2007

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
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Re: Remote View Boolean Fields by Curtis

Curtis
Wed Jan 17 07:19:20 CST 2007

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
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



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
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>




Re: Remote View Boolean Fields by Anders

Anders
Wed Jan 17 08:46:17 CST 2007

BTW, CAST(logicalfield AS Int) in a VFP expression will return 0 or 1.
-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?
>




Re: Remote View Boolean Fields by Curtis

Curtis
Wed Jan 17 13:20:59 CST 2007

Thanks for the help
"Linn Kubler" <lkubler@chartwellwisc2.com> wrote in message
news:eBw5iPYOHHA.3916@TK2MSFTNGP02.phx.gbl...
> Curtis,
>
> I did this in the context of a record details form. What I did was create
> custom form properties for each of my logical type fields and in the
> Init() of the form, queried the remote table and simply did an IF/THEN and
> saved a .F. or .T. in the custom property for a PostgreSQL 0 or 1. If
> that makes sense. But I was doing this for a single record at a time.
>
> If you are trying to convert the query itself, for multiple records in the
> return set couldn't you use a CASE statement in the SELECT statement? I
> haven't tried this because I'm not working with PostgreSQL any longer but
> I think this might work:
>
> SELECT MyLogical = CASE WHEN Remote_Boolean = 0 THEN .F. ELSE .T. END
> FROM PSQL_Table
>
> When working with Microsoft SQL Server I've used CAST or CONVERT but don't
> know if it would work with PostgreSQL.
>
> Hope this helps,
> Linn
>
> "Curtis" <csch_nu@hotmail.com> wrote in message
> 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
>>>>
>>>
>>>
>>
>>
>
>



Re: Remote View Boolean Fields by Curtis

Curtis
Wed Jan 17 13:20:50 CST 2007

Thanks for the help
"Anders Altberg" <A@A> wrote in message
news:eDcuDZkOHHA.5000@TK2MSFTNGP03.phx.gbl...
> BTW, CAST(logicalfield AS Int) in a VFP expression will return 0 or 1.
> -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?
>>
>
>
>