Given I have binary input which is to be stored in one table, and it
may consist of any size -- ie, VARCHAR(n) FOR BIT DATA, WHERE THE n is
less than 32K, or the n is bigger such that it is a BLOB ...
Given that I have a LOB table too, named LOBTABLE,
Is there any problem with,
CREATE TABLE(
ID INTEGER NOT NULL,
DATA VARCHAR(31k) FOR BIT DATA,
LOB ADDRESS,
.....
LOB IN LOBTABLE
.....
Would there be a problem in storing either or both data types,
retrieving them, sorting them, etc. 4 1912
Stanley Sinclair wrote: Given I have binary input which is to be stored in one table, and it may consist of any size -- ie, VARCHAR(n) FOR BIT DATA, WHERE THE n is less than 32K, or the n is bigger such that it is a BLOB ...
Given that I have a LOB table too, named LOBTABLE,
Is there any problem with,
CREATE TABLE( ID INTEGER NOT NULL, DATA VARCHAR(31k) FOR BIT DATA, LOB ADDRESS, .... LOB IN LOBTABLE ....
Would there be a problem in storing either or both data types, retrieving them, sorting them, etc.
This is a popular choice. You can also use COALESCE(DATA, LOB) (maybe in
a view) to make it transparent.
Note: No sorting LOBs, no comparison functions for these puppies
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Thanks, this looks good, but . . .
I'm worried about that COALESCE. To remind: this is a case where a
row will contain either a VARCHAR or a BLOB. Using a view with
COALESCE(VARCHA R, BLOB) . . . will a BLOB be searched for even if there
is a null BLOB address in the base table?
SS 28******@gmail. com wrote: Thanks, this looks good, but . . .
I'm worried about that COALESCE. To remind: this is a case where a row will contain either a VARCHAR or a BLOB. Using a view with COALESCE(VARCHA R, BLOB) . . . will a BLOB be searched for even if there is a null BLOB address in the base table?
I'm not 100% sure, but I think it will be read from disk, just consider this
example:
$ db2 "values coalesce(1, 1 / 0)"
SQL0801N Division by zero was attempted. SQLSTATE=22012
So you could change the coalesce to:
SELECT <varchar>
FROM <table>
WHERE <varchar> IS NOT NULL
UNION ALL
SELECT <blob>
FROM <table>
WHERE <varchar> IS NULL
The question is, however, how to align the data types. But you also have
the same issue with the VARCHAR and the BLOB in the COALESCE.
--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Knut Stolze wrote: 28******@gmail. com wrote:
Thanks, this looks good, but . . .
I'm worried about that COALESCE. To remind: this is a case where a row will contain either a VARCHAR or a BLOB. Using a view with COALESCE(VARC HAR, BLOB) . . . will a BLOB be searched for even if there is a null BLOB address in the base table?
I'm not 100% sure, but I think it will be read from disk, just consider this example:
$ db2 "values coalesce(1, 1 / 0)" SQL0801N Division by zero was attempted. SQLSTATE=22012
So you could change the coalesce to:
SELECT <varchar> FROM <table> WHERE <varchar> IS NOT NULL UNION ALL SELECT <blob> FROM <table> WHERE <varchar> IS NULL
The question is, however, how to align the data types. But you also have the same issue with the VARCHAR and the BLOB in the COALESCE.
Also keep in mind that NULL is stored in the row.
The LOB content is stored doutside of the row.
A NULL LOB doesn't even have a pointer to the out-of row space, so it
simply CANNOT be more expensive than going to teh row.
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Janne Ruuttunen |
last post by:
Hello DB2 people,
I'm having problems exporting >= 250000 lobs to IXF files with the
LOBSINFILE option, using a legacy DB2 2.1 system on Win NT.
If I don't specify a path for the lobs, defining more than 250 base
names for the lobs leads to an error message something like "DB2
encountered an unexpected error when sending the query to the backend
process" (I don't have the exact message at hand). It doesn't matter
how short the base...
|
by: Remove the obvious for replies |
last post by:
Recently I have converted from UDB 7.2 (NT) to UDB 8.1.4 (W2K) and
have noticed a critical error W.R.T. our VB/ADO apps.
If I use the 7.2 client, then everything (except calls to federated
views) works great. If I use the 8.1.4 client, then I cannot send a
null or blank date back to the database (invalid format). I also
cannot null out the value of a field that has contraints on it
because the null get converted to an empty string...
|
by: Rom Marshall |
last post by:
Hi.
Once a LOB size goes beyond 32KB in size, I'm not able to use the LOAD
utility to unload the data off the tables for DB2 7.1 on OS/390.
Instead, the documentation refers to a sample C++ program --
DSN710.SDSNSAMP(DSN8DLPL) to use for this purpose.
I'm wondering if anyone out there has a COBOL equivalent to this as I do
not have a C++ compiler?
|
by: Alex Greem |
last post by:
Dear all,
Our database (DB2 Workgroup 7.2 FP12) is constantly under heavy load.
Most time CPU usage (1 Pentium3 1Ghz) is more 50% busy.
We have 3GB RAM memory
Our normal workload is 200-300 dyn.sql/s.
The action question is there way to eliminate direct I/O?
By definition direct I/O is I/O that bypass bufferpools and used for
LONG VARCHAR and LOBs data.
|
by: stoat2337 |
last post by:
I'm looking to purge rows from a DB2 table that contains both a CLOB
(1M) and BLOB (51K), but our DBA is not familiar with LOBs. I work on a
mainframe (z/OS), and we don't normally use LOBs in our shop. These
LOBs were set up by a vendor. Our DBA mentioned that a simple DELETE
would not work, but he thought that a COBOL program could be written to
do the job. Any ideas?
| |
by: Louis LeBlanc |
last post by:
Hey folks. I'm new to the list, and not quite what you'd call a DB
Guru, so please be patient with me. I'm afraid the lead up here is a
bit verbose . . .
I am working on an application that uses very high volume DB
transactions - in the order of tens of millions per day . . .
Anyway, the current database which will remain nameless, but begins
with O and rymes with debacle (sorta), has a problem with high volume
work when it comes to...
|
by: Luc |
last post by:
I saw a few posts on this newsgroup about it but nothing to help me resolve
this problem:
We designed a window in .NET on a platform using small fonts (120 ppp). But
this window will run on servers configured with large fonts. For a reason I
cant explain, not only the font changes when settings the window on large
font but all the widgets seem to be resized. This is kind of problematic
because I have to redraw (resize) all the widgets...
|
by: =?Utf-8?B?VzFsZDBuZTc0?= |
last post by:
When one architects a new project one of the first steps in the decision is
to decide on the layers. (In my opinion anyway)
One architecture that I have used before is to go solid OO and create
objects, which normally are very small and only deals with the stuff
pertaining to that object, then break it down into Business Process, Process
Controllers and Data Access Objects for each "Object", each of which is
created in it's very own .Net...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |