Home
Top.Mail.Ru Yandeks.Metrika
Forum: "Bases";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Down

Resetting the MSSQL2000 variable Find similar branches


KAA   (2001-12-04 10:28) [0]

Here is the procedure:

CREATE PROCEDURE ManUnique
@FirstName varchar (50) = NULL,
@LastName varchar (50) = NULL,
@MiddleName varchar (50) = NULL,
@DTBorn datetime = NULL,
@UIDMan int = NULL OUTPUT

AS
SELECT @ UIDMan = UID FROM list_man WHERE ((FirstName = @ FirstName) and (LastName = @ LastName) and (MiddleName = @ MiddleName) and (Year (DTBorn) = Year (@DTBorn)) and (Month (DTBorn) = Month (@DTBorn)) and (Day (DTBorn) = Day (@DTBorn)))
GO

If SELECT finds nothing, the procedure returns the old value in the @UIDMan variable. But what does assigning NULL mean when declaring a variable? If you put SET @ UIDMan = NULL before the selection, then everything is fine. So it does not reset the value.
Explain this nuance.



Гоша   (2001-12-04 12:27) [1]

And what is the "old meaning"?
How is the procedure called? (@UIDMan passed as input parameter?)
"assigning NULL when declaring a variable" - this is the DEFAULT value



Pages: 1 whole branch

Forum: "Bases";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Top





Memory: 0.54 MB
Time: 0.023 c
1-22099
Yulyashka
2001-12-19 17:43
2002.01.08
Question about DBGrid !!


4-22475
Di_wind
2001-11-02 16:08
2002.01.08
Search


14-22398
Jey
2001-11-10 18:55
2002.01.08
Here here it is an IRC client to do ....


4-22512
Yaroslav
2001-10-31 13:17
2002.01.08
How to create a popup menu on the API


7-22450
fsp
2001-09-21 22:32
2002.01.08
Screwing programs in the systems tray.





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic indonesian Irish italian Japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Spanish swahili Swedish thai turkish Ukrainian urdu vietnamese welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada Khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish