PL/SQL :: Invalid Identifier While Checking Date Comparison

Jul 25, 2013

I have written one program with dynamic SQL and piece of code is  follows. 

sql_stmt := 'SELECT '||CBID(i)||',BID,'||CBEID(i)||',''NA'',''NA'',''NA''  FROM DIM_ORGNISATION WHERE BID in(select PARENT_B_ID from ORG_DIM_LOD where CHILD_B_ID ='||CBID(i)||') and to_Date(start_Date,''DD/MM/YYYY'') = TO_DATE ( trunc('||Cstart_date_type(i)||'),''DD-MON-YY'',''NLS_DATE_LANGUAGE=ENGLISH'')'; EXECUTE IMMEDIATE sql_stmt BULK COLLECT INTO tempBID, tempSBD, tempLBD, tempL3BD, tempL4BD, tempSABD And ,

when i'm executing dynamic SQL gives the error as follows. 

ORA-00904: "JAN": invalid identifierORA-06512: at "LWNER.SHY_CREATE_MAPING", line 184ORA-06512: at line 2 

when displaying with using

DBMS_OUTPUT   DBMS_OUTPUT.PUT_LINE('Cstart_date_type(i)'||Cstart_date_type(i)||)); It's diaplaying it as "01-JAN-70".

View 7 Replies


ADVERTISEMENT

SQL & PL/SQL :: Invalid Identifier?

Oct 30, 2011

I am trying to do an update with an anonymous PL/SQL block because it has been absolutely impossible to get by the infamous "Single-row subquery returns multiple rows" Whatever.So this code below work... Obviously, I am updating it to a constant.. OK, duh.. Of course it works, it's easy.... Now, I really need to update it to a value in another table that is in my cursor. I believe that I probably need to declare a secondary cursor.

I'm just getting back in the DBA saddle, so I'm a little rusty..

set serveroutput on;
DECLARE
numrows NUMBER := 0;
total NUMBER := 0;
CURSOR upd_record_cur IS SELECT m.rowid, m.swcm_cycle, t.newcycle, p.aprem_no from toad.fswcmas m,

[code]...

Not so good here

ORA-06550: line 20, column 53:
PL/SQL: ORA-00904: "TOAD"."TTP43425_LOAD"."NEWCYCLE": invalid identifier
ORA-06550: line 20, column 10:
PL/SQL: SQL Statement ignored

Doesn't work...
BEGIN
FOR upd_rec IN upd_record_cur LOOP
update toad.fswcmas sw set sw.swcm_cycle = toad.ttp43425_load.newcycle
WHERE rowid = upd_rec.rowid;
total := total + 1;

View 17 Replies View Related

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

Oct 18, 2013

I'm having an issue creating a table which references a larger table of mine.It gives me the error:

ORA-00904: "EID": invalid identifier

when issuing the command:

CREATE TABLE Phone (P_num CHAR(7), P_type VARCHAR2(10), PRIMARY KEY(P_num), FOREIGN KEY(EID) REFERENCES Employee ON DELETE CASCADE);

I need the employee id (EID) to be the primary key for my table Employee, as described here:

DESC Employee;
Name Null? Type
----------------------------------------- -------- ----------------------------
EID NOT NULL CHAR(7)
E_NAME VARCHAR2(15)
E_ADDRESS VARCHAR2(30)

And since Phone has its own primary key of Pnum, I find it weird that it won't let me reference Phone back to Employee using EID.

View 12 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

PL/SQL :: Row_Number() Invalid Identifier

Sep 17, 2013

Row_Number() invalid identifier

View 6 Replies View Related

SQL & PL/SQL :: WM_CONCAT - Invalid Identifier?

Jul 18, 2011

When iam using wm_concat function in a query in our DB it gave me expected output but when i tried the same thing in another DB of ours it gave me error saying ORA-00904: "WM_CONCAT" : invalid identifier

why am I getting this error or is there any way to concatenate the ouput of a query (seperated by ',')when it is returing unexpected no. of rows.

View 7 Replies View Related

SQL & PL/SQL :: Date Comparison - Two Columns In Database

Jul 27, 2010

I have two columns in database

INPUTDATE DDMMYYYY
and
OUTPUTDATE YYYYMMDD

I want to compare both the columns because of format of columns i am getting problem to compare.

View 2 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 :: Handle Exception Invalid Identifier

Feb 27, 2013

In my code i am selecting a column which does not exist for a table so i m trying to handle that error in exception handler but i am getting error

I want to handle ORA-00904 invalid identifier error

DECLARE
l_count INTEGER:=0;
invalid_identifier_exception EXCEPTION;
PRAGMA EXCEPTION_INIT (invalid_identifier_exception, -06550);
invalid_identifier_exception1 EXCEPTION;
[code]......

