November's PL/SQL Puzzler

From: Cam White <info_at_revealnet.com>
Date: 1997/11/12
Message-ID: <01bcef84$2b514840$1b73b1cd_at_Preveal2>#1/1


Solve the monthly PL/SQL Puzzler and your name will be entered into a drawing for a free technical book from O'Reilly & Associates. Full puzzle details and contest information is available at http://www.revealnet.com/plsql-pipeline/index.htm

A message from Steven Feuerstein:

Last month whole bunches of avid PL/SQL developers came up with implementations for an lstrip function, a variation of the built-in LTRIM. I was once again impressed by the energy and creativity of the solutions, as well as the analysis a number of you applied to optimize your implementation.

I have also received several solutions to the Expert Puzzle – a Best Fit algorithm – and I will soon find some time to review those entries and publish a solution for all to see. I will in the future post a deadline when new Expert Puzzles are posted. For now, the deadline for this first Expert Puzzle is November 30, 1997.

One other comment about the PL/SQL Puzzle: I am very interested in getting as many of you involved in the Pipeline as possible. I see this very much as an on-line community for all of us. So if any of you would like to help out, please get in touch with me at feuerstein_at_revealnet.com . I am looking for developers who would like to write a puzzle (and the corresponding solution!) for one of the months in 1998. I would love to hear other ideas for Expert Puzzles. We dearly would like to see more offerings of interesting programs and applets you have built that we can put on the Archives. Don't be bashful! Get in touch and we can discuss your involvement!

AND NOW FOR NOVEMBER'S PL/SQL PUZZLER:
(Full background info, tips & hints have been ommited from this posting. Please
visit the PL/SQL Pipeline http://www.revealnet.com/plsql-pipeline/index.htm for full details)

Implement an alternate indexing method for a PL/SQL table. Specifically, given this PL/SQL table:

CREATE OR REPLACE pstab_pkg
IS

   TYPE string_tabtype IS TABLE OF VARCHAR2(100) INDEX BY BINARY_INTEGER; END; Come up with a way that I can give you a string value and you tell me in which row I can find that string. I will even enhance the above package specification with the function header to obtain this result:

CREATE OR REPLACE pstab_pkg
IS

   TYPE string_tabtype IS TABLE OF VARCHAR2(100) INDEX BY BINARY_INTEGER;

   FUNCTION inrow (str IN VARCHAR2) RETURN BINARY_INTEGER; END; To solve the problem, you may well want to expand or otherwise modify this specification. And, of course, you should strongly consider building a package body!

Best wishes,

Cam White
RevealNet, Inc. Received on Wed Nov 12 1997 - 00:00:00 CET

Original text of this message