Procedure: CREATE OR REPLACE procedure test (a number, b varchar2) is
begin
dbms_output.put_line(a ||'->'||b);
end;
Anyonymous Block:
begin
exec test(1,'m');
end;
/
When i run this i am getting this error
ORA-06550: line 2, column 7:
PLS-00103: Encountered the symbol "TEST" when expecting one of the following
[code]...
I am trying to execute the SQLPLUS command (CONNECT) from the stored procedure.It is throwing below error message.
Stored Procedure:
SQL> select user from dual 2 ; USER ------------------------------ SYS SQL> create or replace 2 PROCEDURE PROCEDURE1 AS 3 BEGIN 4 sqlplus sys/sys@D as sysdba; 5 --execute immediate 'create user 'kkk' identified by 'kkk'; 6 END PROCEDURE1; 7 /
Warning: Procedure created with compilation errors.
SQL> show err Errors for PROCEDURE PROCEDURE1: LINE/COL ERROR -------- ----------------------------------------------------------------- 3/9 PLS-00103: Encountered the symbol "SYS" when expecting one of the following: := . ( @ % ; The symbol ":=" was substituted for "SYS" to continue. [code]....
In Database A I have a series of config tables and stored procedures/functions In Database B I have a lot of tables.
I would like to execute my stored procedures and all associated functions in database A on my data in database B.
Now I've figured out that creating a database link enables me to do SQL selects on data in both A and B...but how do I run SP/Funcs ? I've read something about packages but not sure if I'm heading in the right direction.
Do I need to create a simple synonym ? Can I use the existing DB link ? or is there a special way of calling them, or...
I like the A/B database set up since I can keep battle tested code in one location and have it work across multiple dbs...saves me having to create everything in every database.
CREATE OR REPLACE PROCEDURE test IS CURSOR cusers IS SELECT user_name, user_date FROM users; uname users.user_name%TYPE; udate users.user_date%TYPE; BEGIN OPEN cusers;
[code].....
When I try to execute this procedure I get following error:
ORA-00900: invalid SQL statement
Compilation of procedure is successful.
SQL code for creating the USERS table is here:
CREATE TABLE "USERS" ("USER_ID" NUMBER(10,0) NOT NULL ENABLE, "USER_NAME" VARCHAR2(50) NOT NULL ENABLE, "USER_EMAIL" VARCHAR2(50) NOT NULL ENABLE, "USER_PASS" VARCHAR2(50) NOT NULL ENABLE, "USER_DATE" DATE NOT NULL ENABLE, CONSTRAINT "USERS_PK" PRIMARY KEY ("USER_ID") ENABLE )
I have wrote a Stored Procedure Function that get all the rows from a Staging Table and assigns it to a CLOB and returns the CLOB. The issue is I'm getting the dreaded
ORA-06502: PL/SQL: numeric or value error ORA-06512: at "F_CLOB_TEST", line 21 ORA-06512: at line 7
The error does not occur when I remove the 'PRC_ID', 'S_FIL_NAME' & 'exportDt' from the query. It works fine. The PRC_ID has data such as "700$702$7 05$706$707$708$709$710$711$712$713$714$715$294404$294405$294407$294408$294409$294410"
and S_FIL_NAM is the same for all columns - "SBENE_FILID810-2010-04-07-10.59.17"
The query returns 829 rows. Also I have to include a few more columns in the query which have data larger than the 'PRC_ID', but I have not included them here in the sample code, as this code by itself returns the ORA-6502 error.
create or replace FUNCTION "F_CLOB_TEST" (job_id in Number) return clob is c_clob clob; [code]....
I have a update statement that works fine when its run in SQL window but when i try it as part of a Stored Procedure its giving me the Insufficient privileges error on that table.
If i dont have privilege to update that table wont it not let me update while doing it outside the stored procedure as well?
I have written a stored procedure that has started returning the error:
Error starting at line 1 in command: call p_glpost('DSTUK', 'L', '2008-01-01', '2008-01-01', '2011-02-18', 1, 1, 1, 0, 'Hi there')
Error report: SQL Error: ORA-06502: PL/SQL: numeric or value error: character to number conversion error ORA-06512: at "CLARITY.P_GLPOST", line 173 06502. 00000 - "PL/SQL: numeric or value error%s"
I can't seem to find a tool that will let me step into the actual stored procedure line by line to see where the error occurs. It mentions line 173, which seems to be a red-herring, as line 173 is simply one of the 'END IF' lines within this block:
IF NVL(r_dist.transtype,'wild') = 'wild' THEN NULL; elsif r_wip.transtype = r_dist.transtype THEN v_matchCount := v_matchCount+1; elsif r_wip.transtype <> r_dist.transtype THEN [code]......
Tell me if it is possible to trace through a SP, and which tool is best (I am trying to use Oracle SQL Developer).
I am trying to accept three numbers and one string as input, and then display the values on the screen. I don't understand why I am getting these errors.
SQL> SET SERVEROUTPUT ON SQL> DECLARE 2 id_number NUMBER := &id_number_input; 3 trans_num NUMBER := &trans_num_input; 4 remar VARCHAR2(75) := &remark_input; 5 receipt NUMBER := &receipt_input;
[Code] .....
ERROR at line 4: ORA-06550: line 4, column 24: PLS-00201: identifier 'HELLO' must be declared ORA-06550: line 4, column 8: PL/SQL: Item ignored ORA-06550: line 10, column 61: PLS-00320: the declaration of the type of this expression is incomplete or malformed ORA-06550: line 10, column 2: PL/SQL: Statement ignored
All these stored procedures deals with insert/updated transactions . i need to create a new stored procedure to execute all this in a single stored procedure which will be something like
create procedure sp4(param1...param8) as begin Execute sp1 param1...param6 rollback if any error Execute sp2 param1...param8 rollback if any error Execute sp3 param1...param4 rollback if any error end;
I am getting errors while executing the following block.
create TYPE c_Rec as object(a VARCHAR2(1), b NUMBER); DECLARE -- TYPE c_Rec as object(a VARCHAR2(1), b NUMBER); TYPE c_collection IS TABLE OF c_Rec; l_coll c_collection := c_collection(); BEGIN [code]........
error
06530. 00000 - "Reference to uninitialized composite"
I'm trying to execute a procedure within a Declare/Begin/End statement and using variables as input parameters in my procedure but I keep on getting an Invalid SQL Statement Error. My code is below:
declare
START_dt VARCHAR2(30); END_DT VARCHAR2(30);
begin
SELECT '01-APR-2011' INTO END_DT FROM DUAL; [code]....
The table the procedure is pulling data from doesn't have proper date/time stamps but my procedure takes the varchar dates above and turns them into dates in the procedure so the input date parameters are left as just string characters.
How to execute Sql Server procedure from Oracle.I have created a dblink and when calling directly to that procedure it is throwing error.
--creationg sqlserver procedure create proc getRecords as print 'testing'; --creating db link create database link remote connect by ss identified by ss using 'remote'; [code]....
I have found DBMS_HS_PASSTHROUGH package is capable of doing it but not sure how to do. Nathan
I've the following package having a procedure with OUT parameter as refcursor .The following is the sample example having same structure with different table name,exception handling in my dev environment
CREATE OR REPLACE PACKAGE TEST_PACK IS Type refCursor is REF CURSOR; PROCEDURE TEST_PROC (out_data out refCursor); END; [code]...
i am getting the follwoing errror ORA-00932: inconsistent datatypes: expected - got.
I need to execute a procedure based on a value in a form. So the procedure name will be changing for value selected in a list.
I need to know a method where i could store the procedure name in a table and when ever i select a value from the list, the respective procedure needs to be executed.
I'm not attaching any tables / data..etc...I just want to know how to pass the record type to a procedure (which are actually obtained from a table) -- see ** below where I'm getting an error..Need to pass the whole record type "l_shl_order_msg"
CREATE OR REPLACE PROCEDURE CM_BUILD_MSG_PRC (P_IN_BLD_MSG_CURSOR IN SYS_REFCURSOR, P_OUT_BLD_MSG_CURSOR OUT SYS_REFCURSOR) IS l_shl_order_msg CRAE_INTERFACE.GLB_VAR_PKG.deid_SHELL_order_typ; V_MSG_SHELL_NAME VARCHAR2(1000); V_MESG_TEXT_SEGMENT VARCHAR2(1000); V_TEXT VARCHAR2(1000); V_MSG_TEXT VARCHAR2(4000); V_MSG_FINAL_TEXT VARCHAR2(4000); V_MSG_PROC VARCHAR2(1000); V_SQL VARCHAR2(4000); V_CNT NUMBER; L_STATUS VARCHAR2(100); L_REASON VARCHAR2(1000); [code]...
I get an error saying that "wrong number or types of arguments in call to ||"..Not sure how to pass record type dynamically...
create or replace procedure test as stmt varchar2(2000); begin EXECUTE IMMEDIATE 'CREATE GLOBAL TEMPORARY TABLE tt_Local(ID VarChar2(38)) ON COMMIT PRESERVE ROWS';
stmt := 'INSERT INTO tt_Local SELECT cardnumber FROM cards'; execute immediate stmt; end;
-- when am trying to execute this
begin test; end; -- showing ora-01031, insufficient privileges.
After creating this procedure...we r not able to execute it...
SQL> ed Wrote file afiedt.buf 1 create or replace procedure dyn_pro1 2 (tablename varchar2,colname varchar2, prodid number) is 3 cmd varchar2(100); 4 begin 5 cmd := 'delete ' || tablename || ' where'|| colname|| '=' ||prodid; 6 execute immediate cmd ;--using College_id; 7* end; SQL> /
Procedure created.
SQL> exec dyn_pro1('stu_4','COLLEGE_ID',200); BEGIN dyn_pro1('stu_4','COLLEGE_ID',200); END; * ERROR at line 1: ORA-00933: SQL command not properly ended ORA-06512: at "APPS.DYN_PRO1", line 6 ORA-06512: at line 1
SQL> select * from ext; select * from ext * ERROR at line 1: ORA-29913: error in executing ODCIEXTTABLEOPEN callout ORA-29400: data cartridge error KUP-04063: unable to open log file empxt.log OS error The system cannot find the file specified. ORA-06512: at "SYS.ORACLE_LOADER", line 19
I am trying to execute an inline spatial query from c# using ODP.NET. This is a select query and I am passing 2 parameters to this query, one is string and other one is SDO_GEOMETRY. I am able to send SDO_Geometry parameter from c# using Oracle UDT custom designed classes.
Query is working as intended but occasionally giving the following errors:
ORA-29902: error in executing ODCIIndexStart() routine ORA-13033: Invalid data in the SDO_ELEM_INFO_ARRAY in SDO_GEOMETRY object ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 333 ORA-29902: error in executing ODCIIndexStart() routine ORA-13031: Invalid Gtype in the SDO_GEOMETRY object for point object ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 333
I could not figure out the cause of this issue (as it is not failing frequently). Am i getting this issue with the actual query or with Oracle UDT conversion.
I exported three databases : servicedesk, report and mostcmdb on server A to a dumpfile. Moved them to similar dump location on server B. Now, I want to import them into B by using:
We are implementing a 2 node RAC configuration with ASM on vmware and openfiler on LINUX RHEL 6.2. We started our installation with grid infrastructure. While executing root.sh on node 1 it gives error diskgroup cannot be mounted and no alterntions perfomed as below.
+[main] [ 2012-10-04 05:38:33.150 PDT ] [UsmcaLogger.logException:173] SEVERE:method oracle.sysman.assistants.usmca.backend.USMDiskGroupManager:mountDiskGroups+ +[main] [ 2012-10-04 05:38:33.151 PDT ] [UsmcaLogger.logException:174] ORA-15032: not all alterations performed+ ORA-15017: diskgroup "CRS" cannot be mounted
ORA-29913: error in executing ODCIEXTTABLEFETCH callout ORA-02291: integrity constraint (STATICO.FK_PROD_REQ_LIS_TAG_GEN_2) violated - parent key not found ORA-31693: Table data object "STATICO"."PROD_REQ_LIS_TAG_GEN":"GEN_DS_LOAN" failed to load/unload and is being skipped due to error: