Unix Technical Forum

ELF function ?

This is a discussion on ELF function ? within the DB2 forums, part of the Database Server Software category; --> Hi, my application uses the ELF function of MySql. How can I use that in DB2? Zsolt...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-26-2008, 04:37 PM
Zsolt Koppany
 
Posts: n/a
Default ELF function ?

Hi,

my application uses the ELF function of MySql. How can I use that in DB2?

Zsolt


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-26-2008, 04:37 PM
Mark A
 
Posts: n/a
Default Re: ELF function ?

"Zsolt Koppany" <zkoppanylist@intland.com> wrote in message
news:bm5fie$hs4$01$1@news.t-online.com...
> Hi,
>
> my application uses the ELF function of MySql. How can I use that in DB2?
>
> Zsolt
>

For those who don't know what ELF is, maybe you can explain it and then
someone can figure out how to do that in DB2.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-26-2008, 04:38 PM
Larry Edelstein
 
Posts: n/a
Default Re: ELF function ?

What's "ELF"?


Zsolt Koppany wrote:

> Hi,
>
> my application uses the ELF function of MySql. How can I use that in DB2?
>
> Zsolt


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-26-2008, 04:38 PM
Zsolt Koppany
 
Posts: n/a
Default Re: ELF function ?

Sorry,

I mistyped it, it is ELT.

Zsolt


"Larry Edelstein" <nospam@nospam.com> schrieb im Newsbeitrag
news:3F86A532.526DC9C0@nospam.com...
> What's "ELF"?
>
>
> Zsolt Koppany wrote:
>
> > Hi,
> >
> > my application uses the ELF function of MySql. How can I use that in

DB2?
> >
> > Zsolt

>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-26-2008, 04:38 PM
Knut Stolze
 
Posts: n/a
Default Re: ELF function ?

Zsolt Koppany <zkoppanylist@intland.com> wrote:

> Sorry,
>
> I mistyped it, it is ELT.


From what I gather in the MySQL documentation, a simple CASE expression will
do the job. Here is what I found:

ELT(N,str1,str2,str3,...)
Returns str1 if N = 1, str2 if N = 2, and so on. Returns NULL if N is less
than 1 or greater than the number of arguments. ELT() is the complement of
FIELD():
mysql> SELECT ELT(1, 'ej', 'Heja', 'hej', 'foo');
-> 'ej'
mysql> SELECT ELT(4, 'ej', 'Heja', 'hej', 'foo');
-> 'foo'


I would implement this in DB2 (and standard SQL) like this:

CASE n
WHEN 1 THEN str1
WHEN 2 THEN str2
WHEN 3 THEN str3
ELSE NULL
END

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
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 10:05 AM.


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