Subject AW: [IBO] View, filter or ... ?
Author Christian Kaas
Hi Cristian,

if it is the case all over your program, use a "setup" table containing
each users criteria and join against it!

somthing like
create table user_settings(
userid numeric(8,0),
year numeric(4),
month numeric(2)
);

then join like this:

select x,y,z
from yourtable,
user_settings
where yourtable.year = user_settings.year
and yourtable.month = user_settings.month
and user_settings.userid = :userid

this way you only need to supply one param.



--
Christian Kaas mailto:christian@...
Client/Server/Internet/Multitier development
http://www.ckaas.de

> -----Ursprungliche Nachricht-----
> Von: Cristian Ivan [mailto:cris@...]
> Gesendet: Samstag, 3. Marz 2001 17:34
> An: IBObjects@yahoogroups.com
> Betreff: [IBO] View, filter or ... ?
>
>
> Sorry for the "Subject" of the original mail, I was in a hurry :)
> --
>
> Hi !
>
> I wonder if somebody here on the list has a better idea for the
> following problem I have:
>
> 1. I have a table with a "month,year,somedata" fields.
>
> 2. When the user starts the program he is asked about the month and
> year he wants to work with and then the whole program only works with
> that "somedata".
>
> 3. I've "solved" the problem by creating a view after he selects the
> month and data, something like
> q.sql.text:=Format('
> create view curent_table as select * from table where
> (month=%d) and (year=%d)',
> [cbMonth.itemindex+1,StrToInt(cbYear.items[cbYear.itemindex])]
> );q.execute;
> After that in the whole program I'm only reffering to the "curent"
> view. I've done this because I find easier to use "select from
> curent_table ... " than appending to all
> queries something like 'where month=... and year=..." (select from
> table where (condition) AND month=... and year=...".
>
> Note: the problem with this is that only one user could use the
> database at one time...or more users using only the selected month and
> year. In fact this is way I'm trying to find an alternative :)
>
> 4. There is another way of solving this by using filters, but
> it's almost the same as the last statement.
>
> Could there be an another way of working with a subset of the data,
> as described above ?
>
> thanks
>
>
>
> --
> Best regards,
> Cristian mailto:cris@...
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-~>
> Find software faster. Search more than 20,000
> software solutions on KnowledgeStorm. Register
> now and get started.
> http://us.click.yahoo.com/7u_SwA/zMSCAA/Ig4EAA/P0AVlB/TM
> --------------------------------------------------------------
> -------_->
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>