473,401 Members | 2,139 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,401 software developers and data experts.

Bitwise functions available

Hi folks,

I had some fun writing the following C-UDF over the weekend:
BIT_AND(Bigint, Bigint)->Bigint,
BIT_OR(Bigint, Bigint)->Bigint,
BIT_XOR(Bigint, Bigint)->Bigint),
BIT_NOT(Bigint)->Bigint
BIT_SHIFT_LEFT(Bigint, Smallint)->Bigint
BIT_SHIFT_RIGHT(Bigint, Smallint)->Bigint,
BIT_TEST(BIGINT, SMALLINT)->SMALLINT
BIT_SET(BIGINT, SMALLINT)->BIGINT)
BIT_CLEAR(BIGINT, SMALLINT)->BIGINT
HEX2NUM(VARCHAR(16))->BIGINT
NUM2HEX(BIGINT)->VARCHAR(16)

I'll try to find an open-source home for them, in the meantime if
someone wants them please send me an email (sr*****@ca.ibm.com).
Also I'd like to know what others have written and would be willing to
open-source and what is out there for demand to be provided.

DISCLAIMER:
Neither IBM nor I provide any warranty. The UDF have been spot tested only.

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

Nov 12 '05 #1
2 1941
Ian
Serge Rielau wrote:
Hi folks,

I had some fun writing the following C-UDF over the weekend:
BIT_AND(Bigint, Bigint)->Bigint,
BIT_OR(Bigint, Bigint)->Bigint,
BIT_XOR(Bigint, Bigint)->Bigint),
BIT_NOT(Bigint)->Bigint
BIT_SHIFT_LEFT(Bigint, Smallint)->Bigint
BIT_SHIFT_RIGHT(Bigint, Smallint)->Bigint,
BIT_TEST(BIGINT, SMALLINT)->SMALLINT
BIT_SET(BIGINT, SMALLINT)->BIGINT)
BIT_CLEAR(BIGINT, SMALLINT)->BIGINT
HEX2NUM(VARCHAR(16))->BIGINT
NUM2HEX(BIGINT)->VARCHAR(16)


Serge,

You might want to don your asbestos suit in preparation for
the smack-down from Joe Celko re: bitwise functions. :-)

We could start a db2-udf project on Sourceforge, that might
be a good home.
Good luck,
Ian

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Nov 12 '05 #2
I rarely tread the dungeons of SQL-92.
So I can live with Joe's wrath.

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

Nov 12 '05 #3

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

Similar topics

0
by: Ricky Romaya | last post by:
Hi, I'm using PHP 4.2.6 on win2k and wants to use ctype family functions. To my surprise, PHP whines that it's not recognized. IINM the manual says that builtin supports for these functions are...
1
by: Socrates | last post by:
Hello, I have a problem building and using an activeX dll. I would appreciate it if anyone could help: I have written some complex functions. I have a complex type with .real and ..imag part as...
11
by: Bryant Huang | last post by:
Hello! I would like to read in files, during run-time, which contain plain Python function definitions, and then call those functions by their string name. In other words, I'd like to read in...
4
by: Joshua Emele | last post by:
Hello - I am new to c# having come from the land of c. With c, I could create a .def file: library cdll exports foo @1 bar @2
8
by: Konstantin Andreev | last post by:
Hello, Serge. A while ago SR> Subject: Re: poor query performance SR> Date: Thu, 08 Sep 2005 06:31:52 -0400 SR> Message-ID: <3oaiamF50mntU1@individual.net> you have posted here your...
4
by: mecej4 | last post by:
DB2 Express C (Fixpack 10, WR21362_15462) seems to be lacking some of the OLAP functions available in other editions, such as ROW_NUMBER, RANK and DENSE_RANK, but does provide sum(..) over...
3
by: Ajith Menon | last post by:
Do any body know how to use the functions available in the MATLAB using C#? ( To be specific, functions COHERE used to find Coherence and TFE to calculate Transfer function are needed. These...
12
by: Angus | last post by:
Hello I have a web page which uses a js file on the server. I cannot see all the javascript functions available to me in the html. I would like to have a function which could print eg to a DIV...
0
NeoPa
by: NeoPa | last post by:
Many of us have noticed that there are some very useful functions available to you when using Excel, but these same functions are not available, as standard, in Access. A particular issue I had...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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...

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.