Unix Technical Forum

SQL0270N How to create Java UDF with SQL?

This is a discussion on SQL0270N How to create Java UDF with SQL? within the DB2 forums, part of the Database Server Software category; --> I had just recently installed a new database with partitions. I realized that all of my previous Java UDFs ...


Go Back   Unix Technical Forum > Database Server Software > DB2

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 03:51 AM
jorge
 
Posts: n/a
Default SQL0270N How to create Java UDF with SQL?


I had just recently installed a new database with partitions.
I realized that all of my previous Java UDFs failed to
install on the new database.

Basically, I got SQL0270N with Reason code 59.

I read up on the documentation, and found out that I can't
have SQL in my Java UDFs and Stored procedures anymore? Is
that really true?!?

If so, is there any way of getting around it? My company
has invested a lot of effort into writing this UDFs. It's a
bummer to find out that they won't work anymore..

Any help would be greatly appreciated.

Thanks,
Jorge jkpchang@ingrian.com

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 03:51 AM
Serge Rielau
 
Posts: n/a
Default Re: SQL0270N How to create Java UDF with SQL?

jorge wrote:
> I had just recently installed a new database with partitions.
> I realized that all of my previous Java UDFs failed to
> install on the new database.
>
> Basically, I got SQL0270N with Reason code 59.
>
> I read up on the documentation, and found out that I can't
> have SQL in my Java UDFs and Stored procedures anymore? Is
> that really true?!?
>
> If so, is there any way of getting around it? My company
> has invested a lot of effort into writing this UDFs. It's a
> bummer to find out that they won't work anymore..
>
> Any help would be greatly appreciated.
>
> Thanks,
> Jorge jkpchang@ingrian.com
>

There is no limitation on stored procedures.
In DPF CALL and SQL inside external UDF is restricted.
You may be able to use SQL UDF, but in DPF I'd go light on thsoe
fellows. Procedural flow and DPF are no friends
(just having RETURN is OK. It's BEGIN ATOMIC ... END that gets cumbersome.)
What are these UDF doing?

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 03:51 AM
jorge
 
Posts: n/a
Default Re: SQL0270N How to create Java UDF with SQL?


Thnaks Serge, for the valuable information.

The external UDF that we have is actually very simple. We have a table
that contains login information to a network appliance. This external
UDF
(written in Java) would first run a SELECT on the login table to
extract
login information. Using this information, it will then connect to the
network appliance and execute some requests. It also performs some
caching of the login information too, so subsequent execution of the
UDF wouldn't have to run the select.

So seems like we have to re-write some of the code. Any idea on how
best we can approach this? Keep in mind that we are just doing one
select; no update no insert..

Any suggestions would be greatly appreciated.

Thanks,
Jorge

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-27-2008, 03:51 AM
Serge Rielau
 
Posts: n/a
Default Re: SQL0270N How to create Java UDF with SQL?

jorge wrote:
> Thnaks Serge, for the valuable information.
>
> The external UDF that we have is actually very simple. We have a table
> that contains login information to a network appliance. This external
> UDF
> (written in Java) would first run a SELECT on the login table to
> extract
> login information. Using this information, it will then connect to the
> network appliance and execute some requests. It also performs some
> caching of the login information too, so subsequent execution of the
> UDF wouldn't have to run the select.
>
> So seems like we have to re-write some of the code. Any idea on how
> best we can approach this? Keep in mind that we are just doing one
> select; no update no insert..
>
> Any suggestions would be greatly appreciated.
>
> Thanks,
> Jorge
>

CREATE FUCNTION outerfoo(blah1, .. blahn) RETURNS blurb
RETURN innerfoo((SELECT .....blah1.), blah2, ...blahn)

or RETURN SELECT innerfoo() FROM ..., (SELECT ....)

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-27-2008, 03:51 AM
jorge
 
Posts: n/a
Default Re: SQL0270N How to create Java UDF with SQL?


Serge,

Thanks a lot for the quick response. That's a great idea.. Just
curious.
We are a 3rd party database application vendor.. I am wondering what
percentage of the DB2 customer uses the DPF feature? I guess you
can't really give me a definitive answer, but from answering questions
on a forum like this, would you say it's 50% or 5%?

I need to decide how quickly I need to move forward on this
migration.

Thanks again.
Jorge

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-27-2008, 03:52 AM
Serge Rielau
 
Posts: n/a
Default Re: SQL0270N How to create Java UDF with SQL?

jorge wrote:
> Serge,
>
> Thanks a lot for the quick response. That's a great idea.. Just
> curious.
> We are a 3rd party database application vendor.. I am wondering what
> percentage of the DB2 customer uses the DPF feature? I guess you
> can't really give me a definitive answer, but from answering questions
> on a forum like this, would you say it's 50% or 5%?
>
> I need to decide how quickly I need to move forward on this
> migration.
>
> Thanks again.
> Jorge
>

DPB is a feature aimed at BI, not OLTP.
And DPF makes more sense as you approach the TB range.
Because of that there is a quite natural cap.
In terms of number of installations we are talking a small number
compared to the total. In terms of money for IBM its a significant number.

So, take a look at your app and your target audience.

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:16 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com