Alaska Software Inc. - FieldInfo() Information
Username: Password:
AuthorTopic: FieldInfo() Information
Carlos A Beling FieldInfo() Information
on Tue, 04 Feb 2020 17:36:30 -0300
Hi.
Good day.
I am using DbImport(...,cDbeForTheOriginalDBF) for to import data from 
DBF opened using DBFCDX for another one opened using DBFCDX too.
In the original DBF I have 2 fields:
1) one with fieldtype 'X'
2) one with fieldtype 'C'
Both must to be imported for the same names with field type 'X'

Using FieldInfo() for the fields defined with field type 'X it returns:
	FieldInfo(nFieldPos, FLD_TYPE_AS_NUMERIC ) returns 256
	FieldInfo(nFieldPos, FLD_NATIVETYPE) returns "Operation not supported 
by this DBE"
	FieldInfo(nFieldPos, FLD_NATIVETYPE_AS_NUMERIC) returns 12

Using FieldInfo() for the fiels defined with field type 'C' it returns:
	FieldInfo(nFieldPos, FLD_TYPE_AS_NUMERIC ) returns 2
	FieldInfo(nFieldPos, FLD_NATIVETYPE) returns "Operation not supported 
by this DBE"
	FieldInfo(nFieldPos, FLD_NATIVETYPE_AS_NUMERIC) returns 1

In the new one DBF FieldInfo() returns for the fields respectively 256 
and 12.

The trouble is that the original field type 'C' is not converted for 
field type 'X' in the output DBF.

Can someone tell me why the conversion does not occurs?

Fraternally
Beling
Andreas Gehrs-Pahl
Re: FieldInfo() Information
on Wed, 05 Feb 2020 12:04:38 -0500
Carlos,

>I am using DbImport(...,cDbeForTheOriginalDBF) for to import data from 
>DBF opened using DBFCDX for another one opened using DBFCDX too.
>In the original DBF I have 2 fields:
>1) one with fieldtype 'X'
>2) one with fieldtype 'C'
>Both must to be imported for the same names with field type 'X'

The DBFDBE doesn't support the Field Type "X", so you need to use the FOXDBE 
to open both (the source and the target) tables.

>The trouble is that the original field type 'C' is not converted for 
>field type 'X' in the output DBF.
>Can someone tell me why the conversion does not occurs?

You do have the source code for the DbImport() function here:

	...\Source\Runtime\Sys\DbBulk.prg

so you can modify or adapt it to do any data-type conversions that you 
require, or you could simply debug it, but using the correct DBE should 
actually be enough in this particular case. 

Hope that helps,

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas@AbsoluteSoftwareLLC.com
web:   http://www.AbsoluteSoftwareLLC.com
[F]:   https://www.facebook.com/AbsoluteSoftwareLLC
Carlos A Beling Re: FieldInfo() Information
on Thu, 06 Feb 2020 10:33:54 -0300
Hi Andreas.
Good day.
Many thanks again.

Fraternally
Beling

On 05/02/2020 14:04, Andreas Gehrs-Pahl wrote:
> Carlos,
> 
>> I am using DbImport(...,cDbeForTheOriginalDBF) for to import data from
>> DBF opened using DBFCDX for another one opened using DBFCDX too.
>> In the original DBF I have 2 fields:
>> 1) one with fieldtype 'X'
>> 2) one with fieldtype 'C'
>> Both must to be imported for the same names with field type 'X'
> 
> The DBFDBE doesn't support the Field Type "X", so you need to use the FOXDBE
> to open both (the source and the target) tables.
> 
>> The trouble is that the original field type 'C' is not converted for
>> field type 'X' in the output DBF.
>> Can someone tell me why the conversion does not occurs?
> 
> You do have the source code for the DbImport() function here:
> 
> 	...\Source\Runtime\Sys\DbBulk.prg
> 
> so you can modify or adapt it to do any data-type conversions that you
> require, or you could simply debug it, but using the correct DBE should
> actually be enough in this particular case.
> 
> Hope that helps,
> 
> Andreas
>