473,804 Members | 4,518 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

question on embedding literals in load statements

Ken
Is there any way that a literal can be used for a field value in the
load statement?

The context is fixed-length record formats, db2 8.1 ese, aix 5.1. I'm
performing warehouse and mart loads within korn shell and python - and
everything's been working great - but now I want to add a batch
identifier to all the rows in each load. This identifier is
incremented for each load, but every row in a load file gets the same
value.

Right now the load process is generating a new copy of the data file
with an embedded batch_id prior to the actual db2 load. The problem
is speed and complexity - I'd rather not modify data files in the load
process. Since my extract, transform, and load processes are
completely independent it isn't practical to do this earlier in the
dataflow.

Any suggestions? Have I hopefully missed something?

Thanks in advance,

Ken
Nov 12 '05 #1
1 1670
"Ken" <ke******@yahoo .com> wrote in message
news:ea******** *************** **@posting.goog le.com...
Is there any way that a literal can be used for a field value in the
load statement?
No
The context is fixed-length record formats, db2 8.1 ese, aix 5.1. I'm
performing warehouse and mart loads within korn shell and python - and
everything's been working great - but now I want to add a batch
identifier to all the rows in each load. This identifier is
incremented for each load, but every row in a load file gets the same
value.


However a hack does spring to mind.

create table load(.. your cols ...
, batch_id integer generated always as identity
(start with 1 maxvalue 1 minvalue 1 cycle no order)
)

then between each run, do this

alter table load alter column batch_id
restart with X set maxvalue X set minvalue X

where X is your new batch_id.
I've not tried the above myself, so it might mess up LOAD performance, but
I'd be interested to know.

The other option would be to load into a separate table for each batch, then
us a UNION ALL view to tie them together with an extra column identifying
the batch.

Regards
Paul Vernon
Business Intelligence, IBM Global Services
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2791
by: Alicia Haumann | last post by:
I accidentally sent this to webmaster@python.org, so this could be a duplicate if "webmaster" forwards it to this list. :{ Hi, there. Thanks for any help that can be offered. I've been working with Python for a year or more now, but only doing simple extending in C/C++. I'm now attempting some embedding and several questions have come to mind. BTW - I'm running Windows 2000 with Python23 and VisualC++ developers
0
1235
by: smilechaser | last post by:
Hi All, A question about embedding: If I take the example code on embedding (Section 5.3 of Extending and Embedding the Python Interpreter 2.4) and add the lines: PyRun_SimpleString("import sys"); PyRun_SimpleString("print globals()");
5
611
by: Victor Fees | last post by:
I have an XML string in a database that I would like to display using XSLT. All of that works like a champ, but I can't figure out how to embed the XML inside an ASPX page. For example, I have an ASPX page with a Header User Control and a Footer User Control. I'd like to put the transformed XML right in the middle. It seems like this is something that should be doable, but I can't quite figure it out. Is anyone out there doing this,...
3
2571
by: Paul Flew | last post by:
Hi I'm sure this is a very simple question, but can someone tell me whether the following is a well-formed XML document (not withstanding the lack of DTD): <document>Some text <documentcomponent>Component Part</documentcomponent> some more text </document> i.e. Embedding a tag within the contents of another tag (a la HTML)?
15
417
by: Alex | last post by:
could somebody tell me the difference between those two styles: function abc(var1, var2){ /* logic in here */ } and abc = function(var1, var2){ /* logic in here */ }; When / why would I use one over the other?
0
1118
by: Ken | last post by:
> Paul Vernon (paul.vernon@ukk.ibmm.comm) wrote: > However a hack does spring to mind. <snip> > alter table load alter column batch_id > restart with X set maxvalue X set minvalue X > where X is your new batch_id. Thanks for the tip - hadn't thought about that. However, I discovered the true culprit - the incorrect python write class was being used
4
1833
by: Mok-Kong Shen | last post by:
Apology, if this is OT. (Please kindly refer me eventually to another group.) With VC++ I can embed asm statements in a function e.g. as follows: __asm { ........ je lab
9
2430
by: niclane | last post by:
Hi, I was reading section 5.5 of Ritchie and Kernighan and saw the following: " ..... char amessage = "now is the time"; char *pmessage = "now is the time";
5
2328
by: Romano Giannetti | last post by:
Hi, while writing some LaTeX preprocessing code, I stumbled into this problem: (I have a -*- coding: utf-8 -*- line, obviously) s = ur"añado $\uparrow$" Which gave an error because the \u escape is interpreted in raw unicode strings, too. So I found that the only way to solve this is to write:
0
9579
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,...
0
10577
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, 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...
0
10332
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10320
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10077
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9150
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, 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...
1
7620
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
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();...
0
5521
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 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.