468,257 Members | 1,481 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,257 developers. It's quick & easy.

db2ReadLog, Variable format data

Hi,

I am writing a program to read database logs using db2Readlog/
db2ReadLogNoConn API.

I am able to parse the data of "FIXED format data" and link them to
appropriate columns for a given UPDATE/INSERT/DELETE.

I am having difficulty in parsing the "Variable format data". In the
log record I am not able find information about data length of each
column.

Could some one please tell me how can I parse "Variable format data"
and link them to appropriate fields.
Thanks
Chandra

Jun 30 '07 #1
3 3743
On Jun 30, 5:07 am, chandra.krothapa...@gmail.com wrote:
Hi,

I am writing a program to read database logs using db2Readlog/
db2ReadLogNoConn API.

I am able to parse the data of "FIXED format data" and link them to
appropriate columns for a given UPDATE/INSERT/DELETE.

I am having difficulty in parsing the "Variable format data". In the
log record I am not able find information about data length of each
column.

Could some one please tell me how can I parse "Variable format data"
and link them to appropriate fields.

Thanks
Chandra
1. Fixed block contains the data for fixed length columns, for the
columns with variable length, instead of the content there is the
fixed
length data of 4 bytes (not null column) or 5 bytes (for null columns)
described as follows in the manual "All variable field types have a
4-byte fixed data portion in the fixed length section (plus a null
flag, if the column is nullable). The first 2 bytes (short) represent
the offset from the beginning of the fixed length section, where the
variable data is located. The next 2 bytes (short) specify the length
of the variable data referenced by the offset value." (page 523).
2. variable length block has the content of the variable length
columns

Bernard Dhooghe

Jul 4 '07 #2
On Jul 4, 5:38 am, Bernard Dhooghe <dhoog...@yahoo.comwrote:
On Jun 30, 5:07 am, chandra.krothapa...@gmail.com wrote:
Hi,
I am writing a program to read database logs using db2Readlog/
db2ReadLogNoConn API.
I am able to parse the data of "FIXED format data" and link them to
appropriate columns for a given UPDATE/INSERT/DELETE.
I am having difficulty in parsing the "Variable format data". In the
log record I am not able find information about data length of each
column.
Could some one please tell me how can I parse "Variable format data"
and link them to appropriate fields.
Thanks
Chandra

1. Fixed block contains the data for fixed length columns, for the
columns with variable length, instead of the content there is the
fixed
length data of 4 bytes (not null column) or 5 bytes (for null columns)
described as follows in the manual "All variable field types have a
4-byte fixed data portion in the fixed length section (plus a null
flag, if the column is nullable). The first 2 bytes (short) represent
the offset from the beginning of the fixed length section, where the
variable data is located. The next 2 bytes (short) specify the length
of the variable data referenced by the offset value." (page 523).
2. variable length block has the content of the variable length
columns

Bernard Dhooghe
Hi Bernard,

You are right "2 bytes" in to the "variable section" will give the
size of the variable section. But the variable section of the data may
be composed of multiple variable size columns. How can we parse this
data.

example: the variable section contain data "ChandraKrothapalli", but
this is from two columns FirstName varchar (30), LastName varchar(30).
How can we say "Chandra" is from "FirstName" and "Krothapalli" is from
"LastName" columns.
Chandra

Jul 4 '07 #3
On Jul 4, 4:59 pm, chandra.krothapa...@gmail.com wrote:
On Jul 4, 5:38 am, Bernard Dhooghe <dhoog...@yahoo.comwrote:


On Jun 30, 5:07 am, chandra.krothapa...@gmail.com wrote:
Hi,
I am writing a program to read database logs using db2Readlog/
db2ReadLogNoConn API.
I am able to parse the data of "FIXED format data" and link them to
appropriate columns for a given UPDATE/INSERT/DELETE.
I am having difficulty in parsing the "Variable format data". In the
log record I am not able find information about data length of each
column.
Could some one please tell me how can I parse "Variable format data"
and link them to appropriate fields.
Thanks
Chandra
1. Fixed block contains the data for fixed length columns, for the
columns with variable length, instead of the content there is the
fixed
length data of 4 bytes (not null column) or 5 bytes (for null columns)
described as follows in the manual "All variable field types have a
4-byte fixed data portion in the fixed length section (plus a null
flag, if the column is nullable). The first 2 bytes (short) represent
the offset from the beginning of the fixed length section, where the
variable data is located. The next 2 bytes (short) specify the length
of the variable data referenced by the offset value." (page 523).
2. variable length block has the content of the variable length
columns
Bernard Dhooghe

Hi Bernard,

You are right "2 bytes" in to the "variable section" will give the
size of the variable section. But the variable section of the data may
be composed of multiple variable size columns. How can we parse this
data.

example: the variable section contain data "ChandraKrothapalli", but
this is from two columns FirstName varchar (30), LastName varchar(30).
How can we say "Chandra" is from "FirstName" and "Krothapalli" is from
"LastName" columns.

Chandra- Hide quoted text -

- Show quoted text -

References (instead of data) for variable fields are in what is called
the fixed length section, the "first 2 bytes ..." allow to compute the
address where the data can be found; for the example given the first
description for a var data column will contain (first 2 bytes) the
address offset allowing to retrieve the data "Chandra" and the second
variable descriptor will contain the offset allowing to point to the
data "Krothapalli".

Bernard Dhooghe

Jul 5 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Luiz Antonio Gomes Pican?o | last post: by
19 posts views Thread by Skybuck Flying | last post: by
41 posts views Thread by Miguel Dias Moura | last post: by
3 posts views Thread by rls03 | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.