select sdsd from emp;
*
ERROR at line 14:
ORA-06550: line 14, column 8:
PL/SQL: ORA-00904: "SDSD": invalid identifier
ORA-06550: line 14, column 1:
PL/SQL: SQL Statement ignored

View 3 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

SQL & PL/SQL :: ORA-00904 - Invalid Identifier In Oracle 11G

Sep 24, 2013

I have created one user in DB using below command

SQL> create user user1 identified by user1;

User created.

SQL> grant dba to user1;

Grant succeeded.

SQL>

I am trying to run below query

SQL> select dbms_random.value(-9223372036854775808, 9223372036854775807) from dual;
select dbms_random.value(-9223372036854775808, 9223372036854775807) from dual
*
ERROR at line 1: ORA-00904: : invalid identifier

I am getting "ORA-00904: : invalid identifier" even after giving the DBA right to user.When I run the same query using the sysdba , I am able to run the query

SQL> conn / as sysdba
Connected.
SQL> select dbms_random.value(-9223372036854775808, 9223372036854775807) from dual;

DBMS_RANDOM.VALUE(-9223372036854775808,9223372036854775807)
-----------------------------------------------------------
-5.113E+18
SQL>

View 4 Replies View Related

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

Oct 12, 2011

i have this code.

select * from openquery(serverlinkeodwmain, 'SELECT COUNT(CNTR_N) cnt FROM OPS_DLY_AGING_DTL
WHERE BATCH_ID = DateADD(day , datediff(day, 0, getdate()), 0)')

the error

OLE DB provider "MSDAORA" for linked server "serverlinkeodwmain" returned message "ORA-00904: "DATEADD": invalid identifier".

is it because dateadd function is sql and i need to change it to oracle? if so how do i do that? i dont know much about oracle.

i need to get the current date without time. my records look like this

2011-08-16 00:00:00.000

View 13 Replies View Related

SQL & PL/SQL :: ORA-00904 / Procedure Name / Invalid Identifier

May 12, 2010

I want run a procedure from a easy sql select.I have write this code to run this procedure, but response with a oracle error:

select [procedure_name](:data1, :data2) as test from dual

the oracle error is this:

ORA-00904: "PROCEDURENAME": invalid identifier

View 12 Replies View Related

Forms :: Date Comparison In Default_where Clause

May 25, 2011

Could it be that it's impossible to change the date format in the default_where clause?

The table column PROPOSAL_END in the database that I want to compare with, is in Format DD.MM.YYYY.

I tried:

set_block_property('Tours' , default_where, 'Number_of_places > 0 AND PROPOSAL_END <= ' || to_char(to_date(sydate,'DD.MM.YYYY')));
set_block_property('Tours' , default_where, 'Number_of_places > 0 AND PROPOSAL_END <= ' || to_char([-- A date item with the intial value $$date$$ the output is in Fomat DD.MM.YYYY by default --]));
set_block_property('Tours' , default_where, 'Number_of_places > 0 AND PROPOSAL_END <= ' || to_char(to_date([-- A date item with the intial value $$date$$ the output is in Fomat DD.MM.YYYY by default --],'DD.MM.YYYY')));

It all does dot matter. Every time the generated select-statement shows the format DD-MMM-YY. How can I change that?

View 6 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

ORA-00904 / Invalid Identifier - Not Able To Run EXECUTE IMMEDIATE In PL/SQL Procedure

Feb 4, 2012

Here is the code I am using:

CREATE OR REPLACE
PROCEDURE CUBE_VIEW (VAR_DT IN VARCHAR2 DEFAULT '')
AUTHID CURRENT_USER
AS
START_DATE NUMBER;
END_DATE NUMBER;
VAR DATE;
BEGIN
IF VAR_DT IS NULL THEN

[code]....

The code complies successfully but when I am executing the code, here is the error I get. The code works successfully when I manually insert the values (as done in the commented out statement) but when use it from variable, it gives me error.

Connecting to the database LocalEnvironment.
ORA-00904: "END_DATE": invalid identifier
ORA-06512: at "TESTING.CUBE_VIEW", line 18
ORA-06512: at line 6
START DATE IS 90301
END DATE IS 111201
Process exited.
Disconnecting from the database LocalEnvironment.

View 3 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 :: ORA-00904 / DBMS_METADAGE.GET_DDL / Invalid Identifier

May 31, 2010

I create a table:

create table myTable (
id number primary key,
name varchar2(100),
doc_content clob,
creation_date date default sysdate)
/

And then used dbms_metadata.get_ddl to retrieve its DDL:

select dbms_metadata.get_ddl('TABLE', 'MYTABLE') myDDL
2 from dual
3 /
I got the following error.
ERROR at line 1:
ORA-00904: "DBMS_METADAGE"."GET_DDL": invalid identifier

run catproc.sql to create pl/sql package But the error still occurs. I'm trying to understand dbms_metadata.

View 1 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

Reports & Discoverer :: Terminated With Error / REP-300 - Invalid Identifier

Nov 4, 2013

I've modified a report and I am able to run the SQL from toad and executed with no errors and output the results as expected. The SQL from the report is calling a function from DB. I granted execute permisiion to public. when I run the report, it has o errors, the result were fine. However, when another user run the report, it get the the following error.

Terminated with error:
REP-300: "GET_NSCL_TOT": invalid identifier
to_char ==> (get_NSCL_Tot('NFL',to_date(:period_end_date,'DD-MON-RRRR'),'1'),'999999.99')||','col2

View 3 Replies View Related

Server Utilities :: ORA-00904 POLTYP / Invalid Identifier When Export

Jan 26, 2012

First I got errors when I did the export with an export tool of Release 11.1.0.7.0 and there were lot of ORA-00904 and ORA-01003 like the following:

XP-00008: ORACLE error 904 encountered
ORA-00904: "MAXSIZE": invalid identifier
. . exporting table XRATE_INFO
EXP-00008: ORACLE error 1003 encountered
ORA-01003: no statement parsed

Then I tried to do export with another version of export tool (Release 10.2.0.4.0) The errors changed to the follwing:

.about to export FM's tables via Direct Path...
EXP-00008: ORACLE error 904 encountered
ORA-00904: "POLTYP": invalid identifier
EXP-00000: Export terminated unsuccessfully

The export tool I used is of Release 10.2.0.4.0

View 12 Replies View Related

Upgrade :: ORA-00904 / OBJ$EDITION / Invalid Identifier After Upgrade To 11.2.0.3

Nov 19, 2012

I recently performed an upgrade on a new server from oracle 10gr2 to oracle 11gr2 (11.2.0.3).

I take the rman backup from oracle 10g server and restore it on new server where I installed oracle 11gr2.

But on my previous oracle 10gr2 server I enabled the auditing. After doing successful upgrade now when I try to login with any user except sys I receive the following error:

SQL> conn scott/tiger
ERROR:
ORA-00604: error occurred at recursive SQL level 1
ORA-00904: "OBJ$EDITION": invalid identifier
ORA-02002: error while writing to audit trail
ORA-00604: error occurred at recursive SQL level 1
ORA-00904: "OBJ$EDITION": invalid identifier

I got the workaround by setting the parameter audit_trail=FALSE (Previous value was DB_EXTENDED) .But I want my auditing to be enabled as per y requirements.

View 1 Replies View Related

PL/SQL :: Find Invalid Date And Month Not Match With Calendar?

Mar 21, 2013

I want to find the row with invalid day, month which are not matching with calendar day and month. Also the program should capture the data if the year <1900

with xx as
(select 101 as ID, '24/05/1899' as create_date from dual
union all
select 101, '32/03/2012' from dual
union all
select 102 ,'30/02/2012' from dual
union all
select 101 , '29/02/2013' from dual

[code]...

View 16 Replies View Related

Security :: How To Find Out Date View Status Changed To Invalid

Mar 10, 2011

We are trying to audit a view. We are currently seeing that view in production instance and trying to find out when exactly it got invalidated.

View 4 Replies View Related

SQL & PL/SQL :: Invalid Results When Including Date With Null Value In Select List?

Jun 15, 2010

I'm working on a Oracle Database, and I'm gettin incorrect results when including a date field in the select list which is NULL in the table.

This works correctly and returns exactly one row:

SELECT firstField FROM table WHERE firstField = 'value'

while this doesn't and returns no rows:

SELECT firstField, secondField FROM table WHERE firstField = 'value'

Where secondField is of type date and its value is NULL (00-000-00). Note that the only thing that changes is the select list.

View 6 Replies View Related

Comparison Rows In Two Different Database

Oct 13, 2011

Currently I am working on conversion project. We want to verify the both applications updated database values are same or not.

if you run same transaction in both application values are updated in the database. I want compare both database tables, its updated same values in table or any mismatch in the table, is there any tools available right now to compare the two rows values in same tables.

View 2 Replies View Related

SQL & PL/SQL :: Time Comparison Alone Like Less / Greater Than?

Dec 15, 2010

Select
to_char(to_date('10-02-2006 10:30:00 AM', 'DD-MM-YYYY HH:MI:SS AM'), 'HH:MI:SS AM') as a1,
to_char(to_date('10-02-2006 01:30:00 PM', 'DD-MM-YYYY HH:MI:SS AM'), 'HH:MI:SS AM') as a2,
Case
when to_char(to_date('10-02-2006 10:30:00 AM', 'DD-MM-YYYY HH:MI:SS AM'), 'HH:MI:SS AM') >

[code]...

from the above query i was expecting value '2' but its returning '1'. As I am using TO_CHAR its trying to compare characters. Is there a way, to compare times alone like less than, greater than?

View 3 Replies View Related

SQL & PL/SQL :: Comparison Function And Sql Statement

Apr 3, 2011

When we create sql and some pieces of sql are implemented as oracle function. and we run this sql only once every day. I read article that function after first run located in cache. This part of cache ( with function ), is it really consume one oracle resources? Or it will be erased after while.

View 3 Replies View Related

SQL & PL/SQL :: Pivot Table Comparison Between Months

Jun 28, 2010

SQL> select * from query;

CUSTO SWITCH DATE_X METRIC COUNT_X SEQUENCE_NO FILE
------- ------- --------- ------- ---------- ----------- ----
JCI S1 28-JUN-10 PORT1 10 4 TNB
JCI S1 28-JUN-10 PORT2 4 4 TNB
JCI S1 28-JUN-10 PORT3 8 4 TNB
JCI S2 28-JUN-10 PORT1 1 2 TNB
JCI S2 28-JUN-10 PORT2 5 2 TNB
JCI S3 28-JUN-10 PORT1 6 8 TNB
JCI S5 28-JUN-10 PORT2 2 4 TNB

------->s5 only in the current month-it was not in the previous month data collection
-----------------------------------------------------------------------------
JCI S1 28-MAY-10 PORT1 10 3 TNB
JCI S1 28-MAY-10 PORT3 5 3 TNB
JCI S2 28-MAY-10 PORT1 4 1 TNB
JCI S2 28-MAY-10 PORT2 2 1 TNB
JCI S2 28-MAY-10 PORT3 8 1 TNB
JCI S3 28-MAY-10 PORT2 7 7 TNB
JCI S3 28-MAY-10 PORT3 5 7 TNB
JCI S4 28-MAY-10 PORT1 2 10 TNB
------->s4 in the previous month data

15 rows selected.

1 SELECT A.CUSTO,A.SWITCH,
2 A.PORT1-B.PORT1,
3 A.PORT2-B.PORT2,
4 A.PORT3-B.PORT3
5 FROM (SELECT
6 A.CUSTO

[Code] ......

CUSTO SWITCH A.PORT1-B.PORT1 A.PORT2-B.PORT2 A.PORT3-B.PORT3
------- ------- --------------- --------------- ---------------
JCI S1 0 4 3
JCI S2 -3 3 -8
JCI S3 6 -7 -5

How to include the Switch S4 and S5 in the output. how implemented FULL OUTER JOIN

View 13 Replies View Related

SQL & PL/SQL :: Multilevel Collection Comparison Using Sets?

Sep 1, 2010

I need to populate a table based on the results of comparing sets of data. I decided to do this using MULTISET EXCEPT, but having created the structure, do not know whether it is actually possible, and if so, what syntax to use.

I have created:

CREATE OR REPLACE
TYPE NUMBER_TBL IS TABLE OF NUMBER;
/

CREATE OR REPLACE
TYPE PACKAGE_OPTION_GROUP_OBJ AS OBJECT( ID NUMBER, benefits NUMBER_TBL )
/

CREATE OR REPLACE
TYPE PACKAGE_OPTION_GROUP_TBL AS table of PACKAGE_OPTION_GROUP_OBJ
/

I have populated the following:

selectedTable PACKAGE_OPTION_GROUP_TBL := PACKAGE_OPTION_GROUP_TBL();

defaultTable PACKAGE_OPTION_GROUP_TBL := PACKAGE_OPTION_GROUP_TBL();

groupTable PACKAGE_OPTION_GROUP_TBL := PACKAGE_OPTION_GROUP_TBL();

comparisonTable PACKAGE_OPTION_GROUP_TBL := PACKAGE_OPTION_GROUP_TBL();

Once populated they contain the following data:
***selectedTable***
GROUP_ID : 121
BENEFITS : 161
---------------------------
GROUP_ID : 123
BENEFITS : 165
BENEFITS : 167
---------------------------

***defaultTable***
GROUP_ID : 121
BENEFITS : 161
---------------------------
GROUP_ID : 122
BENEFITS : 162
BENEFITS : 163
---------------------------

***groupTable***
GROUP_ID : 121
BENEFITS : 161
---------------------------
GROUP_ID : 123
BENEFITS : 165
BENEFITS : 166
---------------------------

I first need to compare the ID field only of selectedTable with defaultTable to find where they differ, something like

comparisonTable := selectedTable MULTISET EXCEPT(ID) defaultTable

I am expecting the result to be something like:
***comparisonTable***
GROUP_ID : 123
BENEFITS : 165
BENEFITS : 167
---------------------------

However, I don't know if this is possible and if so, what the syntax would be.

At a later stage, I will need to compare the benefits between selectedTable and groupTable, where the GroupID's match, which is why I have the tables structured in this way.

View 6 Replies View Related







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