dbTalk Databases Forums  

PL/SQL Intervals are dizzy

comp.databases.oracle comp.databases.oracle


Discuss PL/SQL Intervals are dizzy in the comp.databases.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Danes
 
Posts: n/a

Default PL/SQL Intervals are dizzy - 08-25-2004 , 09:41 AM






Maybe I am just dizzy but I thought that 600 seconds is 10 minutes...
Obviously not! Or maybe PL/SQL is just dizzy.

SQL> declare
2 blah1 interval day to second := interval '600' second;
3 blah2 interval day to second := interval '10' minute;
4 begin
5 if blah1 <> blah2 then
6 dbms_output.put_line('plsql is shit');
7 else
8 dbms_output.put_line('maybe not');
9 end if;
10 end;
11 /
plsql is shit

PL/SQL procedure successfully completed.

SQL> declare
2 blah1 interval day to second := interval '601' second;
3 blah2 interval day to second := interval '10' minute;
4 begin
5 if blah1 < blah2 then
6 dbms_output.put_line('plsql is really shit');
7 else
8 dbms_output.put_line('maybe not');
9 end if;
10 end;
11 /
plsql is really shit

PL/SQL procedure successfully completed.

SQL>

Reply With Quote
  #2  
Old   
Frank van Bortel
 
Posts: n/a

Default Re: PL/SQL Intervals are dizzy - 08-25-2004 , 10:18 AM






Danes wrote:

Quote:
Maybe I am just dizzy but I thought that 600 seconds is 10 minutes...
Obviously not! Or maybe PL/SQL is just dizzy.

SQL> declare
2 blah1 interval day to second := interval '600' second;
3 blah2 interval day to second := interval '10' minute;
minute is not english, and therefore probably wrong syntax.
Now, who's shitty?
--

Regards,
Frank van Bortel



Reply With Quote
  #3  
Old   
Danes
 
Posts: n/a

Default Re: PL/SQL Intervals are dizzy - 08-26-2004 , 12:42 AM



Frank van Bortel <fvanbortel (AT) netscape (DOT) net> wrote

Quote:
Danes wrote:

Maybe I am just dizzy but I thought that 600 seconds is 10 minutes...
Obviously not! Or maybe PL/SQL is just dizzy.

SQL> declare
2 blah1 interval day to second := interval '600' second;
3 blah2 interval day to second := interval '10' minute;

minute is not english, and therefore probably wrong syntax.
Now, who's shitty?
Erm.... should I or should I not respond to the *very* clever
responce....

Or perhaps I should have not written the word shit. I now take the
word shit back and replace it with dizzy and hope blood does not boil
to the point of blindness and dizzyness

Chill! And sorry I called your baby shit

Actually I was hoping for a helpful answer telling me I was a bit
dizzy but if I get more of these types of answers I might even think I
am intellegent! Scary thought

For your information though Frank (maybe you can learn something too):

Minute \Mi*nute"\, a. [L. minutus, p. p. of minuere to lessen.
See Minish, Minor, and cf. Menu, Minuet.]
1. Very small; little; tiny; fine; slight; slender;
inconsiderable. ``Minute drops.'' --Milton.

2. Attentive to small things; paying attention to details;
critical; particular; precise; as, a minute observer;
minute observation.

Syn: Little; diminutive; fine; critical; exact;
circumstantial; particular; detailed.

Usage: Minute, Circumstantial, Particular. A
circumstantial account embraces all the leading
events; a particular account includes each event and
movement, though of but little importance; a minute
account goes further still, and omits nothing as to
person, time, place, adjuncts, etc.




Minute \Min"ute\, a.
Of or pertaining to a minute or minutes; occurring at or
marking successive minutes.

Minute bell, a bell tolled at intervals of a minute, as to
give notice of a death or a funeral.

Minute book, a book in which written minutes are entered.


Minute glass, a glass measuring a minute or minutes by the
running of sand.

Minute gun, a discharge of a cannon repeated every minute
as a sign of distress or mourning.

Minute hand, the long hand of a watch or clock, which makes
the circuit of the dial in an hour, and marks the minutes.




Minute \Min"ute\ (?; 277), n. [LL. minuta a small portion, small
coin, fr. L. minutus small: cf. F. minute. See 4th Minute.]
1. The sixtieth part of an hour; sixty seconds. (Abbrev. m.;
as, 4 h. 30 m.)

Four minutes, that is to say, minutes of an hour.
--Chaucer.

