473,385 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Getting Syntax Error When trying to use input variables to populate where clause

What is wrong with this sql statement?

ORA-06550: line 1, column 9: PLS-00103: Encountered the symbol "01" when expecting one of the following: begin function pragma procedure subtype type current cursor delete exists prior ORA-06

DECLARE &BEGINDATE DATE;
&ENDDATE DATE;

BEGIN


SELECT MAX(CONTRACTOR_CONTRACTS.CONTRACT_CODE) AS CONTRACT_CODE, MAX(STUDENTS.STUDENT_ID) AS STUDENT_ID, MAX(STUDENTS.UPPER_FIRST_NAME) AS UPPER_FIRST_NAME, MAX(STUDENTS.UPPER_LAST_NAME) AS UPPER_LAST_NAME, MAX(STUDENTS.SSN) AS SSN, MAX(HOURS_WORKED) AS HOURS_WORKED, MAX(HOURLY_RATE) AS HOURLY_RATE, MAX(MAX_HOURS_PER_STUDENT) AS MAX_HOURS_PER_STUDENT, MAX(MAX_HOURS_PER_STUDENT) -MAX(HOURS_WORKED) AS HOURS_REMAINING, MAX(INCENTIVE_AMOUNT) AS INCENTIVE_AMOUNT FROM STUDENTS
INNER JOIN STUDENT_JOBS ON STUDENT_JOBS.STUDENT_ID = STUDENTS.STUDENT_ID
INNER JOIN JOBS ON STUDENT_JOBS.JOB_ID = JOBS.JOB_ID
INNER JOIN WORKSITES ON JOBS.WORKSITE_ID = WORKSITES.WORKSITE_ID
INNER JOIN CONTRACTORS ON JOBS.CONTRACTOR_ID = CONTRACTORS.CONTRACTOR_ID
INNER JOIN CONTRACTOR_CONTRACTS ON CONTRACTOR_CONTRACTS.CONTRACTOR_ID = CONTRACTORS.CONTRACTOR_ID
INNER JOIN
(SELECT STUDENT_JOB_TIMESHEETS.STUDENT_JOB_ID, SUM(HOURS_WORKED) AS HOURS_WORKED, AVG(HOURLY_RATE) AS HOURLY_RATE, SUM(INCENTIVE_AMOUNT) AS INCENTIVE_AMOUNT FROM STUDENT_JOB_TIMESHEETS
GROUP BY STUDENT_JOB_TIMESHEETS.STUDENT_JOB_ID) SUBSET ON STUDENT_JOBS.STUDENT_JOB_ID = SUBSET.STUDENT_JOB_ID
WHERE CONTRACTOR_CONTRACTS.CONTRACT_CODE IN('E100','E101','E102','E104','E105') AND CONTRACTOR_CONTRACTS.BEGIN_DATE >= &BEGINDATE AND CONTRACTOR_CONTRACTS.END_DATE <= &ENDDATE

GROUP BY CONTRACTOR_CONTRACTS.CONTRACT_CODE, STUDENTS.STUDENT_ID;

END;
Dec 22 '11 #1
1 1777
Rabbit
12,516 Expert Mod 8TB
You're missing your declare statement for your end date variable. Also, you never set the value of those variables.
Dec 22 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jeff Thur | last post by:
I am getting this error when trying to run a stored procedure: Microsoft.VisualBasic.CompilerServices.LateBinding.LateInd exGet(Object o, Object args, String paramnames) +1361...
1
by: FaYYaZ | last post by:
Hi All I am getting error "Syntax error " when trying to define a class Like Class myClass Public height Public ID Private t_width
3
by: KevLow | last post by:
Hi, Hope some kind soul can help me out here.. I'm trying to programmatically modify the column headings of a crosstab query such that it can be dynamic based on user specified period (Month...
2
by: David Hearn | last post by:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Description: An unhandled exception occurred during the execution of the current...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
1
by: dipesh | last post by:
I am getting error when trying to Add Web Reference in Visual Studio 2005. "Some of the files required for web references are not installed"
2
by: ticars | last post by:
I'm getting a weird error when trying to access a user control from within a base page during runtime. Here's what I have: I have a master page with a user control on it. I then have a few...
1
by: jonny | last post by:
Went from using Visual Web Develop express to Visual Studio 2005 and getting error when trying to open project. Error message: "One or more projects in the solution could not be loaded for the...
1
by: praom2104 | last post by:
i m newbie to linux......wen ever i create database it returns an error as "mysql> create databases new; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that...
1
by: hbsnam | last post by:
Getting following error when trying to add / submit a listing Warning: in_array() : Wrong datatype for second argument in /home/namibiac/public_html/addlisting.php on line 175 Warning:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.