ich die folgenden Tabellen erstellen haben ...PL/SQL-Prozedur mit einzelnen Parameter
CREATE TABLE Actor
(Actor_ID CHAR(5),
lastName CHAR(24),
firstName CHAR(24),
/
CREATE TABLE Movie
(movieID CHAR(3) ,
title CHAR(36),
year NUMBER,
/
CREATE TABLE Role
(roleID CHAR(5),
roleName CHAR(36),
actorID CHAR(5),
movieID CHAR(3))
/
CREATE TABLE Quote
(quoteID CHAR(4),
quoteCHAR CHAR(255))
/
CREATE TABLE RoleQuote
(roleID CHAR(5),
quoteID CHAR(4))
/
Then i created this schemas....
CREATE TYPE ACTOR_QUOTE_TYPE AS OBJECT (
Movie_Title CHAR(36),
Year NUMBER,
Role CHAR(36),
Quote CHAR(255)
)
/
CREATE TYPE AQ_NT AS TABLE OF ACTOR_QUOTE_TYPE
/
CREATE TABLE ACTOR_QUOTES (
ACTORID CHAR(5),
QUOTES AQ_NT
) NESTED TABLE QUOTES STORE AS ACTOR_QUOTES_NT
/
Ich brauche ein Verfahren mit einem einzelnen Parameter zu erstellen (ActorID ist Prozedurparameter) und legen Sie alle Zitate in allen Filme für jede ACTORID, in die Reihe (n) (ein Schauspieler kann viele Filme und viele Zitate haben, manche dürfen keine Anführungszeichen haben!) der geschachtelten QUOTES-Tabelle in der ACTOR_QUOTES-Tabelle für irgendeine ACTORID.
Wie mache ich das?
Dank
Bisher habe ich versucht, diese, ich bin nicht sicher, ob es richtig ist oder nicht.
CREATE OR REPLACE PROCEDURE Populate_Movies_Quote
AS
CURSOR Quote_cursor (ActorID in CHAR) IS
SELECT ActorID, Quote, Movie_Title from Actor_Quotes, AQ_NT where Quotes.ActorID=ActorID;
BEGIN
FOR row IN Quote_cursor
LOOP
INSERT INTO ACTOR_QUOTES (ActorID, quotes) values (row.ActorID, AQ_NT(Actor_Quote_Type));
END LOOP;
END Populate_Movies_Quote ;
/
Show erros
LINE/COL ERROR
-------- -----------------------------------------------------------------
4/1 PL/SQL: SQL Statement ignored
4/55 PL/SQL: ORA-04044: procedure, function, package, or type is not
allowed here
6/1 PL/SQL: Statement ignored
6/10 PLS-00306: wrong number or types of arguments in call to
'QUOTE_CURSOR'
[Was haben Sie bisher versucht?] (Http://mattgemmm.com/2008/12/08/what-have-you-tried). Ich würde auch [fragen] empfehlen. – Ben
Wenn dies Hausaufgaben ist, bitte markieren Sie als solche –
Mehr oder weniger Duplikat von http://StackOverflow.com/Questions/9946383/pl-SQL-Procedure-using-Curs-Loops-and-Single-Parameter und http://stackoverflow.com/questions/9929058/sql-procedure-cursor-loops und http://stackoverflow.com/questions/9928363/pl-sql-cursor-loops Wenn dies eine Aufgabe ist, sollten Sie lernen, zu suchen oder (sogar besser) rede einfach miteinander. –