2. The sixtieth part of a degree; sixty seconds (Marked thus
('); as, 10[deg] 20').

3. A nautical or a geographic mile.

4. A coin; a half farthing. [Obs.] --Wyclif (Mark xii. 42)

5. A very small part of anything, or anything very small; a
jot; a tittle. [Obs.]

Minutes and circumstances of his passion. --Jer.
Taylor.

6. A point of time; a moment.

I go this minute to attend the king. --Dryden.

7. The memorandum; a record; a note to preserve the memory of
anything; as, to take minutes of a contract; to take
minutes of a conversation or debate.

8. (Arch.) A fixed part of a module. See Module.

Note: Different writers take as the minute one twelfth, one
eighteenth, one thirtieth, or one sixtieth part of the
module.




Minute \Min"ute\, v. t. [imp. & p. p. Minuted; p. pr. & vb. n.
Minuting.]
To set down a short sketch or note of; to jot down; to make a
minute or a brief summary of.

The Empress of Russia, with her own hand, minuted an
edict for universal tolerance. --Bancroft.



WordNet (r) 2.0 [wn]



minute
adj 1: infinitely or immeasurably small; "two minute whiplike
threads of protoplasm"; "reduced to a microscopic
scale" [syn: infinitesimal, microscopic]
2: immeasurably small [syn: atomic, atomlike]
3: characterized by painstaking care and detailed examination;
"a minute inspection of the grounds"; "a narrow scrutiny";
"an exact and minute report" [syn: narrow]
n 1: a unit of time equal to 60 seconds or 1/60th of an hour; "he
ran a 4 minute mile" [syn: min]
2: an indefinitely short time; "wait just a moment"; "it only
takes a minute"; "in just a bit" [syn: moment, second,
bit]
3: a particular point in time; "the moment he arrived the party
began" [syn: moment, second, instant]
4: a unit of angular distance equal to a 60th of a degree [syn:
arcminute, minute of arc]
5: a short note; "the secretary keeps the minutes of the
meeting"
6: distance measured by the time taken to cover it; "we live an
hour from the airport"; "its just 10 minutes away" [syn: hour]


Reply With Quote
  #4  
Old   
Frank van Bortel
 
Posts: n/a

Default Re: PL/SQL Intervals are dizzy - 08-26-2004 , 02:30 AM



Danes wrote:

Quote:
Maybe I am just dizzy but I thought that 600 seconds is 10 minutes...
Obviously not! Or maybe PL/SQL is just dizzy.

SQL> declare
2 blah1 interval day to second := interval '600' second;
3 blah2 interval day to second := interval '10' minute;
4 begin
5 if blah1 <> blah2 then
6 dbms_output.put_line('plsql is shit');
7 else
8 dbms_output.put_line('maybe not');
9 end if;
10 end;
11 /
plsql is shit

PL/SQL procedure successfully completed.

SQL> declare
2 blah1 interval day to second := interval '601' second;
3 blah2 interval day to second := interval '10' minute;
4 begin
5 if blah1 < blah2 then
6 dbms_output.put_line('plsql is really shit');
7 else
8 dbms_output.put_line('maybe not');
9 end if;
10 end;
11 /
plsql is really shit

PL/SQL procedure successfully completed.

SQL
If I understand correctly, you must do the math
yourself (from the SQL Reference, on Interval):

The valid range of values for the trailing field are as follows:

HOUR: 0 to 23
MINUTE: 0 to 59
SECOND: 0 to 59.999999999

Although I get it to work with less than 100 seconds as well...
Just print blah1 (it's 0 when greater than 99 specified)

Also, I tested with 9.2.0.4, which seem to have some bugs
(many examples did not work...) in this area
--

Regards,
Frank van Bortel



Reply With Quote
  #5  
Old   
Danes
 
Posts: n/a

Default Re: PL/SQL Intervals are dizzy - 08-26-2004 , 02:10 PM



Frank van Bortel <fvanbortel (AT) netscape (DOT) net> wrote in message
Quote:
If I understand correctly, you must do the math
yourself (from the SQL Reference, on Interval):

The valid range of values for the trailing field are as follows:

HOUR: 0 to 23
MINUTE: 0 to 59
SECOND: 0 to 59.999999999

Although I get it to work with less than 100 seconds as well...
Just print blah1 (it's 0 when greater than 99 specified)

Also, I tested with 9.2.0.4, which seem to have some bugs
(many examples did not work...) in this area
I did try to print blah1 before and saw that. That is how I debugged
my problem in the first place. Just found it kind of strange and
thought there may be a reason for it. Then I found MINUTE and my code
worked!

If you give a varchar2 a range too big the compiler complains. I would
*at least* expect the same for intervals.

oh well, thanks for chilling and giving me an answer... maybe I will
hit the Ora docs and see what they have to say!


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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.