Brian
Brian

Reputation: 2051

Running PL/SQL code into Oracle 11g Express Edition - Error

I'm trying to run the following PL/SQL code into Oracle 11g XE. As far as I can see there's nothing wrong with the code, however, Oracle is giving me errors - ones which I have no idea how to solve.

declare
bookIsbn        BookTitle.Isbn%type;
bookName        BookTitle.btName%type;
numOfCopies        number;

procedure getTotalLoans(
getbookIsbn            in    BookTitle.Isbn%type,
getbookName            out    BookTitle.btName%type,
getnumOfCopies        out    number) is
    begin
    SELECT BookTitle.btName, COUNT(BookCopy.isbn)
    INTO getbookName, getnumOfCopies
    FROM BookTitle, BookCopy, Loan
    WHERE getBookIsbn = BookCopy.isbn
    AND BookTitle.isbn = BookCopy.isbn
    AND BookCopy.bcId = Loan.bcId
    AND loan.dateback is null
    GROUP BY BookTitle.btName, BookTitle.isbn;
    end;

begin
--main block
getTotalLoans (4,bookName,numOfCopies);
    dbms_output.put_line('Book Name' || bookName || ' Number of copies on loan: ' || numOfCopies);
end;
/

And I get the following error:

ERROR at line 2:
ORA-06550: line 2, column 1:
PLS-00114: identifier 'BOOKISBNƒƒƒƒƒƒƒƒBOOKTI' too long
ORA-06550: line 2, column 34:
PLS-00103: Encountered the symbol "." when expecting one of the following:
constant exception <an identifier>
<a double-quoted delimited-identifier> table long double ref
char time timestamp interval date binary national charact
ORA-06550: line 3, column 1:
PLS-00114: identifier 'BOOKNAMEƒƒƒƒƒƒƒƒBOOKTI' too long
ORA-06550: line 3, column 34:
PLS-00103: Encountered the symbol "." when expecting one of the following:
constant exception <an identifier>
<a double-quoted delimited-identifier> table long double ref
char time timestamp interval date binary national charact
ORA-06550: line 4, column 1:
PLS-00114: identifier 'NUMOFCOPIESƒƒƒƒƒƒƒƒNUM' too long
ORA-06550: line 4, column 34:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
constant exception <an identifier>
<a double-quoted delimited-identifier> table long double ref
char time timestamp

Any help would be appreciated.

Thanks !

Upvotes: 1

Views: 2168

Answers (1)

John Doyle
John Doyle

Reputation: 7803

The code you've given works perfectly for me when I run it. However, the error suggests that you have some extra characters between your variable names and types. That is, BOOKISBNƒƒƒƒƒƒƒƒBOOKTI, where does all the f characters come from? It may be that these are non-printable characters that the error handler is converting to a printable character. What if you copied and pasted the below over your variable declarations and tried again?

bookIsbn BookTitle.Isbn%type;
bookName BookTitle.btName%type;
numOfCopies number;

Upvotes: 3

Related Questions