Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old June 30th, 2007, 04:15 AM
chandra.krothapalli@gmail.com
Guest
 
Posts: n/a
Default 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

  #2  
Old July 4th, 2007, 10:45 AM
Bernard Dhooghe
Guest
 
Posts: n/a
Default Re: db2ReadLog, Variable format data

On Jun 30, 5:07 am, chandra.krothapa...@gmail.com wrote:
Quote:
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

  #3  
Old July 4th, 2007, 04:05 PM
chandra.krothapalli@gmail.com
Guest
 
Posts: n/a
Default Re: db2ReadLog, Variable format data

On Jul 4, 5:38 am, Bernard Dhooghe <dhoog...@yahoo.comwrote:
Quote:
On Jun 30, 5:07 am, chandra.krothapa...@gmail.com wrote:
>
>
>
Quote:
Hi,
>
Quote:
I am writing a program to read database logs using db2Readlog/
db2ReadLogNoConn API.
>
Quote:
I am able to parse the data of "FIXED format data" and link them to
appropriate columns for a given UPDATE/INSERT/DELETE.
>
Quote:
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.
>
Quote:
Could some one please tell me how can I parse "Variable format data"
and link them to appropriate fields.
>
Quote:
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





  #4  
Old July 6th, 2007, 12:15 AM
Bernard Dhooghe
Guest
 
Posts: n/a
Default Re: db2ReadLog, Variable format data

On Jul 4, 4:59 pm, chandra.krothapa...@gmail.com wrote:
Quote:
On Jul 4, 5:38 am, Bernard Dhooghe <dhoog...@yahoo.comwrote:
>
>
>
>
>
Quote:
On Jun 30, 5:07 am, chandra.krothapa...@gmail.com wrote:
>
Quote:
Quote:
Hi,
>
Quote:
Quote:
I am writing a program to read database logs using db2Readlog/
db2ReadLogNoConn API.
>
Quote:
Quote:
I am able to parse the data of "FIXED format data" and link them to
appropriate columns for a given UPDATE/INSERT/DELETE.
>
Quote:
Quote:
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.
>
Quote:
Quote:
Could some one please tell me how can I parse "Variable format data"
and link them to appropriate fields.
>
Quote:
Quote:
Thanks
Chandra
>
Quote:
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
>
Quote:
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

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles