PLS-00103: error
Can you please help me what is missing in my query. I don't know how to put something else.Error(459,6): PLS-00103: Encountered the symbol "WHEN" when expecting one of the following: * & = - + ; < / > at in is mod remainder not rem <an exponent (**)> <> or != or ~= >= <= <> and or like like2 like4 likec between || member submultiset The symbol ";" was substituted for "WHEN" to continue.
Error(485,1): PLS-00103: Encountered the symbol "END" when expecting one of the following: * & = - + ; < / > at in is mod remainder not rem <an exponent (**)> <> or != or ~= >= <= <> and or like like2 like4 likec between || member submultiset
stmt := q'[select distinct pta.project_id project_id,
pta.project_number project_number,
pta.project_name project_name,
pta.task_id task_id,
pta.task_number task_number,
pta.task_name task_name,
pta.award_id award_id,
pta.award_number award_number,
pta.award_short_name award_short_name
from xxdl.xxdl_cd_pta_all pta
where pta.task_id = pta.top_task_id
and pta.cd_proj_type='Y']';
case when p_in_service = 'IN_SERVICE' then
stmt := stmt || q'[ and (
(
pta.project_id, pta.task_id, pta.award_id
) in
(
select d.project_id,d.task_id,d.award_id
from xxdl.xxdl_cd_debt_item d,xxdl.xxdl_cd_amortization_status s
where d.debt_id = s.debt_id
and s.active = 'Y'
and s.amortization_status not in ('CIP','NONE')
)
)]'
when p_in_service = 'NOT YET IN-SERVICE' then
stmt := stmt || q'[ and (
(
pta.project_id, pta.task_id, pta.award_id
) in
(
select d.project_id,d.task_id,d.award_id
from xxdl.xxdl_cd_debt_item d,xxdl.xxdl_cd_amortization_status s
where d.debt_id = s.debt_id
and s.active = ''Y''
and s.amortization_status in ('CIP','NONE')
)
)]'
when p_in_service = 'ALL PROJECTS' then
stmt := stmt || q'[ and (
(
pta.project_id, pta.task_id, pta.award_id
) in
(
select d.project_id,d.task_id,d.award_id
from xxdl.xxdl_cd_debt_item d,xxdl.xxdl_cd_amortization_status s
where d.debt_id = s.debt_id
and s.active = 'Y'
)
)]'
end;
Published by: 893185 on November 30, 2011 10:59
Dude, turn off your shift key.
SQL> declare
2 p_in_service varchar2(30);
3 stmt varchar2(30);
4 begin
5 case when p_in_service = 'IN_SERVICE' then
6 stmt := stmt || 'a';
7 when p_in_service = 'NOT YET IN-SERVICE' then
8 stmt := stmt || 'b';
9 when p_in_service = 'ALL PROJECTS' then
10 stmt := stmt || 'c';
11 else
12 stmt := stmt || 'd';
13 end case;
14 end;
15 /
PL/SQL procedure successfully completed.
Tags: Database
Similar Questions
-
PLS-00103: error, produces the symbol
Hi all, I am using a slider from my package spec, but when I do this, I get the error in a particular cursor below
Spec
BodyCURSOR x_sysdate_rec IS SELECT sysdate --to_char(sysdate,'DD-MON-YYYY') "Date" FROM dual; x_sysdate x_sysdate_rec%ROWTYPE;
Can someone guide me where I am doing wrong.44 PROCEDURE format_inv_rec IS 45 x_report_start_date := x_sysdate.sysdate; 46 -- x_report_end_date := x_sysdate.sysdate; 47 --x_inv_date := x_sysdate.sysdate; LINE/COL ERROR -------- ----------------------------------------------------------------- 45/32 PLS-00103: Encountered the symbol "=" when expecting one of the following: constant exception <an identifier> <a double-quoted delimited-identifier> table long double ref char time timestamp interval date binary national character nchar The symbol "<an identifier>" was substituted for "=" to continue.
Thanks in advance!I think you missed to mention the data type for variables.
PROCEDURE format_inv_rec IS x_report_start_date date := x_sysdate.sysdate; -- x_report_end_date date := x_sysdate.sysdate; --x_inv_date date := x_sysdate.sysdate;
In addition, as hoek said, are why complicate things?
-
Hello
I am trying to create a function inside the packaging.
In the Package BODY I've defined the function, but in the definition of the package, it gives me syntax errors.
- Error (15,3): PLS-00103: encountered the symbol ";" when expecting one of the following values: back
- Error (39.1): PLS-00103: encountered the symbol "END" when waiting for one of the following values: start the function pragma procedure subtype type current cursor removal exist prior
What can I do wrong here.
Thank you
Ken
Inner package BODY:
/ * FUNCTION to form the query * /.
FUNCTION UDF_FORMQUERY)
IN_CASEID VARCHAR2,
IN_SRCLYR VARCHAR2,
IN_SRC_CONDN VARCHAR2
)
RETURN VARCHAR2
AS
varSQLQuery VARCHAR2 (10000);
BEGIN
varSQLQuery: = "test query";
RETURN varSQLQuery;
DBMS_OUTPUT. Put_line (varSQLQuery);
END UDF_FORMQUERY;
Definition of package inside:
create or replace PACKAGE BODY MY_SQUERY
AS
FUNCTION UDF_FORMQUERY)
IN_CASEID VARCHAR2,
IN_SRCLYR VARCHAR2,
VARCHAR2 IN_SRC_CONDN( )
RETURN VARCHAR2
AS varSQLQuery VARCHAR2 (10000);
END MY_SQUERY;
your package definition is incorrect, you have included the part of the declaration of the variables of the function in the package definition. It should be like
FUNCTION UDF_FORMQUERY)
IN_CASEID VARCHAR2,
IN_SRCLYR VARCHAR2,
IN_SRC_CONDN VARCHAR2)
RETURN VARCHAR2;
-
Hi all
I get this error:
- Error (55,45): PLS-00103: encountered the symbol 'COLLECT' during the waited in the following way:. (, limiting the symbol ".") has been inserted before 'COLLECT' to continue.
While trying to create this procedure as below:
If I run the query, I get the result, but in the procedure, I am trying to convert the OUT_REFCURSOR in a table, but this error.
PROCEDURE SP_GETVALIDATE)
IN_CASEID IN VARCHAR2,
IN_REQID IN VARCHAR2,
OUT_REFCURSOR ON SYS_REFCURSOR)
AS
IS OF TYPE RECORDTYPE
RECORD (COL1, COL2 VARCHAR2 VARCHAR2);
IS OF TYPE TABLETYPE
THE REFTABLETYPE TABLE
INDEX BY PLS_INTEGER;
BEGIN
OPEN for SELECT OUT_REFCURSOR c.RCRD_NO, c.STE_NO_TX DE T_LYR_STES c, p of LAND WHERE c.case_id = IN_CASEID AND p.L_NUMBER > 100;
LOOP
Look FOR the OUT_REFCURSOR BULK COLLECT outtable;
WHEN the outtable OUTPUT. COUNT = 0;
FOR indx IN 1... outtable. COUNTY
LOOP
dbms_output.put_line (outtable (indx). ) RCRD_NO);
END LOOP;
END LOOP;
CLOSE OUT_REFCURSOR;
END SP_GETVALIDATE;
I could be wrong here.
any help appreciated.
Thank you
Ken
SEARCH OUT_REFCURSOR BULK COLLECT INTO outtable;
You've had your BULK COLLECT and the wrong way around
-
Try the Advanced installation of new ADR in a clean PDB 12 c (12.1.0.1) installation.
If someone had the same problem and a work around?
Error at startup to the line: 48 in command.
Start
run immediately "create user ORDS_PUBLIC_USER identified by ' ^ PUB_PWD ' account unlock default tablespace ^ temporary tablespace PUB_DATATBS ^ PUB_TEMPTBS';"
end;
Error report-
ORA-06550: Line 2, column 23:
PLS-00103: Fand das symbol "create user ORDS_PUBLIC_USER identified by 'mySecretPwd' als eines der following works wurde:
(- + new case mod not null < an ID >)
< between double quote delimited identifiers of > < a variable binding >
continue the current avg County are min max sql stddev prior
variance of the sum run forall fusion timestamp interval
Date < a literal string with the specified set of characters >
< a > < a SQL string between single quotes > hose
< ein alternativ in Anfuhrungszeichen geset
force_print
It seems to be related to the change here:
https://community.Oracle.com/thread/3731913
Finally the installation of ADR is running. However still not showing apex, but which appear to be a different problem.
Here is my solution to overcome the problem of creation of ORDS_PUBLIC_USER.
The problem was that they changed it to use execute_immediate. However, lexical surrogates have ' included.
Gives problems when adding to the string of immediate execution. And also problems for the password in quotation marks.
In the ords.war file to find the ords_create_rest_users.sql and replace the relevant parts marked with blue lines.
...
set PUB_PWD = ^ 1
set PUB_DATATBS = ' ^ 2'
set PUB_TEMPTBS = ' ^ 3'
ALTER session set current_schema = SYS;
-Remove user REST if exists
...
-Create user ORDS_PUBLIC_USER and unlock the account
create user ORDS_PUBLIC_USER identified by ' ^ PUB_PWD ' account unlock default tablespace ^ temporary tablespace PUB_DATATBS ^ PUB_TEMPTBS;
...
-
Getting error PLS-00103: encountered the symbol "MM".
SQL > create or replace procedure DIP. Insert_proc is
2 start
3 immediately execute "INSERT INTO DIP. RAKS (SELECT * FROM DIP.) RAKS WHERE CREATED BETWEEN to_char (TRUNC (ADD_MONTHS (SYSDATE-1), 'MM'), 'YYYYMMDD') AND to_char (TRUNC (LAST_DAY (ADD_MONTHS (SYSDATE-1))), 'YYYYMMDD')); "
4 run immediately "COMMITTED";
5 immediately execute "INSERT INTO DIP. RAKS (SELECT * FROM DIP.) RAKS WHERE CREATED BETWEEN to_char (TRUNC (ADD_MONTHS (SYSDATE-1), 'MM'), 'YYYYMMDD') AND to_char (TRUNC (LAST_DAY (ADD_MONTHS (SYSDATE-1))), 'YYYYMMDD')); "
6 immediate execution "COMMITTED";
7 end;
8.
CAUTION: Procedure created with compilation errors.
SQL >
SQL >
SQL > show error
DIP PROCEDURAL errors. INSERT_SIV_SELL_PROC:
LINE/COL ERROR
-------- -----------------------------------------------------------------
3/128 PLS-00103: encountered the symbol "MM" when awaits an of the
Next:
* & = - + ; <>/ is mod remains not return rem
return < an exponent (*) > <>or! = or ~ = > = < = <>and or
as like2 like4 likec between using | bulk of type multiset
Member submultiset
SQL >
any help appreciated.
CREATE OR REPLACE PROCEDURE DIP. Insert_proc IS
BEGIN
immediately execute "INSERT INTO DIP. RAKS (SELECT * FROM DIP.) RAKS WHERE CREATED BETWEEN to_char (TRUNC (ADD_MONTHS (SYSDATE-1), "MM"), "YYYYMMDD") AND to_char (TRUNC (LAST_DAY (ADD_MONTHS (SYSDATE-1))), "YYYYMMDD"))';
RUN IMMEDIATELY "COMMITTED";
immediately execute "INSERT INTO DIP. RAKS (SELECT * FROM DIP.) RAKS WHERE CREATED BETWEEN to_char (TRUNC (ADD_MONTHS (SYSDATE-1), "MM"), "YYYYMMDD") AND to_char (TRUNC (LAST_DAY (ADD_MONTHS (SYSDATE-1))), "YYYYMMDD"))';
run immediately "COMMITTED";
end;
/
Missing semicolon, I modified the last answer but you picked up before it was visible
-
Hello
I get the following error when I try to compile the procedure. I call a package inside this simple procedure. Not sure where I do worng. Here is the error I get.
Error (34.2): PLS-00103: encountered the symbol "END"?
Here is my code
create or replace PROCEDURE BATCH_JOB_CAC_SP
(
vstatus OUT NUMBER)
AS
vloadserver global_name.global_name%TYPE: = get_dbservername;
vuseridmod CONSTANT VARCHAR2 (15): = 'SYSTEM '.
vloadname CONSTANT VARCHAR2 (30): = "BATCH_JOB_CAC_SP";
v_cnt_upd NUMBER: = 0;
vrunid NUMBER;
v_spoutput VARCHAR2 (150);
CURSOR job_cac
IS
SELECT NumCli, job_cac FROM batch_job_cac, batch_recid, jobnum;
BEGIN
I'm in job_cac LOOP
job_cac_pkg.job_cac_valid_sp (i.custnum, i.jobnum, v_spoutput);
CASE v_spoutput
WHEN "1" THEN DBMS_OUTPUT. Put_line ('update job ACC');
WHEN "2" THEN DBMS_OUTPUT. Put_line ('update job ACC');
WHEN '3' THEN DBMS_OUTPUT. Put_line ('can not update working ACC');
OF ANOTHER DBMS_OUTPUT. Put_line (v_spoutput);
END CASE;
END LOOP;
EXCEPTION
WHILE OTHERS THEN
IF job_cac % isopen THEN
CLOSE Job_cac;
END IF;
ROLLBACK;
vStatus: = 1;
LOG_ERROR_SP_NM (vLoadServer, vLoadName, SQLCODE, SQLERRM, vUserIdMod);
END;
END BATCH_JOB_CAC_SP;
Thanks for your help.
Hello
You have 2 statements END at the bottom of your code, but only 1 BEGIN statement earlier.
Losing one of these END States.
-
Error PLS-00103 stored procedure: encountered the symbol «/»
HelloI'm trying this on Oracle 11 g on Centos 6.2 Express
Summer make mistakeERROR on line 1:
ORA-06550: line 1, column 7:
PLS-00103: encountered the symbol "/" when expecting one of the following values:
..
ERROR on line 1:
ORA-06550: line 1, column 7:
PLS-00103: encountered the symbol "/" when expecting one of the following values:For the following procedure, can someone help me?
CREATE OR REPLACE PROCEDURE bulkInsert()
AS
BEGIN
FOR x IN 1.100
LOOP
INSERT INTO arrested
(order_id, order_name, order_status)
VALUES
(x, 'Fish', 'Y');
END LOOP;
COMMIT;
END bulkInsert;
/concerning
Sameer44849b9b-03d8-4edd-bb18-e7f3e4fa4c6d wrote:
Creates a file named bulkoracleinput and I'm running to help run
/filename. If you want to run a SQL Script file in SQL more then you need to use the command @ and not the command EXECUTE.
Try like this
@
/filename. -
Why I got error PLS-00103 for this procedure?
Hey, guys:
I have a question about the syntax of the exception, I want to record the number of rows from the tables, but if there is no such thing as a table, my program must be able to continue the loop.
I'm your only syntax error:create or replace procedure check_rows as cursor t1 is select table_name from all_csv where table_built='Y' and table_name is not null; match_count1 INTEGER; begin for n in t1 loop dbms_output.put_line(n.table_name); EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM ' || n.table_name INTO match_count1 ; update all_csv set total_rows=match_count1 where table_name=n.table_name; exception when table_does_not_exist then null end; end loop; commit; end;
PLS-00103: encountered the symbol "EXCEPTION" when expected
of the following:
begin case declare end exit for goto if loop mod null pragma
raise return select update while < ID >
< between double quote delimited identifiers of > < a variable binding > < <
Close current delete fetch locking insert open rollback
SAVEPOINT SQLExecute set pipe fusion commit forall
Could someone give me a hint?
Thank you very much!
SamEXCEPTION clause should be at the end of the BEGIN block. It cannot start in the middle of the lock begin body:
create or replace procedure check_rows as cursor t1 is select table_name from all_csv where table_built='Y' and table_name is not null; match_count1 INTEGER; begin for n in t1 loop begin dbms_output.put_line(n.table_name); EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM ' || n.table_name INTO match_count1; update all_csv set total_rows = match_count1 where table_name = n.table_name; exception when table_does_not_exist then null; end; end loop; commit; end; /
And it is not a good idea to engage in the stored procedure. But the main question here is table_does_not_exist exception because it is not declared in your code. You must declare it and use PRAGMA EXCEPTION_INIT to connect with the desired error code.
SY.
-
PLS-00103: received the error on the create procedure
Dear all,
I created the view during this procedure, I got error.
1 PLS-00103: encountered the symbol "=" when expecting one of the following conditions:
constant exception < an ID >
< a between double quote delimited identifiers > double Ref table Fedya
timestam tank time
2 PLS-00103: encountered the symbol "SELECT" at the expected in the following way:
(- + new case mod not null other < an ID >)
< between double quote delimited identifiers of > < a variable binding > avg
3 PLS-00103: encountered the symbol ")" when expecting one of the following values:
. (* @ % & -+; / TA for rem rest mod)
< an exhibitor > (*) and or group having less cross order
Start uni
create or replace PROCEDURE PO_ITEM_BRANCH_PROC (ITEM_ID1 in NUMBER, BRANCH_CODE1 IN VARCHAR2, RESULT1 ON NUMBER, ERR_MSG OUT NVARCHAR2)
as
PERFORMANCE(1): = 0;
BEGIN
SELECT
Count (a.asset_number) in RESULT1
Of
FA_ADDITIONS HAS
C FA_CATEGORIES_VL
, FA_BOOKS B
FA_LOCATIONS FL
FA_DISTRIBUTION_HISTORY DH
FA_TRANSACTION_HEADERS TH
WHERE
A.ASSET_CATEGORY_ID = C.CATEGORY_ID
AND A.ASSET_ID = B.ASSET_ID
AND A.ASSET_ID = TH. ASSET_ID
AND TH. TRANSACTION_TYPE_CODE = "ADD."
AND B.TRANSACTION_HEADER_ID_IN = TH. TRANSACTION_HEADER_ID
AND B.ASSET_ID = TH. ASSET_ID
AND A.ASSET_ID = DH. ASSET_ID
AND DH. LOCATION_ID = FL. LOCATION_ID
AND TH. TRANSACTION_TYPE_CODE = "ADD."
- AND IN FLORIDA. SEGMENT4 = 'Shalimar Campus, Lahore.
AND TH. TRANSACTION_TYPE_CODE <>"FULL PENSION".
- AND IN FLORIDA. SEGMENT4 = (SELECT flex_value FROM fnd_flex_values WHERE attribut1 = '04010303')
AND A.ASSET_CATEGORY_ID IN)
SELECT
MSI.asset_category_id
Of
b po_requisition_lines_all,
MSI mtl_system_items_b
WHERE
b.ITEM_ID = msi. INVENTORY_ITEM_ID
AND msi.inventory_item_id (+) = B.item_id
AND msi.organization_id (+) = B.destination_organization_id
AND ITEM_ID = b.item_id
)
AND IN FLORIDA. SEGMENT4 =)
SELECT
(SELECT FLEX_VALUE FROM fnd_flex_values WHERE attribut1 = B.ATTRIBUTE2) GENERAL MANAGEMENT OF THE
Of
b po_requisition_lines_all,
MSI mtl_system_items_b
WHERE
b.ITEM_ID = msi. INVENTORY_ITEM_ID
AND msi.inventory_item_id (+) = B.item_id
AND msi.organization_id (+) = B.destination_organization_id
AND b.ATTRIBUTE2 = BRANCH_CODE
)
;
exception when others then
Mesg: = 'select failed in BILLTER.
err_msg: = mesg;
END;create or replace PROCEDURE PO_ITEM_BRANCH_PROC(ITEM_ID1 IN NUMBER, BRANCH_CODE1 IN VARCHAR2, RESULT1 OUT NUMBER, ERR_MSG OUT NVARCHAR2 ) as BEGIN RESULT1 := 0 ; SELECT count(a.asset_number) into RESULT1 FROM FA_ADDITIONS A, FA_CATEGORIES_VL C, FA_BOOKS B, FA_LOCATIONS FL, FA_DISTRIBUTION_HISTORY DH, FA_TRANSACTION_HEADERS TH WHERE A.ASSET_CATEGORY_ID = C.CATEGORY_ID AND A.ASSET_ID = B.ASSET_ID AND A.ASSET_ID = TH.ASSET_ID AND TH.TRANSACTION_TYPE_CODE = 'ADDITION' AND B.TRANSACTION_HEADER_ID_IN = TH.TRANSACTION_HEADER_ID AND B.ASSET_ID = TH.ASSET_ID AND A.ASSET_ID = DH.ASSET_ID AND DH.LOCATION_ID = FL.LOCATION_ID AND TH.TRANSACTION_TYPE_CODE = 'ADDITION' -- AND FL.SEGMENT4 = 'Shalimar Campus Lahore' AND TH.TRANSACTION_TYPE_CODE != 'FULL RETIREMENT' -- AND FL.SEGMENT4 = (SELECT flex_value FROM fnd_flex_values WHERE ATTRIBUTE1 = '04010303') AND A.ASSET_CATEGORY_ID IN (SELECT msi.asset_category_id FROM po_requisition_lines_all b, mtl_system_items_b msi WHERE b.ITEM_ID = msi.INVENTORY_ITEM_ID AND msi.inventory_item_id(+) = B.item_id AND msi.organization_id(+) = B.destination_organization_id AND b.item_id = ITEM_ID ) AND FL.SEGMENT4 = (SELECT (SELECT FLEX_VALUE FROM fnd_flex_values WHERE ATTRIBUTE1 = B.ATTRIBUTE2 ) BRANCH FROM po_requisition_lines_all b, mtl_system_items_b msi WHERE b.ITEM_ID = msi.INVENTORY_ITEM_ID AND msi.inventory_item_id(+) = B.item_id AND msi.organization_id(+) = B.destination_organization_id AND b.ATTRIBUTE2 = BRANCH_CODE ); exception when others then err_msg := 'select failed in BILLTER'; END ;
Concerning
Etbin
Edited by: Etbin on 21.4.2012 11:26
SorryEdited by: Etbin on 21.4.2012 12:02
reposted -
can you please tell me what I'm missing. I am getting error below.
Error(8,12): PLS-00103: Encountered the symbol "C_SEL" when expecting one of the following: := . ( @ % ;
CREATE OR REPLACE PACKAGE BODY "XXDL_PN_LOAD_EMP_ASSIGN_PKG" AS FUNCTION insert_pn_emp_space_assign RETURN NUMBER IS BEGIN CURSOR c_sel IS --NO RECORDS FOUND SELECT room_id , room_scheduler, benches, lab_type, room_num, floor_id , DEPARTMENT_NAME , room_eff_from_date , room_eff_to_date , org_id , pi_id , dept_pct , pi_pct , FUNCTIONAL_USE_PCT , RESEARCH_EXPLANATION , SUB_DEPT , FUNCTIONAL_USE_CODE , FUNCTIONAL_USE_DESCRIPTION , COUNT(1) FROM XXDL.XXDL_CD_FACILITY k WHERE pi_id NOT LIKE 'FMS%' --and floor_id ='00' --and pi_id='04309605' AND room_eff_to_date IS NULL -- and room_id ='07-590-02-2134' AND room_id NOT IN (SELECT location_code FROM PN_SPACE_ASSIGN_EMP_V WHERE emp_space_assign_id IS NOT NULL ) AND EXISTS ( SELECT DISTINCT location_code FROM pn_locations_all WHERE room_id=location_code --and nvl(to_date(room_eff_to_date,'Mon/dd/RRRR'),active_end_date)=active_end_date ) GROUP BY room_id , DEPARTMENT_NAME , room_scheduler, benches, lab_type, room_num, floor_id , room_eff_from_date , room_eff_to_date , org_id , pi_id , dept_pct , pi_pct , FUNCTIONAL_USE_PCT , RESEARCH_EXPLANATION , SUB_DEPT , FUNCTIONAL_USE_CODE , FUNCTIONAL_USE_DESCRIPTION HAVING COUNT(1)=1 ; CURSOR c_conc( p_room_id VARCHAR2 ,p_dept_name VARCHAR2 ,p_piid VARCHAR2 ,p_eff_date VARCHAR2 ) IS SELECT FUNCTIONAL_USE_PCT ATTRIBUTE5 , RESEARCH_EXPLANATION ATTRIBUTE6 , SUB_DEPT ATTRIBUTE7 , dept_pct ATTRIBUTE1 , pi_pct ATTRIBUTE2 , FUNCTIONAL_USE_CODE ATTRIBUTE3 , FUNCTIONAL_USE_DESCRIPTION ATTRIBUTE4 FROM XXDL.XXDL_CD_FACILITY WHERE room_id =p_room_id AND department_name =p_dept_name AND pi_id =p_piid AND 1 =2------not used AND room_eff_to_date IS NULL --and to_date(room_eff_to_date,'Mon/dd/RRRR')=to_date(p_eff_date,'Mon/dd/RRRR') ; l_person_id NUMBER; l_location_id NUMBER; l_parent_loc_id NUMBER; l_attribute5 VARCHAR2(500); l_attribute6 VARCHAR2(500); l_attribute7 VARCHAR2(500); l_attribute1 VARCHAR2(500); l_attribute2 VARCHAR2(500); l_attribute3 VARCHAR2(500); l_attribute4 VARCHAR2(500); BEGIN mo_global.set_policy_context('S',84); FOR c2 IN c_sel LOOP l_parent_loc_id:= NULL; BEGIN SELECT location_id INTO l_parent_loc_id -- NO RECORDS RETURNED FROM CURSOR FROM pn_locations_all WHERE location_alias = c2.floor_id AND location_type_lookup_code ='FLOOR'; EXCEPTION WHEN OTHERS THEN l_parent_loc_id:= NULL; END; l_location_id:= NULL; BEGIN SELECT location_id INTO l_location_id FROM pn_locations_all WHERE location_code = c2.room_id AND parent_location_id =l_parent_loc_id; EXCEPTION WHEN OTHERS THEN l_location_id:= NULL; END; l_attribute3:=NULL; l_attribute4:=NULL; l_attribute5:=NULL; l_attribute6:=NULL; l_attribute7:=NULL; FOR c3 IN c_conc(c2.room_id,c2.department_name,c2.pi_id,c2.room_eff_to_date) LOOP -- IF l_attribute5 IS NULL THEN l_attribute5 :=c3.attribute3||'.'||c3.attribute5; ELSE IF c3.attribute5 IS NOT NULL THEN l_attribute5 :=l_attribute5||','||c3.attribute3||'.'||c3.attribute5; END IF; END IF; -- IF l_attribute6 IS NULL THEN IF c3.attribute6 IS NOT NULL THEN l_attribute6 :=c3.attribute3||'.'||c3.attribute6; END IF; ELSE IF c3.attribute6 IS NOT NULL THEN l_attribute6 :=l_attribute6||','||c3.attribute3||'.'||c3.attribute6; END IF; END IF; IF l_attribute7 IS NULL THEN IF c3.attribute7 IS NOT NULL THEN l_attribute7 :=c3.attribute3||'.'||c3.attribute7; END IF; ELSE IF c3.attribute7 IS NOT NULL THEN l_attribute7 :=l_attribute7||','||c3.attribute3||'.'||c3.attribute7; END IF; END IF; --functional code IF l_attribute3 IS NULL THEN l_attribute3 :=c3.attribute3; ELSE IF c3.attribute3 IS NOT NULL THEN l_attribute3 :=l_attribute3||','||c3.attribute3; END IF; END IF; --functional desc IF l_attribute4 IS NULL THEN l_attribute4 :=c3.attribute4; ELSE IF c3.attribute4 IS NOT NULL THEN l_attribute4 :=l_attribute4||','||c3.attribute4; END IF; END IF; END LOOP; l_person_id:=NULL; BEGIN SELECT person_id INTO l_person_id FROM per_all_people_f WHERE employee_number=c2.pi_id AND sysdate BETWEEN effective_start_date AND effective_end_date ; EXCEPTION WHEN OTHERS THEN l_person_id:=NULL; END; insert into PN_EMP_SPACE_ASSIGN_ITF ( BATCH_NAME ,ENTRY_TYPE ,EMP_SPACE_ASSIGN_ID ,LOCATION_ID ,EMPLOYEE_ID ,COST_CENTER_CODE ,ALLOCATED_AREA ,LAST_UPDATE_DATE ,LAST_UPDATE_LOGIN ,CREATED_BY ,CREATION_DATE ,LAST_UPDATED_BY ,ATTRIBUTE_CATEGORY ,ATTRIBUTE1 ,ATTRIBUTE2 ,ATTRIBUTE3 ,ATTRIBUTE4 ,ATTRIBUTE5 ,ATTRIBUTE6 ,ATTRIBUTE7 ,ATTRIBUTE8 ,ATTRIBUTE9 ,ATTRIBUTE10 ,ATTRIBUTE11 ,ATTRIBUTE12 ,ATTRIBUTE13 ,ATTRIBUTE14 ,ATTRIBUTE15 ,TRANSFERRED_TO_CAD ,TRANSFERRED_TO_PN ,ERROR_MESSAGE ,SOURCE ,REQUEST_ID ,PROGRAM_APPLICATION_ID ,PROGRAM_ID ,PROGRAM_UPDATE_DATE ,EMP_ASSIGN_START_DATE ,EMP_ASSIGN_END_DATE ,UTILIZED_AREA ,CHANGE_DATE ,CHANGE_MODE ,PROJECT_ID ,TASK_ID ) values--custom table columns ( '07-590_floor_bulk_spc' --BATCH_NAME ,'A' --ENTRY_TYPE ,PN_SPACE_ASSIGN_EMP_S.nextval --EMP_SPACE_ASSIGN_ID ,l_location_id --LOCATION_ID ,l_person_id --EMPLOYEE_ID ,1028389 --COST_CENTER_CODE ,0 --ALLOCATED_AREA ,sysdate --LAST_UPDATE_DATE ,157092 --LAST_UPDATE_LOGIN ,157092 --CREATED_BY ,sysdate --CREATION_DATE ,157092 --LAST_UPDATED_BY ,null --ATTRIBUTE_CATEGORY ,c2.dept_pct --ATTRIBUTE1 ,c2.pi_pct --ATTRIBUTE2 ,C2.FUNCTIONAL_USE_CODE --ATTRIBUTE3 ,C2.FUNCTIONAL_USE_DESCRIPTION --ATTRIBUTE4 ,C2.FUNCTIONAL_USE_PCT --ATTRIBUTE5 ,C2.RESEARCH_EXPLANATION --ATTRIBUTE6 ,C2.SUB_DEPT --ATTRIBUTE7 ,null --ATTRIBUTE8 ,null --ATTRIBUTE9 ,null --ATTRIBUTE10 ,c2.ORG_Id||'-'||c2.DEPARTMENT_NAME --ATTRIBUTE11 ,null --ATTRIBUTE12 ,null --ATTRIBUTE13 ,null --ATTRIBUTE14 ,null --ATTRIBUTE15 ,null --TRANSFERRED_TO_CAD ,null --TRANSFERRED_TO_PN ,null --ERROR_MESSAGE ,'TST' --SOURCE ,null --REQUEST_ID ,null --PROGRAM_APPLICATION_ID ,null --PROGRAM_ID ,null --PROGRAM_UPDATE_DATE ,to_date(c2.room_eff_from_date,'mon/dd/RRRR') --EMP_ASSIGN_START_DATE ,to_date(c2.room_eff_to_date,'mon/dd/RRRR') --EMP_ASSIGN_END_DATE ,null --UTILIZED_AREA ,null --CHANGE_DATE ,null --CHANGE_MODE ,null --PROJECT_ID ,null --TASK_ID --07-590-02-ELEV02 ); END LOOP; RETURN 1; EXCEPTION WHEN OTHERS THEN FND_FILE.PUT_LINE(FND_FILE.LOG,'Error while insert_pn_emp_space_assign - '||sqlerrm); RETURN 0; END; WHEN OTHERS THEN FND_FILE.PUT_LINE(FND_FILE.LOG,'Error while insert_pn_emp_space_assign - '||sqlerrm); RETURN 0; END insert_pn_emp_space_assign; END XXDL_PN_LOAD_EMP_ASSIGN_PKG;
893185 wrote:
can you please tell me what I'm missing. I am getting error below.Error(8,12): PLS-00103: Encountered the symbol "C_SEL" when expecting one of the following: := . ( @ % ;
CREATE OR REPLACE PACKAGE BODY "XXDL_PN_LOAD_EMP_ASSIGN_PKG" AS FUNCTION insert_pn_emp_space_assign RETURN NUMBER IS BEGIN
delete 'START' of the previous line
-
Try to run the procedure and get an error PLS-00103
I have a procedure defined with these parameters
create or replace PROCEDURE procAuth
(
EMAIL IN VARCHAR2,
PASSWORD IN VARCHAR2,
IP IN VARCHAR2,
UL NUMBER
)
Using this code
var x number
procAuth exec ('[email protected]', ' 555555 ', ' 1.1.1.1': x);
print x
gives me
Error at startup on line 2 of the command:
procAuth exec ('[email protected]', ' 555555 ', ' 1.1.1.1': x);
Error report:
ORA-06550: line 1, column 65:
PLS-00103: encountered the symbol "" when expecting one of the following values:
. ( ) , * @ % & | = + - <>/ at is mod not rank rem = >
.. < an exponent (*) > <>or! = or ~ = > = < = <>and or as
between |
The symbol ',' was replaced by ' ' to continue.
06550 00000 - "line %s, column % s:\n%s".
* Cause: Usually a PL/SQL compilation error.
* Action:
x
------
Thanks for any helpjerry8989 wrote:
I have a procedure defined with these parameterscreate or replace PROCEDURE procAuth
(
EMAIL IN VARCHAR2,
PASSWORD IN VARCHAR2,
IP IN VARCHAR2,
UL NUMBER
)Using this code
var x number
exec procAuth (' [email protected]', '555555',' 1.1.1.1': x);
print xgives me
Error at startup on line 2 of the command:
exec procAuth (' [email protected]', '555555',' 1.1.1.1': x);a comma is perhaps missing to the right of the right like apostrophe below?
procAuth exec ('[email protected]', ' 555555 ', ' 1.1.1.1',: x);
-
Error PLS-00103 and the program has stopped responding
Hey all, I am currently practical with pl/sql, I am a beginner trying to pl/sql self-training, I use the HR schema that accompanies the express edition of oracle 10g for practice, here is my code:
-- -------------------------------------------------------------------------------------------
FUNCTION to CREATE or REPLACE checkIfSalaryExceedMin (currentJobID in NUMBER, currentProposedSalary number)
RETURN BOOLEAN IS
minSalary NUMBER: = 0;
Begin
Select j.min_salary FROM minSalary of JOB j where j.job_id = currentJobID;
RETURN currentProposedSalary > minSalary;
End checkIfSalaryExceedMin;
-- -------------------------------------------------------------------------------------------
-- -------------------------------------------------------------------------------------------
FUNCTION to CREATE or REPLACE checkForJobChange (currentEmpID in NUMBER, currentEmpStartDate IN DATE)
RETURN BOOLEAN IS
CURSOR emp_date_id_list1 IS (Select j1.start_date, e1.employee_id JOB_HISTORY j1 EMPLOYEES JOIN e1 ON j1.employee_id = e1.employee_id);
checkVal NUMBER: = 0;
Begin
For em1 IN LOOP emp_date_id_list1
IF (currentEmpID = em1.employee_id AND currentEmpStartDate! = em1.start_date) THEN
checkVal: = 1;
END IF;
END LOOP;
IF checkVal = 1 THEN
RETURN TRUE;
ELSIF checkVal = 0 THEN
RETURN FALSE;
END IF;
End checkForJobChange;
-- -------------------------------------------------------------------------------------------
-- ===================MAIN====================
Declare
CURSOR emp_date_id_list IS (Select j.start_date, e.employee_id, e.job_id, e.salary JOB_HISTORY e j EMPLOYEES JOIN ON j.employee_id = e.employee_id);
Begin
For em IN emp_date_id_list LOOP
IF (em.start_date < TO_DATE ('1990-01-01', 'YYYY-MM-DD')) THEN
IF (checkForJobChange (em.employee_id, em.start_date)) THEN
IF checkIfSalaryExceedMin (em.job_id, (e.salary + (e.salary*.20))) THEN
DBMS_OUTPUT. Put_line ('you can increase his salary');
END IF;
END IF;
END IF;
END LOOP;
End;
-- ================END==MAIN==================
What it does is check if the employee worked prior to January 1, 1990, if he had had a change of job and if it fulfills the two conditions, the program checks if its proposed new salary will be larger than his salary manager current, if not he can get a pay raise.
So my problem is I got an error PLS-00103 earlier, after some tweaking my program now is insensitive, what am I doing wrong? :(
Help, please. Thank you.checkIfSalaryExceedMin (currentJobID in NUMBER
Must be:
checkIfSalaryExceedMin (currentJobID in VARCHAR2
or:
checkIfSalaryExceedMin (currentJobID IN employees.job_id%type
Since then job_id is of data type VARCHAR2 and not a NUMBER.
Also
IF checkIfSalaryExceedMin (em.job_id, (e.salary + (e.salary*.20))) THEN
must be:
IF checkIfSalaryExceedMin (em.job_id, (em.salary + (em.salary*.20))) THEN
After some tweaking my program does not
I've been juggling as well and are unaware of any 'unresponsiveness':
SQL> declare 2 cursor emp_date_id_list 3 is 4 select j.start_date 5 , e.employee_id 6 , e.job_id 7 , e.salary 8 from job_history j 9 join employees e 10 on j.employee_id = e.employee_id; 11 begin 12 for em in emp_date_id_list 13 loop 14 if (em.start_date < to_date('1990-01-01', 'YYYY-MM-DD')) 15 then 16 if (checkforjobchange(em.employee_id, em.start_date)) 17 then 18 if checkifsalaryexceedmin(em.job_id, (e.salary + (e.salary * .20))) 19 then 20 dbms_output.put_line('You can raise his salary'); 21 end if; 22 end if; 23 end if; 24 end loop; 25 end; 26 / if checkifsalaryexceedmin(em.job_id, (e.salary + (e.salary * .20))) * ERROR at line 18: ORA-06550: line 18, column 47: PLS-00201: identifier 'E.SALARY' must be declared ORA-06550: line 18, column 9: PL/SQL: Statement ignored SQL> declare 2 cursor emp_date_id_list 3 is 4 select j.start_date 5 , e.employee_id 6 , e.job_id 7 , e.salary 8 from job_history j 9 join employees e 10 on j.employee_id = e.employee_id; 11 begin 12 for em in emp_date_id_list 13 loop 14 if (em.start_date < to_date('1990-01-01', 'YYYY-MM-DD')) 15 then 16 if (checkforjobchange(em.employee_id, em.start_date)) 17 then 18 if checkifsalaryexceedmin(em.job_id, (em.salary + (em.salary * .20))) 19 then 20 dbms_output.put_line('You can raise his salary'); 21 end if; 22 end if; 23 end if; 24 end loop; 25 end; 26 / declare * ERROR at line 1: ORA-06502: PL/SQL: numeric or value error: character to number conversion error ORA-06512: at line 18 SQL> create or replace function checkifsalaryexceedmin(currentjobid in employees.job_id%typ e 2 ,currentproposedsalary in number) 3 return boolean is 4 5 minsalary number := 0; 6 7 begin 8 9 select j.min_salary 10 into minsalary 11 from jobs j 12 where j.job_id = currentjobid; 13 14 return currentproposedsalary > minsalary; 15 16 end checkifsalaryexceedmin; 17 / Function created. SQL> declare 2 cursor emp_date_id_list 3 is 4 select j.start_date 5 , e.employee_id 6 , e.job_id 7 , e.salary 8 from job_history j 9 join employees e 10 on j.employee_id = e.employee_id; 11 begin 12 for em in emp_date_id_list 13 loop 14 if (em.start_date < to_date('1990-01-01', 'YYYY-MM-DD')) 15 then 16 if (checkforjobchange(em.employee_id, em.start_date)) 17 then 18 if checkifsalaryexceedmin(em.job_id, (em.salary + (em.salary * .20))) 19 then 20 dbms_output.put_line('You can raise his salary'); 21 end if; 22 end if; 23 end if; 24 end loop; 25 end; 26 / You can raise his salary You can raise his salary PL/SQL procedure successfully completed.
-
Error (8.3): PLS-00103: encountered the symbol "END".
Migration to CREATE or REPLACE PACKAGE
IS
PROCEDURE load_staging_tables;
Migration of the END;
/
Migration to CREATE or REPLACE PACKAGE BODY
IS
PROCEDURE load_staging_tables
IS
Date of LAST_CREATE_DATE;
BEGIN
LAST_CREATE_DATE: = max (migrate_load_dt) select mgur;
END load_staging_tables;
Migration of the END;
/
The following error is received:
Error (8.3): PLS-00103: encountered the symbol "END".
running in 11 g using sql developer.
Which is wrong with the script?You cannot assign your select statement directly to a variable. You can use an INTO clause in your select statement.
CREATE OR REPLACE PACKAGE BODY migration IS PROCEDURE load_staging_tables IS LAST_CREATE_DATE date; BEGIN --LAST_CREATE_DATE := select max(migrate_load_dt) from mgur; select max(migrate_load_dt) into LAST_CREATE_DATE from mgur; END load_staging_tables; END migration;
-
Get the error PLS-00103 while specifying the Type of package
Hey bud,
All by specifying a Type which is the table of a different type, in the same package, I get an error in my PL Sql Developer, saying:
Errors of compilation for the OASIS_TST PACKAGE. PK_OA
Error: PLS-00103: encountered the symbol "TABLE" when awaits one of the following values:
opaque object
Line: 61
Text: as a table of tp_report;
Here are the specs of my package where the respective Types are declared:
************************************************************************
create or replace package pk_oa
is
function (report)
as in pd_date)
return tp_tab in pipeline;
type tp_report
as an object
*(*
ID INT,
last_nm VARCHAR2 (50).
first_nm VARCHAR2 (50).
full_nm VARCHAR2 (50));
type tp_tab
as the table of tp_report;
end;
**************************************************************
Could you find where I'm wrong with this piece.
Thank you
HPYou must create types of objects outside packages:
SQL> create or replace type tp_report 2 as object( 3 id INT, 4 last_nm VARCHAR2(50), 5 first_nm VARCHAR2(50), 6 full_nm VARCHAR2(50)); 7 / Typ wurde erstellt. SQL> create or replace package pk_oa 2 is 3 4 type tp_tab 5 is table of tp_report; 6 7 function report ( 8 pd_date in date) 9 return tp_tab pipelined; 10 11 end; 12 / Package wurde erstellt.
URS
Maybe you are looking for
-
How to change remember password for the site.
When the password has been updated, the memory of password has not changed. (Field 'Remember password?' did not.) I need to update password to remember. (Firefox on Windows 8.1)
-
On startup, I get the spinning wheel and the Apple. When all the (white) blue screen remains. If I hit the F button for iTunes it will come back with the line of menu above. I can then use the file menu to open recent files and disks, but this is t
-
Just bought a new iPad 2 Air to replace an old iPad 2 (which iOS 9.2). My old iPad has been saved using iCloud and sync with iTunes. During the implementation in place of the new iPad that I came to the part where I can choose which device to use iCl
-
I understand that to read a text file and display the table resulting in a control, you must use the nodes property. I've set up the VI to do exactly this. Now, however, I want to be able to modify the control so that the indicator changes as well. A
-
I have windows vista Enterprise edition and trying to connect to a PPTP VPN, I get an error 691 name of user and password are fine, I can connect to the VPN on XP without problem. original title: VPN Error 691