niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Oracle » Tools
What is the problem with this stored procedure?
Post new topic   Reply to topic Page 1 of 1 [8 Posts] View previous topic :: View next topic
Author Message
psoug
*nix forums Guru


Joined: 15 May 2005
Posts: 3492

PostPosted: Thu May 11, 2006 4:06 pm    Post subject: Re: What is the problem with this stored procedure? Reply with quote

Wallace wrote:
Quote:
Hai...

I am able to get a collection of rows using BULK COLLECT INTO.

When i try to insert this collection into another table as follows
" "INSERT INTO XPRS$UD_COSA_FORMAL_T(UD_COSA_FORMAL_ID,
COSA_FORMAL, KORT_BETEGNELSE, BETEGNELSE, STARTDATO, SLUTDATO,
UGYLDIG_JN, UDTREK_ID, OPDAT_BRUGER, OPDAT_DATO,
XPRS$UD_COSA_FORMAL_T.VERSION) VALUES(collections(i).COSA_FORMAL_ID,
collections(i).COSA_FORMAL, collections(i).KORT_BETEGNELSE,
collections(i).BETEGNELSE, collections(i).STARTDATO,
collections(i).SLUTDATO, 'N', 0, collections(i).OPDAT_BRUGER,
collections(i).OPDAT_DATO, 0); "

but it is telling
" ORA-02291: integrity constraint (PRINCE.UD_COSA_FORMAL_FK2)
violated - parent key not found
ORA-06512: at "PRINCE.PROC_COSA", line 9
ORA-06512: at line 2 "

UD_COSA_FORMAL_ID is the primary key...
What is the problem?

Thanx in advance...

Looking forward for the response..

Look at the working demos in Morgan's Library at www.psoug.org
under ARRAY PROCESSING.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Back to top
Mark C. Stock
*nix forums Guru


Joined: 05 May 2005
Posts: 730

PostPosted: Thu May 11, 2006 11:33 am    Post subject: Re: What is the problem with this stored procedure? Reply with quote

"Wallace" <princevictor.moses@gmail.com> wrote in message
news:1147336269.084363.56450@j73g2000cwa.googlegroups.com...
: Thanx for ur reponse....
:
: Thats working fine....
:
: Now it is telling error in "
: DBMS_OUTPUT.PUT_LINE(collections(i).COSA_FORMAL_ID); "
:
: Error :
: 1. Error(8,3): PL/SQL: Statement ignored
: 2. Error(8,39): PLS-00302: component 'COSA_FORMAL_ID' must be declared
:
: Also tell me the diff b/t the AS DECLARE and IS...
:
: looking forward for the response.....
:

either AS or IS are OK.... the problem is DECLARE -- it is only used for
anonymous blocks, and is implied for stored procedures (actually replaced by
the procedure specification)

make sure you spend some time reading the PL/SQL user's guide, Application
Developer's Guides, and other items recently mentioned in a "Where to start"
post.

++ mcs
Back to top
Wallace
*nix forums beginner


Joined: 19 Apr 2005
Posts: 20

PostPosted: Thu May 11, 2006 9:44 am    Post subject: Re: What is the problem with this stored procedure? Reply with quote

Hai...

I am able to get a collection of rows using BULK COLLECT INTO.

When i try to insert this collection into another table as follows
" "INSERT INTO XPRS$UD_COSA_FORMAL_T(UD_COSA_FORMAL_ID,
COSA_FORMAL, KORT_BETEGNELSE, BETEGNELSE, STARTDATO, SLUTDATO,
UGYLDIG_JN, UDTREK_ID, OPDAT_BRUGER, OPDAT_DATO,
XPRS$UD_COSA_FORMAL_T.VERSION) VALUES(collections(i).COSA_FORMAL_ID,
collections(i).COSA_FORMAL, collections(i).KORT_BETEGNELSE,
collections(i).BETEGNELSE, collections(i).STARTDATO,
collections(i).SLUTDATO, 'N', 0, collections(i).OPDAT_BRUGER,
collections(i).OPDAT_DATO, 0); "

but it is telling
" ORA-02291: integrity constraint (PRINCE.UD_COSA_FORMAL_FK2)
violated - parent key not found
ORA-06512: at "PRINCE.PROC_COSA", line 9
ORA-06512: at line 2 "

UD_COSA_FORMAL_ID is the primary key...
What is the problem?

Thanx in advance...

Looking forward for the response..
Back to top
Wallace
*nix forums beginner


Joined: 19 Apr 2005
Posts: 20

PostPosted: Thu May 11, 2006 9:00 am    Post subject: Re: What is the problem with this stored procedure? Reply with quote

Thank u very much....
Back to top
LokalST
*nix forums beginner


