Re: SQL -- getting values

From: MarkyG <markg_at_mymail.tm>
Date: 8 Nov 2001 01:53:05 -0800
Message-ID: <ab87195e.0111080153.54e94162_at_posting.google.com>


Yes you can write a function (not a procedure) to calculate the current semester and use it.

Assuming you had a function called Get_Current_Semester which returned your semester value based on the current date.

 Select *
 from enrollment
 where semester = Get_Current_Semester(SYSDATE);

I don't quite know how your semesters work so cannot suggest an algorithm to help. That will be up to you.

HTH, M

gmohata_at_yahoo.com (Girish Mohata) wrote in message news:<42a840c2.0111071706.11eeb255_at_posting.google.com>...
> Hi all,
> Im running Oracle 9i on a Win2000 machine.
> I have a table which stores the semester for a university.
> In most of my sql queries im having to hard code the semester example:
>
> Select *
> from enrollment
> where semester = 013........
>
> The problem is that in my next semster i will have to go and change
> all these SQL statements, which might be embedded in my XSQL pages, et
> al.
> Is there a way in which i could call a Procedure in my sql statement
> which would, depending on the SYSDATE calculate the current semster.
> I can make this procedure without any fuss..... but dont know how to
> put it in the where clause in SQL.
> Is there any other way i could put in the semster dynamically ?
>
> Help will be much appreciated.
> Regards,
> Girish
Received on Thu Nov 08 2001 - 10:53:05 CET

Original text of this message