By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,756 Members | 1,749 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,756 IT Pros & Developers. It's quick & easy.

db2ReadLog, Variable format data

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.