I have this stored procedure for Oracle:
create or replace
procedure bns_saa_message_get() <--- PROBLEM IS HERE BC I HAVE NO PARAMS TO PASS
AS
begin
select HostNumber, SAAMessage from BNS_SAA_MESSAGES where HostNumber=(select max(HostNumber) from BNS_SAA_MESSAGES);
end;
I get the following error when I try to compile it:
Error(2,31): PLS-00103: Encountered the symbol ")" when expecting one of the following: <an identifier> <a double-quoted delimited-identifier> current
Question:
How do I make a stored procedure where I don’t need to pass any arguments to it?
Remove the brackets:
EDIT:
To answer your second question…
This assumes you only get one row returned from your query….
If you get more than one row then you’ll have to bulk collect into a collection.