473,379 Members | 1,367 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

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 1622
"Ken" <ke******@yahoo.com> wrote in message
news:ea*************************@posting.google.co m...
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
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...
0
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...
5
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...
3
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...
15
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...
0
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...
4
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
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
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.