Question:
oracle pl/sql compilation errors needs some help !?
chin
2010-11-06 23:31:02 UTC
i got this two script of pl/sql function that output the result

" SQL> warning compilation error "

so pls advice me what to do ???

here's the script ...


-- calling script below
CREATE OR REPLACE FUNCTION getContWages(Contr_id IN Contractor.Contractor_id%TYPE)

RETURN Contract.paymentMode%TYPE
AS cpaymentMode Contract.paymentMode%TYPE;

BEGIN
SELECT paymentMode
INTO cpaymentMode
FROM Contractor, Contract
WHERE Contractor.Contractor_id=Contract.Contra…
AND paymentMode=cpaymentMode;
RETURN(cpaymentMode);


END;
/


-- execution function script below
-- this is pl/sql contractorwages
-- it requires 2 fields named skills_price from Skills table and No_hrs from Daily_Work table
-- the function will calculate skills_price MULTIPLE (*) No_hrs with condition of StartDate and FinishDate IS NOT NULL
-- the function should return wages of the contractor in numbers value
-- in between salary & commission field require to create via alter session table table_name add column_name data type




CREATE OR REPLACE FUNCTION ContractorWages ( -- this function requires Contractor_id with its data type
i_Contractor_id Contract.Contractor_… ) -- to match valid identifier for this function.

RETURN NUMBER
IS

v_Contract_wages Contract.wages%TYPE; -- a variable Contract_wages created from the matching
-- of table contractor and wages field in Contract table.




-- begin procedural sql execution

BEGIN

-- sql statement execution


-- FIRST select statement is to retrieve require attributes for comparison

SELECT SkillsPrice, No_hrs, StartDate, FinishDate
FROM Skills, Daily_Work, Contract;



-- SECOND select statement is to calculate salary

SELECT SUM(SkillsPrice*No_hrs) as SALARY
INTO v_Contract_wages
FROM Skills, Daily_Work, Contract
WHERE (StartDate IS NOT NULL AND FinishDate IS NOT NULL);



-- THIRD select statement is to calculate wages

SELECT SUM(SkillsPrice*No_hrs+NVL(comm,0)) -- the NVL means function lets you substitute a value when a null value is encountered, hence it will later convert NULL value to zero '0'
INTO v_Contract_wages -- here it will display contractor's wages from this sql statement
FROM Daily_Work, Skills, Contract
WHERE Contractor_id = i_Contractor_id
AND (StartDate IS NOT NULL AND FinishDate IS NOT NULL);


-- perform/check errors/exceptions

IF v_Contract_wages IS NULL THEN -- here is to display wages that is value ZERO, values that are not ZERO will display as
v_Contract_wages := 0;
END IF;

RETURN v_Contract_wages;
END;
/


how to solve this oracle pl/sql function script??? anyone ??
Five answers:
?
2010-11-07 08:50:10 UTC
Visit the following link for user friendly training material:

http://www.technofunc.com/forum/erp-process-specific-discussions/technical/sql-plsql
2014-05-22 20:43:16 UTC
Greens Technology adyar, is the best training institute in chennai to Learn Oracle sql and Plsql. There are Only Professionals training the students With 10+ Experience in MNC companies.



Free LIVE DEMO is provided ask for it and Enroll for the Course.

Get Experience with Experience Trainer.



I Will rate 5/5 for their traning.



If interested contact @ +91 89399 15577



http://www.plsqltraining.in/oracle-plsql-training-in-chennai.html

http://www.plsqltraining.in/oracle-certification-training-in-chennai.html
2014-05-22 08:57:03 UTC
Oracle PLSQL TRAINING in GREENS TECHNOLOGY,CHENNAI

Learn Oracle PL SQL from the Best Oracle PLSQL Training center in Chennai with the most experienced trainer in the field. Greens Technology Adyar provides Oracle SQL, PLSQL, Performance Tuning training in Chennai to professionals and corporates on advanced SQL, PL SQL with XML, Oracle PLSQL Training includes Analytic SQL for Data Warehousing on both Classroom Trainings and Online Trainings



Request for Demo Class and Enroll the course pay.



Contact @ 8939915577



http://www.plsqltraining.in/index.html

http://www.plsqltraining.in/contact-greens-technologys.html
2014-05-22 21:12:13 UTC
for Oracle sql and plsql training, Greens Technology has the real time expert trainers



contact them and request for a demo class. they are doing good



Excellent teaching for oracle sql and plsql!! and exclusively for plsql.... Each and every topic was explained with good examples which are relevant to real time..

I will rate 5/5 for Oracle sql and plsql training center.

If you are interested contact @ +91-89399 15577



http://www.plsqltraining.in/greens-technology-reviews-complaints.html

http://www.plsqltraining.in/contact-greens-technologys.html
TheMadProfessor
2010-11-08 09:51:52 UTC
Did the compiler not indicate which line(s) were in error? However, you might try replacing



AS cpaymentMode Contract.paymentMode%TYPE;



with



AS

DECLARE cpaymentMode Contract.paymentMode%TYPE;



Also, if any comments wrap to another line, may need to prefix them with comment indicators as well.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...