0

I executed the following:

CREATE OR REPLACE PROCEDURE DISCOUNT
  (PHAR IN VARCHAR2,
   TRADE IN VARCHAR2,
   EFFECT IN VARCHAR2,
   FORMULAE IN VARCHAR2,
   PRICE IN NUMBER,
   DISCOUNT IN NUMBER) IS
DECLARE
  PHAR VARCHAR2(30), TRADE VARCHAR(30), EFFECT VARCHAR(250), FORMULAE VARCHAR2(50),
  PRICE NUMBER(7,2);
BEGIN
  SELECT TRADE IN TRADENAME WHERE PHARNAME = PHAR AND LISTPRICE = PRICE;
END DISCOUNT;

ok and after "Enter" button, i typed this

EXECUTE DISCOUNT;

and this is what i get:

2
3
4

Is that an error??

In case it's needed, here is the DISCOUNT tale structure:

PHARNAME              NOT NULL    VARCHAR2(30)
TRADENAME             NOT NULL    VARCHAR2(30)
SIDEEFFECT                        VARCHAR2(250)
FORMULA                           VARCHAR(50)
LISTPRICE                         NUMBER(7,2)
3
  • 1
    Firstly, you haven't specified what database you're using. I'm assuming Oracle. Secondly, you haven't specified what client you're using. I'm assuming SQL-Plus, based on the line numbers output. Your problem here is that your procedure is not syntactically correct (you can't separate variable declarations with commas, and your query is not valid SQL, and doesn't select INTO anything), and you're not ending your procedure with a / which means SQL*Plus is still waiting for you to finish it. Also, it's not clear what you are expecting this procedure to actually accomplish. Commented Nov 20, 2014 at 8:54
  • @JeffreyKemp I'm using Oracle Database 11g client & SQL*Plus command prompt Commented Nov 20, 2014 at 13:39
  • Ok, that's a good start. We've identified your platform and client. How about the rest of the details? What are you trying to accomplish with this code? Commented Nov 20, 2014 at 14:43

1 Answer 1

1

I've figured out what those

2
3
4 

after the lines EXECUTE DISCOUNT

they're command lines. i've to type one line at a time for stored procedure

SQL> BEGIN DBMS_OUTPUT.PUT_LINE('Hello!');
2  END;
3  /
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.