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.81 MB
Time: 0.021 c
14-22399
Mcsimm
2001-11-11 12:01
2002.01.08
Formatting in the answers


3-21977
Amelin Vadim
2001-12-03 20:42
2002.01.08
Creating a database in InterBase


6-22304
sedoy
2001-10-11 14:09
2002.01.08
client server on the Internet through a proxy


3-21934
Alexsyy
2001-12-04 08:52
2002.01.08
Help me please


4-22501
Art
2001-11-02 08:30
2002.01.08
Is it possible to prohibit the use of certain Api to other applications?





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 Español 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