PL/SQL :: 00900 Invalid SQL Statement Error?

Jul 30, 2012

I'm teaching myself to write stored procedures, working in TOAD 10.5 with Oracle 10g. I keep getting error ORA-00900: invalid SQL Statement. Here's the code, cut down to bare minimum sample size. I can't see where I'm doing anything wrong.

If I cut out the cursor (taking it down to just "Begin" and "End"), it does run, but I can't see anything wrong with the cursor.

CREATE OR REPLACE PROCEDURE IN_PROCESS_CASES_BOS
IS
V_HELLO VARCHAR2(10);
CURSOR C_MAIN IS
SELECT 'HELLO' FROM DUAL;

[code]....

View 6 Replies


ADVERTISEMENT

Client Tools :: Error / ORA-00900 / Invalid SQL Statement After Executing Procedure

Jan 3, 2011

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
)

View 3 Replies View Related

SQL & PL/SQL :: ORA-00900 / Invalid SQL Statement

Jun 30, 2011

correct the code where i made mistake.

while select RA_CUSTOMERS orderby customer_id
innerJoin AR_PAYMENT_SCHEDULES_ALL where RA_CUSTOMERS.customer_id = AR_PAYMENT_SCHEDULES_ALL.customer_id
AND AR_PAYMENT_SCHEDULES_ALL.DUE_DATE > 90
(select CUSTOMER_ID FROM AR_CASH_RECEIPTS_ALL where AR_CASH_RECEIPTS_ALL.customer_id = RA_CUSTOMERS.customer_id);

View 3 Replies View Related

PL/SQL :: ORA-00900 Invalid SQL Statement When Doing Execute Immediate Using

Jun 21, 2012

I'm writing simple code db is 9.2.0.8

create or replace procedure gather_part_stats(p_schema in varchar2, p_table in varchar2)
as
l_quarter varchar2(8) := to_char(sysdate, '"Y"YYYY"_Q"q') ;
l_sql varchar2(2000) := 'exec dbms_stats.gather_table_stats(:schema, :table, method_opt => ''for all columns size 1'' , cascade => true , estimate_percent => 1 , granularity => ''PARTITION'', partname=>:part);';
[code].......

I'm using using to avoid sql injection,

Error is:
SQL> exec gather_part_stats('TEST' , 'TEST');
l_quarter: Y2012_Q2
exec dbms_stats.gather_table_stats(:schema, :table, method_opt => 'for all columns size 1' , cascade => true , estimate_percent => 1 , granularity => 'PARTITION', partname=>:part);
BEGIN gather_part_stats('TEST' , 'TEST'); END;
*
ERROR at line 1:
ORA-00900: invalid SQL statement
ORA-06512: at "INSTALL.GATHER_PART_STATS", line 8
ORA-06512: at line 1

View 12 Replies View Related

SQL & PL/SQL :: Invalid Identifier Error In Select Statement?

Mar 18, 2011

Where I run this update query, I get the error:

Error report:
SQL Error: ORA-01427: single-row subquery returns more than one row
01427. 00000 - "single-row subquery returns more than one row"
*Cause:
*Action:

UPDATE XXX_CURR_EOM SET ID =
(select CAPITALPLAN.ID from capitalplan, XXX_CURR_EOM
where
XXX_CURR_EOM.ID = CAPITALPLAN_id)

don't know what it means.

View 10 Replies View Related

SQL & PL/SQL :: Oracle Error For Invalid Identifier In Execute Immediate Statement

Apr 5, 2011

I have a procedure as below. To sum up the procedure in one line it dynamically forms a string to get the values of the type which is passed as an input to the procedure.

I call the procedure as

exec exec_imm( exec_imm_t(1,'asd','1/2-34'));

ERROR:
Error starting at line 9 in command:
exec exec_imm( exec_imm_t(1,'asd','1/2-34'))
Error report:
ORA-00904: "P_TYPE_DATA"."ADDRESS": invalid identifier
ORA-06512: at "PTK_ADM.EXEC_IMM", line 26
ORA-06512: at line 1
00904. 00000 - "%s: invalid identifier"

