473,466 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 4041
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: jessie | last post by:
I use a chinese version of Windows XP. And excute a vb script code to get a date value from a Excel file. The data value is in English format in the Excel file. But I found the vb script converts...
14
by: Luiz Antonio Gomes Pican?o | last post by:
How i can store a variable length data in file ? I want to do it using pure C, without existing databases. I'm thinking to use pages to store data. Anyone has idea for the file format ? I...
19
by: Skybuck Flying | last post by:
Hi, I think I might have just invented the variable bit cpu :) It works simply like this: Each "data bit" has a "meta data bit". The meta data bit describes if the bit is the ending bit...
41
by: Miguel Dias Moura | last post by:
Hello, I am working on an ASP.NET / VB page and I created a variable "query": Sub Page_Load(sender As Object, e As System.EventArgs) Dim query as String = String.Empty ... query =...
20
by: MLH | last post by:
120 MyString = "How many copies of each letter do you need?" 150 MyVariant = InputBox(MyString, "How Many?", "3") If MyVariant = "2" Then MsgBox "MyVariant equals the string '2'" If...
8
by: Michael | last post by:
Hi, I think my problem deals with class casting and inheritance. I want to deal with various Audio Formats, reading into memory for modification, working with it (done by different classes),...
4
by: hph | last post by:
Okay, another trivial matter that I can't solve. I have a variable - $lastdate - that is the latest date any record in a MySQL database was updated. Its MySQL format is TIMESTAMP. If I say I...
3
by: rls03 | last post by:
I have the following which creates a variable containing a relative path where <xsl:value-of select="."/returns a portion of the filename: <xsl:variable...
14
ollyb303
by: ollyb303 | last post by:
Hi, I am trying to create a dynamic crosstab report which will display number of calls handled (I work for a call centre) per day grouped by supervisor. I have one crosstab query (Query1) which...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.