Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to initialize variable of type ROWTYPE

Status
Not open for further replies.

slicendice

Programmer
Jun 28, 2002
164
GB
Hi
I have a PL/SQL program that has a number of variables that are of type ROWTYPE - consequently each has a number of fields.

What I am wondering is, is it possible to initialize the whole ROWTYPE variable in one go without having to go through and initialize each field in turn?
i.e. instead of:
cVar.Field1 := NULL;
cVar.Field2 := NULL;
cVar.Field3 := 0;
etc.

...is it possible to initialize all fields in one go with something like:
cVar := <some init value!>

I'm guessing it's not poss but thought I'd ask first!

Many thanks

 
When you declare a variable of %rowtye all its elements are initialised by nulls. You may also create a variable with more meaningfull default element values and assign it to any new variable of the same type, though in this case you should initialize at least that "default" one.

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top