Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can I take user input and put in a report query ?

468183Mar 10 2006 — edited Mar 11 2006
Hi all, I have a report which generates monthly stats for staff assigned to projects. The attributes I am using are proj_no, proj_name, proj_startdate, staff_lname.

I understand that I can do something like:
select dname, ename, salary
from dept, emp
where dept.deptno = emp.deptno
and dept.deptno = :department_no

The last line brings up a prompt for a department number. All straightforward so far.

I want to pull up a similar prompt but get a month, say "APR" entered instead. I wanted to use that value in my SQL code to run the report.

I have hardcoded a month in like this:
select staff_lname, proj_staff.proj_no, proj_name, proj_startdate
from staff, project, proj_staff
where staff.staff_id = proj_staff.staff_id
and project.proj_no = proj_staff.proj_no
and func_date like '%APR%';

This works fine but I don't know how to change the coding to accomodate a user defining the month.

Any help greatly appreciated

Kevin
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 8 2006
Added on Mar 10 2006
4 comments
602 views