PxPlus User Forum

Main Board => Discussions => ODBC => Topic started by: Jeffrey Ferreira on August 27, 2024, 02:56:12 PM

Title: ODBC ini file config
Post by: Jeffrey Ferreira on August 27, 2024, 02:56:12 PM
I'm struggling with something that works but I don't understand why?

[*tables*]
Unit_Completion=p:\custom_data\CFUNIT
[Unit_Completion]
ORDER_NUMBER=STRING,LEN=9,FIELD=1,OFFSET=6
UTC_MTIME=STRING,LEN=10,FIELD=2,OFFSET=0

Can someone tell me what ORDER_NUMBER=STRING,LEN=9,FIELD=1,OFFSET=6 what this is doing?
it does what i want but intuitively i feel like it should not be working.
Title: Re: ODBC ini file config
Post by: Jeffrey Ferreira on August 29, 2024, 01:53:14 PM
I would consider Offset to be where we start in string like in a mid function
let if string is
JEFFREY-JONES
Offset = 4
Length = 3
and i say offset is 4 (assuming 0 based then) i would expect it to return
"REY"
where the "R" is in the 4th position (0 based) and then go over 3 characters...
is that what the Offset is?
Title: Re: ODBC ini file config
Post by: Devon Austen on August 29, 2024, 02:14:57 PM
Yes it is the offset in the field.

Based on that ini setting it seems that the ODBC will ignore the data in the file for the first 5 characters and then treat the next 9 as the field.
Title: Re: ODBC ini file config
Post by: Jeffrey Ferreira on August 29, 2024, 03:19:56 PM
thank you Deven - so it doesn't seem to be working for me.
i'll try again ...thank you.
Title: Re: ODBC ini file config
Post by: Jeffrey Ferreira on August 29, 2024, 03:53:53 PM
Hi Deven, my field contains hexadecimal characters and i think that is causing problem.  than you for clarifying for me.