Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!drn.maxwell.syr.edu!news.maxwell.syr.edu!news.glorb.com!cox.net!news-xfer.cox.net!p01!fed1read03.POSTED!53ab2750!not-for-mail
From: "Andreas Sheriff" <spamcontrol@iion.com>
Newsgroups: comp.databases.oracle.server
References: <1123538692.759012.272710@f14g2000cwb.googlegroups.com> <1123539535.036966.307850@z14g2000cwz.googlegroups.com>
Subject: Re: Tricky SQL even possible?
Lines: 56
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Original
Message-ID: <%YRJe.34428$bp.16439@fed1read03>
Date: Mon, 8 Aug 2005 16:32:23 -0700
NNTP-Posting-Host: 68.7.15.42
X-Complaints-To: abuse@cox.net
X-Trace: fed1read03 1123543995 68.7.15.42 (Mon, 08 Aug 2005 19:33:15 EDT)
NNTP-Posting-Date: Mon, 08 Aug 2005 19:33:15 EDT
Organization: Cox Communications
Xref: dp-news.maxwell.syr.edu comp.databases.oracle.server:249143

<michaeljc70@hotmail.com> wrote in message 
news:1123539535.036966.307850@z14g2000cwz.googlegroups.com...
> BTW, I need  a select. I know I could create a procedure or function to
> do this.
>

Here's a hack for you:

Create a table and populate it with an arbitrary number of rows; say:

CREATE TABLE arb ( arbnum NUMBER);

DECLARE
v_count NUMBER;
BEGIN
for v_count in 1..500 loop
insert into arb (arbnum) values(v_count);
end loop;
END;
/

and try a query like this:

VARIABLE mystr VARCHAR2(400)
exec :mystr := 'This is my string';

select arbnum from arb where arbnum <= ceil(length(:mystr) / 5);

And you get as a result:

    ARBNUM
----------
         1
         2
         3
         4


May I ask for what function you'd need such a query?

-- 
Andreas
Oracle 9i Certified Professional
Oracle 10g Certified Professional
Oracle 9i Certified PL/SQL Developer


"If you don't eat your meat, you cannot have any pudding.
"How can you have any pudding if you don't eat your meat?!?!"
---

WARNING:
DO NOT REPLY TO THIS EMAIL
Reply to me only on this newsgroup 


