1

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 !

3
  • Not sure if this helps. stackoverflow.com/questions/3382833/… Commented Jan 9, 2012 at 21:12
  • @Ben Apart from the table schema and data of course Commented Jan 9, 2012 at 21:14
  • srikanthradix not really, if i read correctly i have to use single quotes, which i already did Commented Jan 9, 2012 at 21:17

1 Answer 1

3

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;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.