NOTE:
When I try to execute the procedure with the execute immediate statement I get the above error. But when I execute the select statement which is nothing but the value in v_type_data directly (as seen in the comments in the code below) there is no error. But when the same v_type_data is used in execute immediate, I get an error.

CREATE OR REPLACE procedure exec_imm(p_type_data exec_imm_t)
AS
v_type_str CLOB := NULL;
v_type_data CLOB := NULL;
v_type_name VARCHAR2(25) := NULL;
BEGIN
[code]......

View 6 Replies View Related

Server Utilities :: Schema Impdb Invalid Statement Error

May 11, 2010

I am trying to import a schema backup using sqldeveloper and getting this syntax error:

ORA-00900: invalid SQL statement

Here is the import statement:

impdp sys/*****@ccpsp schemas=ccpsp_staging directory=dmpdir DUMPFILE=CCPSP_USERCCPSP_STAGINGSCHEMABACKUP_07MAY2010.dmp LOGFILE=IMPDP_CCPSPStagingSchemaImport.log;

View 3 Replies View Related

Server Utilities :: Execution Of Oracle 11g Wrapped Procedure Gives Ora-00900 Error

Apr 4, 2013

I have a procedure which i wrapped using the oracle 11g wrap utility. If i execute the wrapped procedure using jdbc i am getting an error of 0RA-00900 invalid sql statement.

The procedure is having basic sql statements only.The same procedure if i wrap using Oracle 9i and execute using jdbc it works fine.Is there any change in Oracle 9i wrap utility and Oracle 11g wrap utility.

I tried even Oracle 10g wrap it is also not working fine.

View 4 Replies View Related

Client Tools :: TOAD Error ORA-00900 Procedural Software Installation?

Nov 8, 2011

We use this software Toad for Oracle here and I have just started learning PL SQL.I am coming across a few errors in Toad for Oracle

First of all,

When I execute snippet (Ctrl + Enter), I get this ORA-00900 error and the message that I need to upgrade my version of knowledge xpert. I did that to 10.1. I then restarted my computer and now it is still showing me that error ORA-00900 but without any message. I do not get output, even for simple programs but when I try to execute snippet, it asks for my 'Edit SQL' screen and after which it gives me a few outputs.

View 1 Replies View Related

ORA-24373 / Invalid Length Specified For Statement

Aug 20, 2008

We are getting an error in our web application that is using Oracle.DataAccess.dll v2.111.6.20. When a couple users are using the site everything is fine, but when the load goes up we start getting the error ORA-24373: invalid length specified for statement. We are unable to duplicate this error in Visual Studio and don't know where to turn. We use stored procedure and the .dll to access the database for everything. Also, when this error occurs, it occurs indefenitely for all OracleCommand objects until the web server is rebooted. Also, when I attempt to remote debug with SQL Developer, the process doesn't even make it to the database!

View 3 Replies View Related

Update Statement Not Working - Invalid Identifier?

Apr 15, 2009

I am having trouble getting the following update statement to work.

update Team
set Names.Team_Name = "Not Yet Assigned"
WHERE
Team.ROE_PROCESS = 'G' AND

[code]...

The error message I am receiving is:
ORA-00904: "Department"."UI_WKLY_EARNS": invalid identifier

View 4 Replies View Related

SQL & PL/SQL :: Error In Trigger - Invalid

Mar 30, 2012

How to overcome this error

SQL> create or replace trigger trig_insert

2 before insert on insuredpersons for each row
3 begin
4 insert into sms_icare(insuredid)values(:new.id);
5 end;

when i am trying to insert it is throwing error is

ORA-04098:trigger "marbke.trig.sms' is invalid and failed re-validation

View 2 Replies View Related

PL/SQL :: Getting Invalid Identifier Error

Jul 24, 2012

select to_char(123.5,'fm$99999.00') from dual

when I execute this I get an output of $123.50...I want to use other speacial characters like @,* instead of $...But I am getting invalid identifier error if I use any special character other than $.

View 5 Replies View Related

SQL & PL/SQL :: Invalid Number Error

May 9, 2011

I'm getting the following error in my DB, what would be the reason.

select * from Table_Name where rownum<10
                          *
ERROR at line 1: ORA-01722: invalid number

and I'm getting this error for every query.

View 4 Replies View Related

Error ORA 920 / Invalid Relational Operator

Jul 30, 2010

The following runs no problem

SELECT
ACCO.SEQUENCE,
ACCO.DESCRIPTION,
MAX (ACCO.AUDIT_DTE)
FROM
PAS.AUDIT_CLINICAL_CARE_OPTIONS ACCO
WHERE
ACCO.AUDIT_DTE < :AuditDate AND

[code]....

However, when I try to add extra conditions to the status' in the sub select i get the error. This is one way I tried:

SELECT
ACCO.SEQUENCE,
ACCO.DESCRIPTION,
MAX (ACCO.AUDIT_DTE)
FROM
PAS.AUDIT_CLINICAL_CARE_OPTIONS ACCO
WHERE

[code]....

I've tried repeating the sub select for each of the extra status parts but everytime i hit the same problem.

View 1 Replies View Related

ERROR - ORA-01722 - Invalid Number

Mar 9, 2007

INSERT INTO t_category m(
m.service_id,
m.customer_id)
SELECT
u.service_id,
(SELECT p.add_data
FROM t_add p
WHERE
p.service_id=u.service_id AND p.add_type='CUSTOMER_ID')
FROM t_iservice u

I got this error: ORA-01722: invalid number. The problem is m.customer_id has data type NUMBER, p.add_data is VARCHAR.

View 1 Replies View Related

SQL & PL/SQL :: Package Error - Invalid Identifier?

Mar 4, 2012

way give error in package below

SQL> CREATE OR REPLACE PACKAGE DATA_BKG AS
2
3 TYPE OBJ_DEPT IS RECORD
4 (
5 DEPT_ID NUMBER(10),

[code]...

View 7 Replies View Related

SQL & PL/SQL :: Error / ORA-00911 / Invalid Character

Nov 17, 2012

I am receiving the SQL Error when trying to do a simple insert statement..

Below is the supposed errant SQL..WHERE?

SQL
insert into (CUSTOM_TBL)
Select
'123456' --CHARTFIELD2
,'PR' --EXAMPLE COMMENT
,'123456_01' --EXAMPLE COMMENT -

SEE ERROR STATEMENT BELOW:

Error at Command Line:5 Column:10
Error report:
SQL Error: ORA-00911: invalid character
00911. 00000 - "invalid character"

[code]....

View 4 Replies View Related

SQL & PL/SQL :: Invalid Cursor Error In Procedure

Feb 2, 2011

I have this stored procedure as part of package.

PROCEDURE XCOM_X060_UPDATEOHBFAILURE( in_CALL_ID IN NUMBER,
in_SPLY_REORD_NO IN CHAR,
in_OHB_QTY_CARTONS IN NUMBER,
in_OHB_QTY_UNITS IN NUMBER,
in_SPLY_TOT_OHB_QTY IN NUMBER,
in_OHB_INPUT_CTNS_MIN IN NUMBER,
in_OHB_INPUT_CTNS_MAX IN NUMBER,
in_UNITS_PER_CARTON IN NUMBER,
in_OHB_INPUT_UNIT_CONSTANT IN NUMBER,
in_TOTAL_CARTONS IN NUMBER,
out_ALLOW_OHB_INPUT_FLAG OUT CHAR,
out_ERR_CODE OUT NUMBER,
out_ERR_MESSAGE OUT VARCHAR2)

When the stored procedure is executed it is throwing following exception OTHERS EXCEPTION in XCOM_X060_UPDATEOHBFAILURE - SQL -1001 SQLERRM: ORA-01001: invalid cursor

Here is the execution script
DECLARE
IN_CALL_ID NUMBER;
IN_SPLY_REORD_NO VARCHAR2(32767);
IN_OHB_QTY_CARTONS NUMBER;
IN_OHB_QTY_UNITS NUMBER;
IN_SPLY_TOT_OHB_QTY NUMBER;
IN_OHB_INPUT_CTNS_MIN NUMBER;
[code]...

There is no cursor used in the procedure. It just inserts records in the table for given input values.

View 10 Replies View Related

SQL & PL/SQL :: Error - ORA-01722 - Invalid Number?

Jul 26, 2011

I have a problem when executing the statement below querying a specific ID# in view

select * from VW_MML_LTR_MSTR where LTR_ID = 26 order by CLNT_CDE ,LTR_GRP, ltr_purp_id, LTR_CDE

I checked the data type acquired by the view and the table involved and confirmed that it was of number type.Weird thing for me is that I changed the where statement as

where LTR_ID LIKE 26
where LTR_ID != 25

Is this on the database settings? What should be done here?

View 9 Replies View Related

SQL & PL/SQL :: Invalid Identifier Error / ORA-00904

Jan 13, 2011

The following query gives me "Invalid Identifier error: ORA-00904.

SELECT TMADMIN.pkg_twatch_invdb.Max_Trk_Date(tmadmin.sites.study_id,tmadmin.sites.site_id, 1000280)) "Qualified Date"
FROM
tmadmin.sites
"tmadmin' is the Schema Name
"pkg_twatch_invdb" is the package name
"max_trk_date" is a function inside the package (returns date)

I am using the same format for other function, it doesn't give any errors.

View 4 Replies View Related

Forms :: Rep-300 OCI Invalid Handle Error?

May 8, 2013

i have some form and reports, whenever i call report from forms i got rep-300 OCI invalid_handle_error.

View 8 Replies View Related

SQL & PL/SQL :: Getting ORA-00911 / Invalid Character Error

Jul 16, 2010

i was written query for nth highest salary from emp table...i get error

1 select distinct (a.sal) from emp a where
2* &N = (select count (distinct(b.sal) from emp b where a.sal <= b.sal);
3 /
Enter value for n: 2
old 2: &N = (select count (distinct(b.sal) from emp b where a.sal <= b.sal);
new 2: 2 = (select count (distinct(b.sal) from emp b where a.sal <= b.sal);
2 = (select count (distinct(b.sal) from emp b where a.sal <= b.sal);
*
ERROR at line 2:ORA-00911: invalid character

View 21 Replies View Related

PL/SQL :: ORA-01722 - Invalid Number Error

Jul 6, 2012

Am getting invalid number error for the query ..

select ROUND( ( SUBSTR(' m1058,1672|1090,1672|1090,1716|1058,1716 x e', 2, instr(' m1058,1672|1090,1672|1090,1716|1058,1716 x e',',',1,1)- 2)        
+ SUBSTR(' m1058,1672|1090,1672|1090,1716|1058,1716 x e', instr(' m1058,1672|1090,1672|1090,1716|1058,1716 x e','|',1,2)+1, instr(' m1058,1672|1090,1672|1090,1716|1058,1716 x e',',',1,3) - (instr(' m1058,1672|1090,1672|1090,1716|1058,1716 x e','|',1,2)+1))      
)/ 2) AS x from dual;

View 3 Replies View Related

Creating Table Error - Invalid Character

Mar 3, 2011

I am trying to create two tables and I am getting the "ORA-00911: invalid character" Error. I have been trying to work it out for last past 30 minutes to no success.

CREATE TABLE special_rate
(
rate_id VARCHAR(3),
rate VARCHAR(5),
rate_expiry_date NUMBER(12),
PRIMARY KEY( rate_id ),
FOREIGN KEY( contract_id ) REFERENCES contract(contract_id)
[code]....

View 5 Replies View Related

SQL & PL/SQL :: Error - PLS-00487 - Invalid Reference To Variable

Jul 8, 2013

I am using oracle 10G version. when i compiled the code I got the error "PLS-00487: Invalid reference to variable 'PROGRAM.MWPRG_PROGRAM_ID%TYPE'

correct the below PLSQL error code (marked Bold)?

PLSQL procedure:
===================
create or replace
PROCEDURE SPT_PROGRAM
IS

[code]....

View 2 Replies View Related

SQL & PL/SQL :: Dynamic Binding - Invalid Number Error?

Jun 10, 2013

I have a pkg with a procedure that uses dbms_sql to process a varchar2_table. Each record in the table is a delimited string, such as "Priority^2", or "Destination^7". The goal is to split that string on the hat and update a record in the panelfield_users table. It works perfectly if I replace the first substr/instr on :pColumn with a hardcoded number, so I know that the binding is working to that point. It is only when I try to get the latter half of the string that it chokes. I keep getting a "invalid number" error. The displayorder field is an integer field and all values will be 3 digits or less. If I pull the sql string out into an editor, it runs just lovely.

The pertinent code is:
C := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(C,'update panelfield_users set displayorder = to_number(substr(:pColumn, instr(:pColumn, ''^'') + 1)) where userid = :pUID and fieldid = (select fieldid from panel_fields where upper(panelname) = upper(:pPanel) and upper(modulename) = upper(:pModule) and upper(field_displayname) = upper(substr(:pColumn, 1, instr(:pColumn, ''^'')-1)) )

[code]...

View 4 Replies View Related

Forms :: Getting Ora-00911 Invalid Character Error

Feb 12, 2013

I am using this query in MERGE statement , result is also shows here

select TO_CHAR(emp_id) EMP_ID ,TO_DATE(at_date,'RRRR/MM/DD') AT_DATE,TO_CHAR(time_in) TIME_IN,TO_CHAR(time_out) TIME_OUT,TO_CHAR(status) STATUS from (
select emp_code emp_id,at_date,at_time Time_in, Null Time_out, status from (
select a.*,substr(data_row,24,5) Emp_code,substr(data_row,3,8) AT_Date, substr(data_row,11,4) At_Time,
substr(data_row,15,2) Shift, substr(data_row,17,2) STatus
from data_load a

[code].....

using this query in MERGE statement giving a error ora-00911 invalid character

MERGE INTO Attendance I
USING (
select TO_CHAR(emp_id) EMP_ID ,TO_DATE(at_date,'RRRR/MM/DD') AT_DATE,TO_CHAR(time_in) TIME_IN,TO_CHAR(time_out) TIME_OUT,TO_CHAR(status) STATUS from (
select emp_code emp_id,at_date,at_time Time_in, Null Time_out, status from (
select a.*,substr(data_row,24,5) Emp_code,substr(data_row,3,8) AT_Date, substr(data_row,11,4) At_Time,

[code].....

View 3 Replies View Related

PL/SQL :: Error / ORA-29280 / Invalid Directory Path

Apr 9, 2013

When i am running the below script i am getting error like Invalid directory path. how to check the path by using dbms_ouput.

error : ORA-29280: invalid directory path
ORA-06512: at line 34

DECLARE
l_out_file  UTL_FILE.file_type;
g_convert_crlf  BOOLEAN := TRUE;
P_DATA VARCHAR2(32767);
  l_buffer    VARCHAR2(32767);
  l_amount    BINARY_INTEGER := 32767;

[code]....

View 11 Replies View Related

PL/SQL :: Table Out From A Function / Invalid Datatype Error

May 9, 2013

I am getting an ORA-00902: invalid datatype error when I am trying call the below function from a select statement. Here I am trying to get a table out from a function.

create or replace package pkg10
as
type tabletype1 is table of table1%rowtype
index by binary_integer;
function func1 return tabletype1;
end pkg10;create or replace package body pkg10
as

[code]....

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved