HELP - Setting TQuery Parameters to Null 
Author Message
 HELP - Setting TQuery Parameters to Null

Can some Guru help. I am using the parameters in SQL and TQuery to
retrieve only some records, but need to "switch the parameter off on
menu command to allow all records to be sourced.

Is there a way to set the SQL dynamic parameter (in this case .asstring)
to a null value to allow all records to be retrived by the SQL



Thu, 21 May 1998 03:00:00 GMT  
 HELP - Setting TQuery Parameters to Null
: Can some Guru help. I am using the parameters in SQL and TQuery to
: retrieve only some records, but need to "switch the parameter off on
: menu command to allow all records to be sourced.

: Is there a way to set the SQL dynamic parameter (in this case .asstring)
: to a null value to allow all records to be retrived by the SQL
:  

  Use the Clear Method for the Params Preperty...

   Query.Params[1].Clear;

  That will set Params[1] to Null...

-David

--
________________________________________________________________________
        _/                _/      _/                  

 _/   _/   _/_/ _/   _/ _/ _/   _/ _/ _/ _/ _/      
_/   _/ _/  _/  _/ _/  _/ _/   _/ _/ _/ _/ _/        David L. McWhirter
_/_/_/ _/_/_/    _/   _/  _/_/_/ _/    _/   _/_/_/   Lake Forest, CA



Fri, 22 May 1998 03:00:00 GMT  
 HELP - Setting TQuery Parameters to Null

Quote:

> Is there a way to set the SQL dynamic parameter (in this case .asstring)
> to a null value to allow all records to be retrived by the SQL

I believe this will work:

  Query1.ParamByName('Param1').Clear;

--


Office of Admnistrative Systems
Vanderbilt University



Sun, 24 May 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. List of the SET parameters (in .BAT file) to parameter DPMI

2. How to pass parameter to TQuery and retrieve value from TQuery

3. assign null to AsDateTime parameter

4. Passing NULL parameters to a stored procedure

5. Null parameters for SQL-inserts, is it possible?

6. TQuery on TQuery result set??

7. I need to set dates to NULL in SQL

8. Filtering on a date field set to NULL

9. Setting Number fields to Null

10. Setting DBLookupComboBox to null record

11. DbQuery Null Result Set?

12. How to set Null values using parametrized SQL

 

 
Powered by phpBB® Forum Software