Joined: 11 May 2006
Posts: 2

PostPosted: Thu May 11, 2006 8:43 am    Post subject: Re: What is the problem with this stored procedure? Reply with quote

"Wallace" <princevictor.moses@gmail.com> wrote in message
news:1147336269.084363.56450@j73g2000cwa.googlegroups.com...
Quote:
Thanx for ur reponse....

Thats working fine....

Now it is telling error in "
DBMS_OUTPUT.PUT_LINE(collections(i).COSA_FORMAL_ID); "

Error :
1. Error(8,3): PL/SQL: Statement ignored
2. Error(8,39): PLS-00302: component 'COSA_FORMAL_ID' must be declared

You declared collections as employee rowtype. That means you can refer only
to columns that exist in table. 2nd error tells you that no such column
exist in table.

Quote:
Also tell me the diff b/t the AS DECLARE and IS...


Syntax for creating procedure demands such structure with no alternative Smile
Back to top
Wallace
*nix forums beginner


Joined: 19 Apr 2005
Posts: 20

PostPosted: Thu May 11, 2006 8:31 am    Post subject: Re: What is the problem with this stored procedure? Reply with quote

Thanx for ur reponse....

Thats working fine....

Now it is telling error in "
DBMS_OUTPUT.PUT_LINE(collections(i).COSA_FORMAL_ID); "

Error :
1. Error(8,3): PL/SQL: Statement ignored
2. Error(8,39): PLS-00302: component 'COSA_FORMAL_ID' must be declared

Also tell me the diff b/t the AS DECLARE and IS...

looking forward for the response.....
Back to top
LokalST
*nix forums beginner


Joined: 11 May 2006
Posts: 2

PostPosted: Thu May 11, 2006 7:42 am    Post subject: Re: What is the problem with this stored procedure? Reply with quote

"Wallace" <princevictor.moses@gmail.com> wrote in message
news:1147332345.314376.297250@j33g2000cwa.googlegroups.com...
Quote:
Hai All,

Can anyone point out what is problem with this following stored
procedure :

CREATE OR REPLACE PROCEDURE PRINCE.PROC_EMP AS
DECLARE

Instead of word AS put word IS and remove DECLARE. Should work
Back to top
Wallace
*nix forums beginner


Joined: 19 Apr 2005
Posts: 20

PostPosted: Thu May 11, 2006 7:25 am    Post subject: What is the problem with this stored procedure? Reply with quote

Hai All,

Can anyone point out what is problem with this following stored
procedure :

CREATE OR REPLACE PROCEDURE PRINCE.PROC_EMP AS
DECLARE
TYPE collectionset IS TABLE OF Employee%ROWTYPE;
collections collectionset;
BEGIN
SELECT * BULK COLLECT INTO collections FROM Employee;
FOR i IN collections.FIRST .. collections.LAST
LOOP
DBMS_OUTPUT.PUT_LINE(collections(i).ID);
END LOOP;
END;

when i compile i am getting the following errors:

1. Error(2,1): PLS-00103: Encountered the symbol "DECLARE" when
expecting one of the following: begin function package pragma
procedure subtype type use <an identifier> <a double-quoted
delimited-identifier> form current cursor external language The
symbol "begin" was substituted for "DECLARE" to continue.

2. Error(11,4): PLS-00103: Encountered the symbol "end-of-file" when
expecting one of the following: begin case declare end exception
exit for goto if loop mod null pragma raise return select update
while with <an identifier> <a double-quoted delimited-identifier>
<a bind variable> << close current delete fetch lock insert open
rollback savepoint set sql execute commit forall merge pipe

I am new to OracleXE... Please help...

looking forward for the response...
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [8 Posts] View previous topic :: View next topic
The time now is Wed Jan 07, 2009 5:26 pm | All times are GMT
navigation Forum index » Databases » Oracle » Tools
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts postfix smtp authentication using mysql stored user/pass rtresidd Postfix 0 Fri Oct 03, 2008 5:58 am
No new posts Unknown in header problem -SOLVED- Light Speed Postfix 0 Thu Jul 03, 2008 10:40 am
No new posts problem with sending mail nuxia Postfix 0 Mon Apr 21, 2008 3:58 am
No new posts Postfix 2.3.8 Virtual problem Blotto Postfix 0 Fri Apr 04, 2008 6:11 am
No new posts Postfix sending problem for local domain remote email monkey_magix Postfix 0 Mon Sep 10, 2007 10:17 am

Xbox Mod Chip | Credit Counseling | Homeowner Loans | Free File Hosting | Dutch Bodybuilding Forums
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2858s ][ Queries: 20 (0.1924s) ][ GZIP on - Debug on ]