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
Sorry
Edited by: Etbin on 21.4.2012 12:02
reposted
Tags: Database
Similar Questions
-
has encountered an error "PLS-00103: encountered the symbol"CREATE"when expec".
Hi all
I am creating a procedure and try to use the temporary table...
Here is the code:
--------------------------------------------------------------------------------------------------------------------------------------------
PROCEDURE P_PARENT_TREE
(
topic_id_in in NUMBERS
topic_hierarchy_details_out ON SYS_REFCURSOR
) IS
temp_children_level topic_children.children_level%TYPE;
temp_children_id topic_children.children_id%TYPE;
temp_topic_id topic.topic_id%TYPE;
CURSOR c_child_level IS
SELECT children_level, children_id
OF topic_children
WHERE children_id = topic_id_in;
BEGIN
OPEN c_child_level.
EXTRACT c_child_level INTO temp_children_level, temp_topic_id;
CLOSE C_child_level;
Topic_child CREATE TEMPORARY TABLE IF NOT EXISTS
(t_topic_id, NUMBER, NUMBER, children_seq NUMBER of t_children_id);
WHILE temp_children_level > 0
LOOP
INSERT INTO topic_child (t_topic_id, t_children_id, children_seq)
values)
SELECT topic_id, children_id, children_level
OF topic_children
WHERE children_id = temp_topic_id);
temp_children_level: = temp_children_level - 1;
END LOOP;
OPEN FOR Topic_hierarchy_details_out
Select * from topic_child;
END P_PARENT_TREE;
END TOPIC_PKG;
--------------------------------------------------------------------------------------------------------------------------------------------
the error "PLS-00103: encountered the symbol"CREATE"when expec...
no idea why? or can be is there another way to write this queryCan you post some examples of data? And the expected results?
Looks like you can use a hierarchical query (START WITH... CONNECT BY), and that you do not have a Temp table (like I said before very rare in Oracle) -
Error [PLS-00103: encountered the symbol "CREATE"] using PACKAGE
Hi guys!
When I compile this package, I get this error:
PLS-00103: encountered the symbol "CREATE".
How can I solve this problem?
The compiled code is below:
CREATE OR REPLACE
PACKAGE CAMPO_PACK AS
TYPE T_CURSOR IS REF CURSOR;
PROCEDURE DeleteCode (OSDP NUMBER);
END CAMPO_PACK;
-body-
CREATE or REPLACE PACKAGE BODY CAMPO_PACK as
PROCEDURE DeleteCode(pCod NUMBER) AS
BEGIN
DELETE FROM campo
WHERE cod = OSDP;
END DeleteCode;
END CAMPO_PACK;
Thanks for the help,
Anderson
Published by: user8723300 on 08/13/2009 17:03
Published by: user8723300 on 08/13/2009 17:04I use Oracle SQL Developer
I know very well of this tool.
The packet header and body are two separate objects and must be compiled separately. I suspect that the package body is somehow have included in package header and Developer SQL tries to compile all of these at once. You must understand how to compile the header first, then the body. Your code compiles if I use sqlplus. I had to first create the table, so I have included a slash (/) after the packet header and the other after that body. The slash tells sql more to run the buffer (in this case, to compile the object).
SQL> create table campo (cod number); Table created. SQL> CREATE OR REPLACE 2 PACKAGE CAMPO_PACK AS 3 4 TYPE T_CURSOR IS REF CURSOR; 5 6 PROCEDURE DeleteCode(pCod NUMBER); 7 8 END CAMPO_PACK; 9 / Package created. SQL> CREATE OR REPLACE PACKAGE BODY CAMPO_PACK AS 2 3 PROCEDURE DeleteCode(pCod NUMBER) AS 4 BEGIN 5 DELETE FROM campo 6 WHERE cod = pcod; 7 END DeleteCode; 8 9 END CAMPO_PACK; 10 / Package body created.
If I remove the slash after the package header, sql more trying to compile all this at once, and I get the same error you get:
SQL> CREATE OR REPLACE 2 PACKAGE CAMPO_PACK AS 3 4 TYPE T_CURSOR IS REF CURSOR; 5 6 PROCEDURE DeleteCode(pCod NUMBER); 7 8 END CAMPO_PACK; 9 10 CREATE OR REPLACE PACKAGE BODY CAMPO_PACK AS 11 12 PROCEDURE DeleteCode(pCod NUMBER) AS 13 BEGIN 14 DELETE FROM campo 15 WHERE cod = pcod; 16 END DeleteCode; 17 18 END CAMPO_PACK; 19 / Warning: Package created with compilation errors. SQL> sho err Errors for PACKAGE CAMPO_PACK: LINE/COL ERROR -------- ----------------------------------------------------------------- 9/1 PLS-00103: Encountered the symbol "CREATE"
-
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;
-
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
-
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.
-
PLS-00103: encountered the symbol "create".
"I have a code below for which I get an error: 17/2 PLS-00103: encountered the symbol"create""
I copied the code of a manual and annot figure out why it doesn't work.
Plase help, thanks :)
============================
create or replace package course_pkg AS
type course_rec_typ IS RECORD
(name, student.first_name%TYPE,
student.last_name%type last_name,
course_no course.course_no%type,
Description course.description%type,
section_no section.section_no%type
);
type course_cur is ref cursor return course_rec_typ;
procedure get_course_list
(p_student_id NUMBER,
p_instructor_id NUMBER,
course_list_cv IN OUT course_cur);
end course_pkg;
create or replace package body course_pkg AS
procedure get_course_list
(p_student_id NUMBER,
p_instructor_id NUMBER,
course_list_cv IN OUT course_cur)
is
Start
If p_student_id is null and p_instructor_id
is null then
Open the course_list_cv for
Select 'Please choose a student -' first_name,
'combination instructor' last_name,.
Course_no NULL,
Description NULL,
Section_no NULL
Double;
elsif p_student_id is null then
Open the course_list_cv for
Select first_name s.first_name
s.last_name last_name,
c.course_no course_no,
description of the c.Description,
se.section_no section_no
instructor, I, s student, section se, courses, e-registration
where i.instructor_id = p_instructor_id
and i.instructor_id = se.instructor_id
and se.course_no = c.course_no
AND e.student_id = s.student_id
AND e.section_id = se.section_id
order of c.course_no, se.section_no;
elsif p_instructor_id is NULL then
Open the course_list_cv for
Select first_name i.first_name
i.last_name last_name,
c.course_no course_no,
description of the c.Description,
se.section_no section_no
Instructor, I, s student, section se, courses, e-registration
where s.student_id = p_student_id
AND e.instructor_id = se.instructor_id
and se.course_no = c.course_no
and e.student_id = s.student_id
and e.section_id = se.section_id
order of c.course_no, se.section_no;
END IF;
END get_course_list;
end course_pkg;
/In the code you posted, you have only 1 slash - at the end of the package body.
You must compile the spec and body separately.
They can be in the same script file if you wish, but there must be a slash after the spec code and once after the code of the organization.
-
Hey Geeks,
I am trying to execute the procedure from the SQL Developer, but these errors are coming. What can I do wrong here...
Procedure works fine when I run the compilation and debugging mode. But I need to put later in the c# code.
SET serveroutput on;
DECLARE
OutParam1 to SYS_REFCURSOR;
OutParam2 ON Varchar;
BEGIN
/ * Call procedure package * /.
SPAT_QUERY. SP_VALIDATERULES (9, 'BIS2015001', OutParam1, OutParam2);
/ * Display parameters * /.
dbms_output.put_line ('OutParam1: ' |) OutParam2);
END;
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Error report-
ORA-06550: line 3, column 20:
PLS-00103: encountered the symbol "SYS_REFCURSOR" during the expected in the following way:
:= . (@ %; not null default range character)
06550 00000 - "line %s, column % s:\n%s".
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Procedure below:
create or replace PACKAGE SPAT_QUERY of BODY
AS
/ * Declare a global variable to hold the result of the Validation. */
valResult varchar (10);
PROCEDURE SP_VALIDATERULES)
IN_RQST_NUM NUMBER,
IN_CASEID IN VARCHAR,
OUT_REFCURSOR ON SYS_REFCURSOR,
OUT_VAL_RSLT ON VARCHAR
)
AS
p_rc sys_refcursor;
I have NUMBER: = 0;
/ * Logical query - a loop in the Table of RULES based on request NUM * /.
BEGIN
FOR rec IN (SELECT * FROM T_RULES where RQST_NUM = IN_RQST_NUM)
LOOP
i: = i + 1;
SP_GETSECTS (IN_CASEID, rec. LYR_TX, rec. TRGT_TX, rec. EXCPTD_RSLT_CD, p_rc);
OUT_VAL_RSLT: = valResult;
END LOOP;
END SP_VALIDATERULES;
Thank you
Ken
in anonymous block, variables cannot be defined in the form. IN and OUR are not variable parameters type
Change your code to
DECLARE
OutParam1 SYS_REFCURSOR;
OutParam2 Varchar;
-
PLS-00103: encountered the symbol "PROCÉDURE" when expected
Hi all
LINE/COL ERROR
-------- -----------------------------------------------------------------
13/5 PLS-00103: encountered the symbol "BEGIN" when expecting one of
What follows:
language
22/4 PLS-00103: encountered the symbol "PROCÉDURE" when expected
of the following:
not end up dominant static of final instantiable order pragma
manufacturer membership card
The symbol "static" was substituted for "PROCEDURE continue.
create or replace package xx_extract as procedure xxc_process; procedure xxc_get(in_id emp.empno%type, in_number emp.deptno%type); end ;
create or replace package xx_extract as cursor v_cursor is select empno,deptno from emp a,dept d where e.deptno=d.deptno; v_cursor_rec v_cursor%rowtype; v_in_number emp.empno%type; v_in_date emp.hiredate%type; procedure xxc_process is Begin xxc_get(v_cursor_rec.empno,v_cursor_rec.deptno); open v_cursor; loop fetch v_cursor into v_cursor_rec; exit when v_cursor%notfound; end loop; close v_cursor; end xxc_process; procedure xxc_get(in_id emp.empno%type, in_number emp.deptno%type) is begin select empno,hiredate into v_in_number,v_in_date from emp where empno=to_char(in_id) and deptno=to_char(in_number); EXCEPTION WHEN NO_DATA_FOUND THEN in_id := NULL; in_number := NULL; end xxc_get; end xx_extract;
994122 wrote:
The code below displays all values where I called the procedure before the stmt Open why? Can u please explain.
PROCEDURE xxc_process
IS
BEGIN
xxc_get (v_cursor_rec.empno, v_cursor_rec.deptno);
OPEN v_cursor;
because v_cursor_rec.empno and v_cursor_rec.deptno are empty at this time
994122 wrote:
But as suggested as Roger why we named as below? I need the output when I ran the package and I don't want to call (run) as below
Start
xx_extract.xxc_process ();
end;
the begin... end; box IS running the package, what you do with the create command are CREATION (storage) a package.
-
I want to send an e-mail message using pl/sql and write the following code, but while compling, error must be occure
"Failure of compilation, line 5 (11:02:10).
PLS-00103: encountered the symbol "PortNumber" when expecting one of the following values:; "with authid as order of external assistance cluster parallel_enable deterministic result_cache pipeline."
create or replace procedure SEND_TEST_EMAIL
(mailhost IN VARCHAR2 default 'smtp.exchangesetup.com',
sender VARCHAR2 default '[email protected] '.
recipient in VARCHAR2 default '[email protected]')
port_number in default number 25
)
is
BEGIN
8 mail_conn: = UTL_SMTP. OPEN_CONNECTION (mailhost, 25);
9 UTL_SMTP. HELO (mail_conn, mailhost);
10 UTL_SMTP. MAIL (mail_conn, sender);
11 UTL_SMTP. RCPT (recipient, mail_conn);
12
13 UTL_SMTP. OPEN_DATA (mail_conn);
14 UTL_SMTP. WRITE_DATA (mail_conn, "it is a test message.");
15 UTL_SMTP. WRITE_DATA (mail_conn, 'It is the 2 line.');
16 UTL_SMTP. CLOSE_DATA (mail_conn);
21 UTL_SMTP. Quit (mail_conn);
22 EXCEPTION
23 SO THAT OTHERS THEN
25 NULL;
26 END;NOT TESTED
Describe below in the part of the statementmail_conn UTL_SMTP.CONNECTION;
as
CREATE OR REPLACE PROCEDURE SEND_TEST_EMAIL (mailhost IN VARCHAR2 DEFAULT 'smtp.exchangesetup.com', sender VARCHAR2 DEFAULT '[email protected]', recipient IN VARCHAR2 DEFAULT '[email protected]', -----code change , removed ')' add ',' port_number IN NUMBER DEFAULT 25 ) IS mail_conn UTL_SMTP.CONNECTION; -----code change added mail_conn UTL_SMTP.CONNECTION; BEGIN mail_conn := UTL_SMTP.OPEN_CONNECTION(mailhost, 25); UTL_SMTP.HELO(mail_conn, mailhost); UTL_SMTP.MAIL(mail_conn, sender); UTL_SMTP.RCPT(mail_conn, recipient); UTL_SMTP.OPEN_DATA(mail_conn); UTL_SMTP.WRITE_DATA(mail_conn, 'This is a test message.' ); UTL_SMTP.WRITE_DATA(mail_conn, 'This is line 2.'); UTL_SMTP.CLOSE_DATA(mail_conn); UTL_SMTP.QUIT(mail_conn); EXCEPTION WHEN OTHERS THEN NULL; END;
-
PLS-00103: encountered the symbol "ALTER".
I receive he following error when I run this script
DECLARE
vcount NUMBER (1);
BEGIN
SELECT count (*) IN the all_col_comments vcount
WHERE owner = 'myUser' and Table_Name = 'table1' and column_name = 'col1 ';
IF vcount = 0 THEN
ALTER TABLE myUser.table1
ADD (col1 varchar2 (1) DEFAULT ' is NOT NULL);
END IF
END;
Error report:
ORA-06550: line 7, column 4:
PLS-00103: encountered the symbol "ALTER" when expecting one of the following conditions:
(begin case declare exit for goto if loop mod null pragma
raise return select update while < ID >
< between double quote delimited identifiers of > < a variable binding > < <
continue the narrow current delete fetch locking insert open rollback
savepoint sql set run commit forall fusion pipe purge
The symbol 'lock has been inserted before "ALTER" to continue.
ORA-06550: line 8, column 11:
PLS-00103: encountered the symbol "(" quand attend une deles de valeurs suivantes:) "
, in
ORA-06550: line 8, column 47:
PLS-00103: encountered the symbol "NULL" when expected in the following way:
as like2 like4 likec between Member submultiset
06550 00000 - "line %s, column % s:\n%s".
* Cause: Usually a PL/SQL compilation error.There is no need to pack the column names in the TOP, the names of the objects are stored by default at the top of case. Isn't that quoted strings must be upper case, but yes, your last block is basically my second block and will correctly find the column already exists when it is executed a second time. Your original, with tiny strings cited would never return a line fomr the query on the column, so would attempt to add the column each time.
SQL> select table_name, column_name 2 from all_tab_columns 3 where owner = 'ops$oracle' and 4 table_name = 'table1' and 5 column_name = 'col1'; no rows selected SQL> select table_name, column_name 2 from all_tab_columns 3 where owner = 'OPS$ORACLE' and 4 table_name = 'TABLE1' and 5 column_name = 'COL1'; TABLE_NAME COLUMN_NAME ------------------------------ ------------------------------ TABLE1 COL1
See the difference?
(I only did the drop table so that I can redo the pl/sql block from scratch to show that was) the first time he ran he added the column and b) for subsequent executions, he did not attempt to add the column because it exists, unlike your first display.
However, scripts that add columns to tables should, in general, not be something that is executed repeatedly. More often by adding a column to a table would be part of a process of controlled upgrade, and most of the time, the fact that a 'new' column already exists in the database before the upgrade seems to indicate a problem with the upgrade process, and probably not something to be ignored in silent mode.
John
-
To the help of functions - PLS-00103 encountered the symbol "="
Hi all
I am trying to create a simple function (or stored procedure) in Oracle. But when I compile, I get the PLS-00103 met the error of symbol '='. I knew that my procedure contains errors, but can someone he report? My procedure is shown below.
Line 1: CREATE OR REPLACE FUNCTION FNAME)
Line 2: FLOAT, INIVAL
Line 3: FINVAL FLOAT
Line 4 :)
Line 5: RETURN FLOAT
Line 6: AS
Line 7: START
Line 8: DECLARE VL_LEN: = LENGTH (TO_CHAR (ROUND (INIVAL))); <-error
Line 9: IF FINVAL > INIVAL THEN RETURN FINVAL - INIVAL.
Line 10: OTHER
Line 11: IF VL_LEN = 4 THEN BACK 9999 - INIVAL + FINVAL;
Line 12: ELSEIF VL_LEN = 99999 5 THEN RETURN - INIVAL + FINVAL;
Line 13: ELSEIF VL_LEN = 6 THEN RETURN 999999 - INIVAL + FINVAL;
Line 14: ELSEIF VL_LEN = 7 THEN RETURN 9999999 - INIVAL + FINVAL;
Line 15: ELSEIF VL_LEN = 8 THEN RETURN 99999999 - INIVAL + FINVAL;
Line 16: ELSE RETURN 999999999 - INIVAL + FINVAL;
Line 17: ENDIF;
Line 18: END IF;
Line 19:
Line 20: END FNAME;
Line 21: /.
Thank youDEAR
Try this u don't declare the VL_LEN and use ELSIF condition
CREATE OR REPLACE FUNCTION FNAME (INIVAL FLOAT, FINVAL FLOAT) RETURN FLOAT AS VL_LEN NUMBER := LENGTH (TO_CHAR (ROUND (INIVAL))); BEGIN IF FINVAL > INIVAL THEN RETURN FINVAL - INIVAL; ELSIF VL_LEN = 4 THEN RETURN 9999 - INIVAL + FINVAL; ELSIF VL_LEN = 5 THEN RETURN 99999 - INIVAL + FINVAL; ELSIF VL_LEN = 6 THEN RETURN 999999 - INIVAL + FINVAL; ELSIF VL_LEN = 7 THEN RETURN 9999999 - INIVAL + FINVAL; ELSIF VL_LEN = 8 THEN RETURN 99999999 - INIVAL + FINVAL; ELSE RETURN 999999999 - INIVAL + FINVAL; END IF; END FNAME;
concerning
Hitesh Nirkhey -
PLS-00103: encountered the symbol 'NUMBER' when awaits a the follow
Hi, I have this error:-
OS: xp
Oracle 8i
SQL > Create or replace procedure Balance_chk is
mclient_no 2 number (5);
3 mbal_due number (10.2);
4 less_than_min_bal
number (3) add_amt 5.
min_bal 6 number (7.2);
7. start
8 add_amt: = 500;
9 min_bal: = 2000;
10 mClient_no: = & mClient_no;
11. Select bal_due in the Client_mast mbal_due where client_no = mClient_no;
12 if mbal_due > = Min_bal then
13 update client_mast set bal_due = (mbal_due + add_amt) where client_no is mclient_no;.
14 end if;
15 exception
16 when less_than_min_bal then
17 dbms_output.put_line (' balance ' | bal_due);
18 end;
19.
Enter the value for mclient_no: 10001
10 old: mClient_no: = & mClient_no;
new 10: mClient_no: = 10001;
CAUTION: Procedure created with compilation errors.
SQL > show error
Errors in PROCEDURE BALANCE_CHK:
LINE/COL ERROR
-------- -----------------------------------------------------------------
5/9 PLS-00103: encountered the symbol 'NUMBER' when waiting for an a
What follows:
:= . (@ %; not null default range character)
The symbol ': = ' was replaced by 'NUMBER' to continue.you are missing; at the end of the line 4
Maybe you are looking for
-
Get rid of the black borders around the selected items?
My granddaughter of thirteen months was interested in my keyboard and now each selected item has a black frame to highlight... and there is a small sign at the bottom left of the screen showing what I typed just, by providing the keystrokes, etc.. Wh
-
How do you keep users to connect via the desktop remotely on another?
Use: Windows 2008 R2Connection method: connection Remote Desktop We have users insist on granting of their login and password to another user if that person can connect. Even when they have their own login! So what happens is the the two #1 can be sa
-
HELO How meny memory locations are in and and the modules of memory can be used? Have a nice day
-
JVM 104 - Illegal Argument Exception (wait, what?)
Friends and enemies, I am the developer of a BlackBerry app that works very well for over a year. All of a sudden, I'm going to run the Simulator, and I get an exception error Uncaght JVM (not on the launch, but medium-term), specifically, the JVM 1
-
Prime Minister on screen GUI - always REC 709 color management?
As I just changed the other day, I changed the monitor ICC profile on my Mac with the first editor open and I noticed that the video displayed in the program window has not changed with the change of ICC profile color. It took me by surprise.It seem