From derby-dev-return-97707-apmail-db-derby-dev-archive=db.apache.org@db.apache.org Thu Sep 6 18:17:05 2012
Return-Path:
X-Original-To: apmail-db-derby-dev-archive@www.apache.org
Delivered-To: apmail-db-derby-dev-archive@www.apache.org
Received: from mail.apache.org (hermes.apache.org [140.211.11.3])
by minotaur.apache.org (Postfix) with SMTP id AFDF89157
for ; Thu, 6 Sep 2012 18:17:05 +0000 (UTC)
Received: (qmail 65203 invoked by uid 500); 6 Sep 2012 18:17:05 -0000
Delivered-To: apmail-db-derby-dev-archive@db.apache.org
Received: (qmail 65183 invoked by uid 500); 6 Sep 2012 18:17:05 -0000
Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm
Precedence: bulk
List-Help:
List-Unsubscribe:
List-Post:
List-Id:
Reply-To:
Delivered-To: mailing list derby-dev@db.apache.org
Received: (qmail 65175 invoked by uid 99); 6 Sep 2012 18:17:05 -0000
Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230)
by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2012 18:17:05 +0000
X-ASF-Spam-Status: No, hits=-5.0 required=5.0
tests=RCVD_IN_DNSWL_HI,SPF_PASS,UNPARSEABLE_RELAY
X-Spam-Check-By: apache.org
Received-SPF: pass (nike.apache.org: domain of rick.hillegas@oracle.com designates 141.146.126.227 as permitted sender)
Received: from [141.146.126.227] (HELO acsinet15.oracle.com) (141.146.126.227)
by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2012 18:16:54 +0000
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q86IGVcZ023559
(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
for ; Thu, 6 Sep 2012 18:16:32 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q86IGU2D017647
(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
for ; Thu, 6 Sep 2012 18:16:31 GMT
Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70])
by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q86IGS5O017428
for ; Thu, 6 Sep 2012 13:16:30 -0500
Received: from dhcp-amer-vpn-rmdc-anyconnect-10-159-88-86.vpn.oracle.com (/10.159.88.86)
by default (Oracle Beehive Gateway v4.0)
with ESMTP ; Thu, 06 Sep 2012 11:16:28 -0700
Message-ID: <5048E869.4050903@oracle.com>
Date: Thu, 06 Sep 2012 14:16:09 -0400
From: Rick Hillegas
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.7; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11
MIME-Version: 1.0
To: derby-dev@db.apache.org
Subject: Re: Derby Key Words
References: <503EA7DA.8080804@gmail.com> <503F625B.7050009@oracle.com> <503F8E07.1020600@oracle.com> <5040B576.8040105@oracle.com> <50466AA7.2070309@gmail.com> <5046BC92.8010003@gmail.com> <5046D439.3030305@sbcglobal.net> <5047C42F.4060703@oracle.com> <50481D6D.8050901@gmail.com>
In-Reply-To: <50481D6D.8050901@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Source-IP: ucsinet21.oracle.com [156.151.31.93]
Hi David,
Some comments inline...
...
> re your comment of String constants in an array. I found the same
> thing in the interface.
>
> It has just occured to me that, as we use a database, maybe a
> resultSet may be the thing to return , I've come full circle to
> understanding your original idea of a 'Table Function'. But I would
> still think that a function in DatabaseMetaData would be good.
>
> Along these lines... it should take a String argument that is the word
> being tested, and return true [word is in list] or false [word is not
> in the list]. I propose to call the method prototype to be something
> like getAllDerbyKeyWords(String wordToTest) . Hopefully as it has the
> word 'Derby' in it the SQL people are unlikely to ever use is in the
> standard! Although maybe there would be an argument to propose a new
> method of getAllKeywords() to the standard, that each driver vendor
> could implement and would have the same / similar functionality -
> delusions of grandeur ;)
The presence of Derby in the function name sounds good to me. I agree
that that should prevent the JDBC spec from encroaching on this
function. I'm afraid I don't understand the usefulness of the String
argument. Having a no-arg function which returns all of the words sounds
good enough to me. The restriction to a single string can be
accomplished by this query against the resulting table function:
select keyword from table( getAllDerbyKeyWords() ) t where t.keyword =
'wordToTest'
>
> But how to turn that String Array into a Table is fairly simple (I'd
> declare a temp table), and then make a select on it to get a
> resultSet. However is there a way to skip the table step and jump
> straight to a result set (its a bit of a leading question, and I
> haven't searched for an answer anywhere yet, so unless you know off
> the top of your head no need to answer straight away).
The table function can just be an extension of
org.apache.derby.vti.StringColumnVTI. All you have to implement are 3
methods: next(), close(), and getRawColumn().
Hope this helps,
-Rick
>
> David
>