Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Syntax for Stored Procedure
Message
De
06/11/2003 07:00:56
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00846249
Message ID:
00846998
Vues:
22
This message has been marked as the solution to the initial question of the thread.
Hi Mariam

>I’m wondering may I use CASE or IF statement in Where clause when I’m writing stored procedure ?

>Is there any way to check inside the procedure if any of parameters is empty ?

You can, as Sergey suggests, test the LEN() of a variable. However, you can also assign default values to the variables in the CREATE PROCEDURE statement like this:
CREATE PROCEDURE dbo.usp_test @corpname varchar(30) = '%', @corpdba varchar(30) = '%'
This has a double benefit and one drawback! The benfits are that you will not get an error if either one or both parameters are omitted, and you don't have to worry about testing them for empty values in the procedure, you can do that in VFP and only pass non-empty values.

The drawback, of course, is that the default condition (both values = '%') will return all rows from the database!
----
Regards
Andy Kramek
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform