SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Procedure Error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

SammyDodger
Starting Member

2 Posts

Posted - 03/02/2014 :  09:56:37  Show Profile  Reply with Quote
I'm trying to create a procedure which gets the module information by student id.
quote:
SET SERVEROUTPUT ON;

CREATE OR REPLACE PROCEDURE get_modules_info_by_student_id
(student_id NUMBER)
AS
v_name modules.name%TYPE;
v_created date modules.created date%TYPE;
BEGIN
SELECT name, created DATE
INTO v_name, v_created DATE, v_hire_date, v_update_date
FROM courses
WHERE student_id = student_id;

DBMS_OUTPUT.PUT_LINE('Student_ID: ' || student_id);
DBMS_OUTPUT.PUT_LINE('name: ' || v_name);
DBMS_OUTPUT.PUT_LINE('created_date: ' || v_created DATE);
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE('Student_ID ' || student_id || ' not found.');
end;
/

Warning: Procedure created with compilation errors.

SQL> SHOW ERROR;
Errors for PROCEDURE GET_MODULES_INFO_BY_STUDENT_ID:

LINE/COL ERROR
-------- -----------------------------------------------------------------
5/19 PLS-00103: Encountered the symbol "MODULES" when expecting one of
the following:
:= . ( @ % ; not null range with default character

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 03/02/2014 :  10:05:41  Show Profile  Reply with Quote
This is ms sql server forum. The posted code doesnt look like T-SQL. Please post in relevant forums.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

SammyDodger
Starting Member

2 Posts

Posted - 03/02/2014 :  10:13:24  Show Profile  Reply with Quote
Oh right. I'm using Oracle
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 03/02/2014 :  12:46:54  Show Profile  Reply with Quote
try you luck at forums like www.orafaq.com

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000