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.55 MB
Time: 0.044 c
3 - 21937
ANDREY196
2001-12-04 18:24
2002.01.08
How do I change the color in a particular row to a table in DBGRID


1 - 22236
T2
2001-12-16 07:10
2002.01.08
serial.vxd


14 - 22327
fliz
2001-11-05 15:39
2002.01.08
and they say the day after tomorrow is a holiday?


14 - 22363
Dense
2001-11-02 18:16
2002.01.08
Well ...?


1 - 22201
T2
2001-12-16 07:13
2002.01.08
Sound Spectr





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