Getting records with a parametrized View.

Getting records with a parametrized View.

Post by Gabriel Dovalo Carri » Sat, 29 Jan 2000 04:00:00



When I have a parametrized view and parameter is char type I use "%" to get
all records from data source. How can I get all records when parameter is
integer type?

------------------------------------
Gabriel Dovalo Carril

http://teleline.terra.es/personal/dovalo
 ----------------------------

 
 
 

Getting records with a parametrized View.

Post by Stefan Wuebb » Sat, 29 Jan 2000 04:00:00


Hi Gabriel,

For all types it should be enough to leave the parameter empty to get
all records.

-Stefan


> When I have a parametrized view and parameter is char type I use "%"
to get
> all records from data source. How can I get all records when
parameter is
> integer type?

> ------------------------------------
> Gabriel Dovalo Carril

> http://teleline.terra.es/personal/dovalo
>  ----------------------------


 
 
 

Getting records with a parametrized View.

Post by Gabriel Dovalo Carri » Sat, 29 Jan 2000 04:00:00



> For all types it should be enough to leave the parameter empty to get
> all records.


> >How can I get all records when
> >parameter is
> > integer type?

Hi Stefan,
    does it works for you?

    I have read in other messages from news they need to use operator "LIKE"
and joker "%" to get all records with a string parameter, but it doesn't
work if they don't use the "%".
    This happens for me too.

    The problem is that I don't know any joker to integer parameters, and
leaving it empty doesn't work.

    I'm thinking on using two parameters: one with operator ">=" and the
other whit "<=" but it seems not to be "professional".

    Can problem be in SQL Server Configuration?.
    I remember when I instaled SQL Server that there was to select some
options like: "Case Sensitive", "Case Insensitive", etc., but I don't
remember what for.

------------------------------------
 Gabriel Dovalo Carril

 http://teleline.terra.es/personal/dovalo
  ----------------------------

 
 
 

Getting records with a parametrized View.

Post by Stefan Wuebb » Sun, 30 Jan 2000 04:00:00


Hi Gabriel,

Sorry for my first don't-listen-to-the-man-in-the-corner-message.
Because nobody corrected me I'll try myself.

It would be enough to leave the tcParam empty to get all records, if you
CREATE VIEW v_test AS ;
    SELECT * FROM test ;
WHERE test.cCharacter = ?tcParam

To get the same effect for a numeric type or a more complicated construction
you could issue
... WHERE IIF( EMPTY(tnParam), .T., test.nNumber <= ?tnParam )

I don't think it could be unprofessional to use "<="
Maybe somebody else has a better solution for you.

-Stefan



> > For all types it should be enough to leave the parameter empty to get
> > all records.


> > >How can I get all records when
> > >parameter is
> > > integer type?

> Hi Stefan,
>     does it works for you?

>     I have read in other messages from news they need to use operator
"LIKE"
> and joker "%" to get all records with a string parameter, but it doesn't
> work if they don't use the "%".
>     This happens for me too.

>     The problem is that I don't know any joker to integer parameters, and
> leaving it empty doesn't work.

>     I'm thinking on using two parameters: one with operator ">=" and the
> other whit "<=" but it seems not to be "professional".

>     Can problem be in SQL Server Configuration?.
>     I remember when I instaled SQL Server that there was to select some
> options like: "Case Sensitive", "Case Insensitive", etc., but I don't
> remember what for.

 
 
 

1. Parametrized view.

Hi,
in a  SQLServer 2000 Enterprise edition database I need to create a
parametrized view like this
SELECT * FROM table_name WHERE code = ?
but when I try to store I get back "Impossible to .... "Parameters" ... this
query."
So, how can I construct a parametrized view?

Thanks.
Antonio.

2. Call DriveType function from WinAPI

3. Parametrized view

4. Announcement - xBaseJ Update

5. parametrized Views or use of PL/SQL procedures in queries

6. SQL Server 7 Trial

7. VFP : Parametrized Views & Reports

8. mot de passe/password Access & crystal reports

9. Parametrized View

10. Parametrized remote views

11. Getting records result by parameters to view/stored procedure

12. CREATE SQL VIEW REMOTE (gets all records, Why?)

13. Getting the Record Postion in the Record