"dharmadam" <dh***********@hotmail.com> wrote in message
news:df**************************@posting.google.c om...
Sorry that I failed to mention the machine and DB2 version.
Don't worry, a *lot* of people forget to give that information. Most DB2
questions are very hard to answer without that information because something
that is true for one OS or version is sometimes not true for a different OS
or version.
The machine is IBM P650 running Unix, the DB is DB2 V8 FP6. I might use
JAVA. Is the table function available in IBM DB2 Stored Procedures?
I just read your original question again but I'm still confused about what
you're trying to do, particularly the role of the table function.
I have only written a very few table functions so I may be missing
something. However, it is my understanding that the primary role of a table
function is to get data that isn't in DB2 from an outside source like a flat
file so that DB2 can work with it. I don't think table functions were ever
intended to be used to *update* that external data. If you're planning to
update addresses outside of DB2 via a table function, I don't think it will
work. You can *get* the addresses from outside DB2 with the table function
but you can't *update* them that way.
On the other hand, if you are getting the new addresses from outside DB2 and
intend to update old addresses *that are in a DB2 table* with the external
data, it appears that this is possible. As far as I can tell from the SQL
Reference, you should have no problem in passing the parameters you
described in the original post to your table function. Again, you will
probably need to have some kind of SQL SELECT statement in the table
function logic to determine the name of the column whose number you pass to
the function. You should also have no problem updating the address or zip
code or whatever within your table function. You probably don't need a
stored procedure at all for what you are trying to do. [Please note that
this paragraph is just my best guess about what is possible, based on what I
found in the SQL Reference for table functions. I may be misunderstanding
something in the manual and I could have missed a footnote that would
contradict something I've said. Unfortunately, I don't have V8 myself so I
can't tell you with 100% certainty that what you want to do is possible. If
I had V8, I'd probably try a simple prototype to be absolutely sure that it
would work.]
In answer to your question in *this*post, I'm really not sure if a table
function can appear within a stored procedure. I've never tried that myself.
Honestly, I'd be a little surprised if you could put a table function in a
stored procedure since they have different purposes but that is just a
guess; I've been wrong before ;-)
If I've misunderstood what you are trying to do, please explain in more
detail and perhaps I, or someone else who reads this newsgroup, can help
more.
Rhino