I am trying to create some Linked reports and this should be SO easy. I decided to start simple so this is what I have.
Below is the code for the report that creates a list of students
When I run it, I get an error that says "Unknown column reference: student_id"
It does run and I get the list of student names and IDs along with the links at the right of each.
When I click on the links, it lists the 2nd report and I can click on it. At that point, I get a box prompting for the student ID (presumably because it has not been passed due the first error).
Could this be related to the data type VARCHAR?
(The code for the 2nd report "sp_DBR_studentinfolinknew" is further down in this post.)
$$
CREATE PROCEDURE sp_DBR_Student_IDs
()
BEGIN
select 'dbr.report', 'sp_DBR_studentinfolinknew','instudentid=student_id';
select student_fname AS 'First',
student_lname AS 'Last',
student_id AS 'ID'
from database.students;
END
$$
=======================
Code for 2nd report
$$
CREATE PROCEDURE sp_DBR_studentinfolinknew
(instudentid varchar(8))
BEGIN
select student_id as 'Student ID',
allergy as 'Allergy'
from database.allergies
WHERE student_id=instudentid;
END
$$