Re: Newbie - PL SQL Declarations (%type,%rowtype)

From: A.C.L.M. Grutters <hanalex_at_worldonline.nl>
Date: 1998/07/08
Message-ID: <01bdaab0$7662e2c0$1b8cf1c3_at_hanalex>#1/1


From what I see in your declarations is that you declare a record npanxx to

be a rowtype of a cursor with the same name. I don't think that's a valid declaration, a better way would be

r_npanxx c_npanxx%rowtype;

The same name is in the second declaration. Then I see a record npachck to be a rowtype of a cursor npa. There's nothing wrong with that basically but in the
next declaration you declare a variable npa. This variable has the same name as the cursor in the line before and I suppose that you already declared that cursor.

It might be a good idea to adapt naming conventions for variables. I always use prefixes like
l_name for local variables, c_name for cursors, r_name for cursor records, e_name for
exceptions and c_name for constants. This way your code is clearer.

Best regards,

                                                        /'^^'\
                                                       ( o o )

---------------------------------------------------oOOO--(_)--OOOo------
Alexander Grutters tel.: 0346 554110 AMIS Services BV fax.: 0346 573706 Bisonspoor 1218 Internet: www.amis.nl PO Box 1580 EMail: grutters_at_amis.nl 3600 BN Maarssen hanalex_at_worldonline.nl .oooO ( ) Oooo.
-----------------------------------------------------\ (----( )-------
\_) ) / (_/

gundugollu_at_my-dejanews.com wrote in article <6o01ci$1tv$1_at_nnrp1.dejanews.com>...

> I am having problem with the following declarations in a package.
> 
> The portion of the code the error message is pointing to, I get a mes
> npanxx          npanxx%rowtype;
> loc             npanxx.exch%type := NULL;
> npachk          npa%rowtype;
> npa             npachk.npa%type;
> 
> I get the following errors (similar for each of the lines of code above.)
> 
> 42/10    PLS-00320: the declaration of the type of this expression is
>          incomplete or malformed
> 
> 42/10    PL/SQL: Declaration ignored
> 
> I have other declarations similar to this with other tables, and it
 doesn't
> complain there, but it complains here. It is not consistent.
> 
> Any suggestions would be great help
> 
> TIA
> 
> Anil
> 
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum
> 
 
Received on Wed Jul 08 1998 - 00:00:00 CEST

Original text of this message