Update fails with ORA-00904 invalid identifier
Hi allI have problems of construction of an ' update '. Execute the following select statement,
SELECT
XREF.REGN_ID,
XREF.COUNTY_NM,
OWNER.CASE_OWNER_ID,
OWNER.FORMER_AREA,
OWNER.AREA,
OWNER.COUNTY_NUMBER,
OWNER.OFFICE
FROM PS2_CASE_OWNER_SEYED OWNER,
DWFSSD.TAFS_REGN_AREA_XREF_MART XREF
WHERE (OWNER.AREA = XREF.AREA_ID(+))
AND (OWNER.OFFICE = XREF.OFFICE_CD(+) )
AND (OWNER.COUNTY_NUMBER = XREF.COUNTY_NUM(+))
ReturnsREGN_ID COUNTY_NM CASE_OWNER_ID FORMER_AREA AREA COUNTY_NUMBER OFFICE
"1" "Alfalfa" "5008756" "1" "1" "02" "C"
"1" "Alfalfa" "5008954" "1" "1" "02" "C"
"1" "Beckham" "5008803" "1" "1" "05" "C"
"1" "Beckham" "5008222" "1" "1" "05" "C"
"1" "Beckham" "5008223" "1" "1" "05" "C"
"1" "Beckham" "5008424" "1" "1" "05" "C"
"1" "Beckham" "5008442" "1" "1" "05" "C"
"1" "Beckham" "5008780" "1" "1" "05" "C"
"1" "Beckham" "5008787" "1" "1" "05" "C"
"1" "Beckham" "5008788" "1" "1" "05" "C"
I am trying to execute the following statement, "Update", update the PS2_CASE_OWNER_SEYED table.UPDATE (
SELECT OWNER.AREA, XREF.REGN_ID, XREF.COUNTY_NM
FROM PS2_CASE_OWNER_SEYED OWNER, DWFSSD.TAFS_REGN_AREA_XREF_MART XREF
WHERE (OWNER.AREA = XREF.AREA_ID(+))
AND (OWNER.OFFICE = XREF.OFFICE_CD(+) )
AND (OWNER.COUNTY_NUMBER = XREF.COUNTY_NUM(+))
)
SET OWNER.FORMER_AREA = OWNER.AREA,
OWNER.AREA = XREF.REGN_ID,
OWNER.COUNTY_NAME = XREF.COUNTY_NM;
The "Update" statement returns the following error:ORA-00904: "XREF"."COUNTY_NM": invalid identifier
Any ideas what's wrong with the update statement?Thank you
Seyed
Hi, Seyed,
Here's a way to do this UPDATE:
UPDATE emp
SET sal = sal * 1.05
, comm = NVL (comm, 0) + 500
WHERE deptno IN (
SELECT deptno
FROM dept
WHERE loc = 'DALLAS'
)
;
If you want to use an inline view, you can do this:
UPDATE (
SELECT e.sal
, e.comm
FROM emp e
JOIN dept d ON d.deptno = e.deptno
WHERE d.loc = 'DALLAS'
)
SET sal = sal * 1.05
, comm = NVL (comm, 0) + 500
;
Whatever it is, the emp table is left as you wish:
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
----- ------ --------- ----- ---------- ---------- ----- ------
7782 CLARK MANAGER 7839 06/09/1981 2450 10
7839 KING PRESIDENT 11/17/1981 5000 10
7934 MILLER CLERK 7782 01/23/1982 1300 10
7876 ADAMS CLERK 7788 05/23/1987 1155 500 20
7902 FORD ANALYST 7566 12/03/1981 3150 500 20
7566 JONES MANAGER 7839 04/02/1981 3123.75 500 20
7788 SCOTT ANALYST 7566 04/19/1987 3150 500 20
7369 SMITH CLERK 7902 12/17/1980 840 500 20
7499 ALLEN SALESMAN 7698 02/20/1981 1600 300 30
7698 BLAKE MANAGER 7839 05/01/1981 2850 30
7900 JAMES CLERK 7698 12/03/1981 950 30
7654 MARTIN SALESMAN 7698 09/28/1981 1250 1400 30
7844 TURNER SALESMAN 7698 09/08/1981 1500 0 30
7521 WARD SALESMAN 7698 02/22/1981 1250 500 30
Tags: Database
Similar Questions
-
ORA 00904: invalid identifier "JAN".
Hello
I have the rest of the table.
===========================================
create table ATT_ATTENDANCESHEET as
(
Select 1 empid, to_date('21/01/2014','dd/mm/yyyy') prdate, 240 reg, 0 unpaid all double union
Select 2, to_date (January 21, 2014 ', ' dd/mm/yyyy'), 200 reg, 0 unpaid all double union
Select 3, to_date (January 21, 2014 ', ' dd/mm/yyyy'), 240 reg, 0 unpaid all double union
Select option 4, to_date (January 21, 2014 ', ' dd/mm/yyyy'), 480 reg, 0 unpaid all double union
Select 5, to_date (January 21, 2014 ', ' dd/mm/yyyy'), 240 reg, unpaid double 0
);
=================================================
I want to remove rows from table ATT_ATTENDANCESHEET.
If the parameter passed empids, lines for employees would be eliminated.
If empids is null, all records between the given period will be deleted.
I created after the procedure to that effect.
------------------------------------------------------
CREATE or replace FUNCTION deleteAttendanceDetails (startdate DATE, enddate DATE, empids varchar2) RETURN NUMBER as
n number;
condition varchar2 (200);
vsql varchar2 (2000);
BEGIN
IF empids is not null
THEN
condition: condition = |' and empid in ('| empids |') ' ;
END IF;
vsql: =' delete from ATT_ATTENDANCESHEET where prdate between ' | StartDate | 'and' | EndDate | condition;
EXECUTE IMMEDIATE (vsql);
return n;
END;
/
The empids parameter contains the employee IDS separated by commas.
for example
"1,2,3,4"
-----------------------------------------------------------
But when I call this function using
Select deleteAttendanceDetails (to_date('25/01/2014','dd/mm/yyyy'), to_date (' 01/31/2014 ',' dd/mm/yyyy'), ") double;
I get the following error
ORA 00904: invalid identifier "JAN".
ORA-06512: at.. .line 21
I use oracle 10g.
Help, please
Do not use dynamic sql. It's more trouble that it's worth.
Your error comes from the fact that you convert a date to a string, implicitly and then come back.
In addition, your example doesn't have a field of prddate... so I added that, in my test table so that it works.
Try something like that, entirely avoid dynamic sql:
CREATE or replace FUNCTION deleteAttendanceDetails ( startdate DATE, enddate DATE, empids varchar2 ) RETURN NUMBER as n number; BEGIN delete from ATT_ATTENDANCESHEET where ( empid IS NULL OR empid in ( select regexp_substr ( empids, '[^,]+', 1, level) empid from dual connect by level <= (LENGTH(empids) - LENGTH(REPLACE(empids, ',')) + 1) ) ) and prdate between nvl(startdate, to_date('01-jan-1900','dd-mon-yyyy')) and nvl(enddate , to_date('01-jan-5000','dd-mon-yyyy')); return n; -- what is "n" ? END; /
Not really sure what you want to do with "n"... you have nothing in your code... so I did the same
-
HELP-immediate execution in PL/SQL has received the error ORA-00904: invalid identifier
What is the problem with the following codes from PL/SQL (actually it comes to Oracle Metalink Note: 313175.1):
===========
declare
cursor c1 is select * from $ semantic;
v_statement VARCHAR2 (255);
v_nc number (10);
v_nt number (10);
Start
immediate execution
"select count (*) from $ semantics" in v_nc;
immediate execution
' select count (distinct s_table_name) of semantics$ "in v_nt;
dbms_output.put_line
('Edit' | v_nc |) 'columns ' | v_nt | "tables");
to r1 c1 loop
v_statement: = 'ALTER TABLE ' | R1.s_owner | '.' || R1.s_table_name;
v_statement: = v_statement | «change (' |)» R1.s_column_name | ' ';
v_statement: = v_statement | R1.s_data_type | ' (' | r1.s_char_length;)
v_statement: = v_statement | ' CHAR))';
immediately run v_statement;
end loop;
dbms_output.put_line ('Done');
end;
/
=====
Executed once the codes as sysdba against 10gr 2 database, I got this error:
From build to select columns to change
Editing columns 4428 35249
declare
*
ERROR on line 1:
ORA-00904: invalid identifier
ORA-06512: at line 22
I see nothing wrong with the line of "immediate execution". I appreciate your help!
Thank you.Hello
Try to print the offending instruction using exception, I used small test cases by changing the pl/sql block, you may need to change to respond to all other types of data in this table.CREATE TABLE semantics$ AS SELECT USER AS owner, table_name, data_type AS s_data_type, column_name, data_length AS s_char_length FROM cols WHERE table_name = 'MY_OBJECTS'; DECLARE CURSOR c1 IS SELECT * FROM semantics$; v_statement VARCHAR2 (255); v_nc NUMBER (10); v_nt NUMBER (10); BEGIN EXECUTE IMMEDIATE 'select count(*) from semantics$' INTO v_nc; EXECUTE IMMEDIATE 'select count(distinct table_name) from semantics$' INTO v_nt; DBMS_OUTPUT.put_line( 'ALTERing ' || v_nc || ' columns in ' || v_nt || ' tables'); FOR r1 IN c1 LOOP v_statement := 'ALTER TABLE ' || r1.owner || '.' || r1.table_name; v_statement := v_statement || ' modify (' || r1.column_name || ' '; v_statement := v_statement || r1.s_data_type || '(' || r1.s_char_length; IF (r1.s_data_type = 'NUMBER') THEN v_statement := v_statement || '))'; ELSE v_statement := v_statement || ' CHAR))'; END IF; DBMS_OUTPUT.put_line (v_statement); -- EXECUTE IMMEDIATE v_statement; END LOOP; DBMS_OUTPUT.put_line ('Done'); EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.put_line ('Statement = ' || v_statement); DBMS_OUTPUT.put_line (SUBSTR (SQLERRM, 1, 200)); RAISE; END;
_ Output
ALTERing 13 columns in 1 tables ALTER TABLE MY_OBJECTS modify (OWNER VARCHAR2(30 CHAR)) ALTER TABLE MY_OBJECTS modify (OBJECT_NAME VARCHAR2(30 CHAR)) ALTER TABLE MY_OBJECTS modify (SUBOBJECT_NAME VARCHAR2(30 CHAR)) ALTER TABLE MY_OBJECTS modify (OBJECT_ID NUMBER(22)) ALTER TABLE MY_OBJECTS modify (DATA_OBJECT_ID NUMBER(22)) ALTER TABLE MY_OBJECTS modify (OBJECT_TYPE VARCHAR2(19 CHAR)) ALTER TABLE MY_OBJECTS modify (CREATED DATE(7 CHAR)) ALTER TABLE MY_OBJECTS modify (LAST_DDL_TIME DATE(7 CHAR)) ALTER TABLE MY_OBJECTS modify (TIMESTAMP VARCHAR2(19 CHAR)) ALTER TABLE MY_OBJECTS modify (STATUS VARCHAR2(7 CHAR)) ALTER TABLE MY_OBJECTS modify (TEMPORARY VARCHAR2(1 CHAR)) ALTER TABLE MY_OBJECTS modify (GENERATED VARCHAR2(1 CHAR)) ALTER TABLE MY_OBJECTS modify (SECONDARY VARCHAR2(1 CHAR)) Done
Concerning
Published by: OrionNet on January 5, 2009 23:53
Published by: OrionNet on January 5, 2009 23:55
-
PL/SQL: ORA-00904: invalid identifier
Hello
Run the script after and encountered the error.
SQL > create or replace FUNCTION p_CQTicketUsu
() 2
3 v_TicketUserID IN NUMBER by DEFAULT NULL,-it's the [CQTicketUsers]. TicketUserID generated on update
4 v_TicketID IN NUMBER by DEFAULT NULL,-it's the [CQTicketUsers]. TicketID update
5 v_AdminUserID IN NUMBER by DEFAULT NULL,-it's the [CQTicketUsers]. AdminUserID update
6 v_TicketUserTypeID IN NUMBER by DEFAULT NULL - this is the [CQTicketUsers]. TicketUserTypeID update
7)
8 RETURN NUMBER
9, ACCORDING TO
10 v_sys_error NUMBER: = 0;
11 v_ERRSQL NUMBER (10,0);
12 v_UpdCount NUMBER (10,0);
13
BEGIN 14
15
16 UPDATE CQTicketUsers
17 SET v_TicketUserID = TicketUserID,
18 v_TicketID = TicketID,
19 v_AdminUserID = AdminUserID,
20 v_TicketUserTypeID = TicketUserTypeID
21 WHERE TicketUserID = v_TicketUserID;
22 v_ErrSQl: = v_sys_error;
23 v_UpdCount: = SQL % ROWCOUNT;
24 IF v_ErrSQL <>0 THEN
25 RETURN-1;
26 END IF;
27 IF v_Updcount < 1 THEN
28 RETURN - 2;
29 END IF;
30 RETURN 0;
ENDS 31;
32.
WARNING: Function created with compilation errors.
SQL > show error
Errors for the P_CQTICKETUSU FUNCTION:
16/4 PL/SQL: statement ignored
20/11 PL/SQL: ORA-00904: "V_TICKETUSERTYPEID": invalid identifier
Please note, I said v_TicketUserTypeID to the #6 line. Advice kindly.
Kind regards
Ballanger
It's going to be kind of embarrassing, but you have the update parameters reversed. It should be
TicketUserTypeID = v_TicketUserTypeID
and is not
v_TicketUserTypeID = TicketUserTypeID
You get this error for database columns not only for pl/sql variables.
-
I have a PL/SQL script, processing of information between Oracle and MySQL databases. My script runs perfectly with DG4ODBC 11.1.0.7. Then we went from Oracle 10.2.0 and 11.2.0.2 DG4ODBC. Now, if I run my script from command line Solaris love. / myscript.shl, I get the following errors:
PL/SQL: ORA-00904: "cmswhit_moodle1." "" "" mdl_grade_grades "." finalgrade ": invalid identifier.
PL/SQL: ORA-00904: "cmswhit_moodle1." "" "" mdl_question_states '. "the attempt": invalid identifier "
The strange thing is that if I run the same query by cut and paste in sqlplus command line, the application works perfectly without any problems.
What is the cause of this problem?
Any help would be greatly appreciated.
Jeffrey
Hi Klaus,
The problem has been resolved after I upgraded MySQL ODBC to a new version of 5.1.8 to 5.1.13.
Summary of the problem and its solution:
The problem: It seems that dg4odbc 11.2.0.2 requires a newer version of MyODBC. Previously, I used MyODBC 5.1.8, which ran into problems with dg4odbc 11.20.0.2.
The Solution: After that I upgraded 5.1.13 MyODBC, my PL/SQL scripts all work.
I need to point out that with that MyODBC 5.1.8, I can run queries and updates to SQL * more console, but now the PL/SQL scripts.
I'm going to close this message.
Once again, thank you and happy holidays.
Jeffrey
-
java.sql.SQLSyntaxErrorException: ORA-00904: invalid identifier
Hi all
IM using JDeveloper 11.1.1.6.0.
Here, I said method in the main class, which returns an object of type of connection reference.
When I run the app I type 'ksh' in the fields and click on submit.
It shows the following error, java.sql.SQLException: ORA-00904: "KSH": invalid identifier
{code}
public static list < privileges > getUserPrivileges (DBTransaction dbt, object userId)
{
String sql = "SELECT m.menu_code" +.
"OF sec_menus m p sec_menu_privileges JOIN +.
"WE (m.menu_code = p.menu_code '+)"
"(ET m.app_id = p.app_id)" + "
"JOIN sec_user_app_groups g +.
"WE (g.GROUP_ID = p.GROUP_ID '+)"
"AND p.app_id = g.app_id" +.
"AND user_id =" + userId + "."
" )";
PreparedStatement stat = null;
ResultSet rs = null;
List of privileges <>privilegesList = new ArrayList < privileges > ();
MenuCode string = "";
Try
{
= stat dbt.createPreparedStatement (sql, 1);
RS = stat.executeQuery ();
While (RS. Next())
{
menuCode = rs.getString (1);
}
}
catch (System.Exception e)
{
e.printStackTrace ();
}
Finally
{
closeStatement (stat);
closeResultSet (SR);
}
Return privilegesList;
}
Public Shared Sub closeStatement (stat of statement)
{
Try
{
STAT. Close();
}
catch (SQLException e)
{
}
}
public static void closeResultSet (ResultSet rs)
{
Try
{
RS. Close();
}
catch (SQLException e)
{
}
}
------------
CREATE TABLE SEC_USERS
(
USER_ID VARCHAR2 (10),
USER_NAME VARCHAR2 (50).
PASSWORD VARCHAR2 (300)
)
Insert into SEC_USERS
(USER_ID, USER_NAME, USER_FIRST_NAME, USER_LAST_NAME, PASSWORD)
Values
('ksh', 'ksh', 'test');
COMMIT;
-----------------------
Error:
java.sql.SQLSyntaxErrorException: ORA-00904: "KSH": invalid identifier
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:462)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:931)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:481)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:205)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:548)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:947)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1283)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1441)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3769)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3823)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1671)
dry. ControllerUtil.getUserPrivileges (ControllerUtil.java:90)
dry. ControllerUtil.login (ControllerUtil.java:59)
at sec.model.AppModuleImpl.login(AppModuleImpl.java:77)
at sec.control.bean.LoginPage.loginAction(LoginPage.java:92)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke (unknown Source)
at com.sun.el.MethodExpressionImpl.invoke (unknown Source)
at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
to oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$ 1.run(ContextSwitchingComponent.java:92)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
to oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$ 1.run(ContextSwitchingComponent.java:92)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:889)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:379)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:446)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:446)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:179)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
to oracle.security.jps.ee.http.JpsAbsFilter$ 1.run(JpsAbsFilter.java:119)
at java.security.AccessController.doPrivileged (Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.wrapRun (WebAppServletContext.java:3715)
to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
< ActionListenerImpl > < processAction > java.lang.NullPointerException
javax.faces.el.EvaluationException: java.lang.NullPointerException
at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
to oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$ 1.run(ContextSwitchingComponent.java:92)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
to oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$ 1.run(ContextSwitchingComponent.java:92)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:889)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:379)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:446)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:446)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:179)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
to oracle.security.jps.ee.http.JpsAbsFilter$ 1.run(JpsAbsFilter.java:119)
at java.security.AccessController.doPrivileged (Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.wrapRun (WebAppServletContext.java:3715)
to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused by: java.lang.NullPointerException
dry. ControllerUtil.closeResultSet (ControllerUtil.java:136)
dry. ControllerUtil.getUserPrivileges (ControllerUtil.java:118)
dry. ControllerUtil.login (ControllerUtil.java:59)
at sec.model.AppModuleImpl.login(AppModuleImpl.java:77)
at sec.control.bean.LoginPage.loginAction(LoginPage.java:92)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke (unknown Source)
at com.sun.el.MethodExpressionImpl.invoke (unknown Source)
at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
... more than 54
{\code}
Thanks in advance
The particular error that causes the ORA-00904 exception, it's that you concatenate a string literal in the SQL statement without enclosing the literal with quotes. Replace the line
"AND user_id =" + userId + "."
with
"AND user_id = '" + Userid + "'" +.
Although it will work in this way, the concatenation of literal values variable to a SQL statement is a very wrong approach. The right approach is to use a placeholder variable (for example?) in the SQL statement and to link it with the necessary value after analysis of the declaration and before running. In this way, you will be able to analyze the statement once and execute it several times with different values without new analysis view the statement. Also, the SQL engine will be able to use its SQL cache if you try to analyze the statement even once again, which will significantly improve performance. However, if you concatenate variable literal value to education, engine SQL won't recognize the statement as one already analyzed, it will not use its cache and it will analyze the statement again from scratch. From a point of view shortly, the best approach is as follows:
"" AND user_id =? ".
and then
= stat dbt.createPreparedStatement (sql, 1);
stat.setString (1, userId); Don't forget to change the username to a string type in the method declaration
RS = stat.executeQuery ();
There are other problems in your code. First of all, the invocation closeResultSet (rs) after closeStatement (stat) is erroneous and obsolete, because when you close a SQLStatement instance it automatically closes all its result sets. Secondly, in the finally block you call closeStatement (stat), but there is no guarantee that stat variable is not null. For example, the variable stat can be null if the SQLStatement instance has not been established successfully in the try section above.
Dimitar
-
Hi gurus,
Your help is greatly appreciated.
Will I have a fucntion where we have the object it contains.
The changes that I have doen are: 2 new cusrosrs, but its failure with the error below.
Highlighted are the changes I made. his length very well before your help is greatly appreciated.
1) PL/SQL: ORA-00904: "GET_ACQ_ID.". ' ACQ_ID ': invalid identifier.
(2) PLS-00225: subprogram or cursor reference 'GET_ACQ_ID' is out of range
Here is the code:
_________________________________________________________________________
FUNCTION GET_IP_COMM_INFO return PROD. TERMINAL_IP_COMM_INFO_TAB IS
vTer TER.ter_id%TYPE;
vAPPL_ID TAC.appl_id%TYPE;
vValue TSF.vALUE%TYPE;IP_COMM_INFO_LIST PROD. TERMINAL_IP_COMM_INFO_TAB: = PROD. TERMINAL_IP_COMM_INFO_TAB();
CURSOR GET_ACQ_ID IS
SELECT ACQ_ID
TER TAHA, MERC M, PROF
WHERE T.MER_ID = M.MER_ID
AND M.PROFID = P.PROF_ID
AND T.TER_ID = vTer_id;
CURSOR GET_INFO_CURSOR IS
SELECT H.DESCRIPTION AS HOST_DESCRIPTION
PROD. HOST H, PROD. APP_IP_COMM_ACCESS_INFO AICAI
WHERE (AICAI. HOST_ID = H.HOST_ID) and
(AICAI. APPL_ID = vAPPL_ID);CURSOR GET_ACQ_CURSOR IS
SELECT H.DESCRIPTION AS HOST_DESCRIPTION
PROD. HOST H, PROD. APP_IP_COMM_ACCESS_INFO AICAI, PROD. ACQUIRER_IP_COMM_ACCESS_INFO ACICAI
WHERE (AICAI. HOST_ID = H.HOST_ID) and
(AICAI. APPL_ID = vAPPL_ID) AND
(ACQUIRER_ID = GET_ACQ_ID. ACQ_ID);
BEGIN
vTer_id: = GLOBAL_VARIABLES.gv_ref_Ter_id;BEGIN
SELECT the VALUE IN vvalue OF Tsf
WHERE TER_id = vTEr_ID AND APPL_ID is vAPPL_ID and FEATURE_ID = 861;.Vvalue = '04' IF THEN
For GET_ACQ_REC IN GET_ACQ_CURSOR
LOOP
IP_COMM_INFO_LIST. EXTEND;
IP_COMM_INFO_LIST (IP_COMM_INFO_LIST. (COUNTY): = PROD. TERMINAL_IP_COMM_INFO_OBJ (GET_ACQ_REC. HOST_DESCRIPTION);
END LOOP;
ON THE OTHER
FOR GET_INFO_REC IN GET_INFO_CURSOR
LOOP
IP_COMM_INFO_LIST. EXTEND;
IP_COMM_INFO_LIST (IP_COMM_INFO_LIST. (COUNTY): = PROD. TERMINAL_IP_COMM_INFO_OBJ (GET_INFO_REC. HOST_DESCRIPTION);
END LOOP;
END IF;RETURN IP_COMM_INFO_LIST;
EXCEPTION WHEN OTHERS THEN
LIFT;
END GET_IP_COMM_INFO;----------------------------------------------------------
You try to access another variable of slider within the slider...
CURSOR GET_ACQ_CURSOR IS
SELECT H.DESCRIPTION AS HOST_DESCRIPTION
PROD. HOST H, PROD. APP_IP_COMM_ACCESS_INFO AICAI, PROD. ACQUIRER_IP_COMM_ACCESS_INFO ACICAI
WHERE (AICAI. HOST_ID = H.HOST_ID) and
(AICAI. APPL_ID = vAPPL_ID) AND
(ACQUIRER_ID = GET_ACQ_ID. ACQ_ID );
But you have not opened this slider, or anything like that.
You will probably need to pass as a parameter, just like a function:
(not sure of the type of data, so I assumed that the NUMBER)
CURSOR GET_ACQ_CURSOR (NUMBER in_acq_id) IS
SELECT H.DESCRIPTION AS HOST_DESCRIPTION
PROD. HOST H, PROD. APP_IP_COMM_ACCESS_INFO AICAI, PROD. ACQUIRER_IP_COMM_ACCESS_INFO ACICAI
WHERE (AICAI. HOST_ID = H.HOST_ID) and
(AICAI. APPL_ID = vAPPL_ID) AND
(ACQUIRER_ID = in_acq_id );
When you call this type, you must pass a value... So, it seems that you first call the other cursor.
Change this code:
IF Vvalue = ' 04 "THEN
FOR GET_ACQ_REC IN GET_ACQ_CURSOR
LOOP
IP_COMM_INFO_LIST. EXTEND;
IP_COMM_INFO_LIST (IP_COMM_INFO_LIST. (COUNTY): = PROD. TERMINAL_IP_COMM_INFO_OBJ (GET_ACQ_REC. HOST_DESCRIPTION);
END LOOP;
ON THE OTHER
To do this:
IF Vvalue = ' 04 "THEN
FOR GET_ACQ_ID_REC IN GET_ACQ_ID IS
LOOP
FOR GET_ACQ_REC IN GET_ACQ_CURSOR (get_acq_id_rec.acq_id)
LOOP
IP_COMM_INFO_LIST. EXTEND;
IP_COMM_INFO_LIST (IP_COMM_INFO_LIST. (COUNTY): = PROD. TERMINAL_IP_COMM_INFO_OBJ (GET_ACQ_REC. HOST_DESCRIPTION);
END LOOP;
END LOOP;
ON THE OTHER
(Or something like that)
I wasn't sure if your GET_ACQ_ID cursor returns only 1 row or not? If it returns more than 1 row, how to cope, you do not specify.
If it's just 1 row, then you can probably simplify it a little more:
IF Vvalue = ' 04 "THEN
SELECT ACQ_ID
in l_acq_id
TER TAHA, MERC M, PROF
WHERE T.MER_ID = M.MER_ID
AND M.PROFID = P.PROF_ID
AND T.TER_ID = vTer_id;
FOR GET_ACQ_REC IN GET_ACQ_CURSOR (l_acq_id)
LOOP
IP_COMM_INFO_LIST. EXTEND;
IP_COMM_INFO_LIST (IP_COMM_INFO_LIST. (COUNTY): = PROD. TERMINAL_IP_COMM_INFO_OBJ (GET_ACQ_REC. HOST_DESCRIPTION);
END LOOP;
ON THE OTHER
Hope that helps.
-
Why this error ORA-00904: invalid identifier
Hi all
Please advice me what is wronge with this
ORA-00904: "NONE": invalid identifier
create or replace trigger test_table2
before inserting
on Ta
for each line
declare
v2_none_con varchar2 (20);
v2_none_con2 varchar2 (20);
I have number (10);
TYPE v2_EmpCurTyp IS REF CURSOR;
v2_emp_cursor v2_EmpCurTyp;
v2_stmt_str VARCHAR2 (200);
RECORD IS of TYPE v2_employee_type (v_rowid varchar (100));
v2_emp_content v2_employee_type;
Start
v2_none_con2: = 'NONE ';
v2_stmt_str: = 'select rowid from t1 where name =' v2_none_con2;
I: = 0;
V2_emp_cursor OPEN FOR v2_stmt_str;
LOOP FETCH v2_emp_cursor INTO v2_emp_content;
EXIT WHEN v2_emp_cursor % NOTFOUND;
dbms_output.put_line (v2_emp_content.v_rowid);
i: = i + 1;
v2_none_con: = 'NO ' | TO_CHAR (i);
END LOOP;
end;
SQL > /.
Insert in your values (10, 'W')
*
ERROR on line 1:
ORA-00904: "NONE": invalid identifier
ORA-06512: in the 'END. TEST_TABLE2', line 15
ORA-04088: error during execution of trigger ' FINAL. TEST_TABLE2'
SQL >First of all:
v2_stmt_str: = 'select rowid from t1 where name =' v2_none_con2;
I would give you compilation errors. I guess the real code is:
v2_stmt_str: = 'select rowid from t1 where name =' | v2_none_con2;
Now that the text of the statement would be? V2_none_con2 is 'NONE', dynamic SQL would be:
Select rowid from t1 where name = NONE
It is obvious, it will trigger ORA-00904 (except a column named NONE t1). What you want is:
Select rowid from t1 where name ='' NONE
So change:
v2_stmt_str: = 'select rowid from t1 where name =' | v2_none_con2;
TO
v2_stmt_str: = ' select rowid from t1, whose name =="' | v2_none_con2 | '''';
SY.
-
Gateway to Oracle ORA-00904: invalid identifier - how to fix it
Database: 11.2.0 32-bit Windows (under Windows XP SP3)
ORACLE_HOME = D:\Oracle\Product\11.2.0\dbhome
GATEWAY_HOME = D:\Oracle\Product\11.2.0\gw
ODBC: SQL Server (works... I can import the data from the table in MS Excel) its ok...
ODBC: dg4msql (works... I can import the data from the table in MS Excel) its ok...
Oracle GateWay listening port
D:\Oracle\Product\11.2.0\gw\NETWORK\ADMIN
listener.ora # Network Configuration file: D:\Oracle\Product\11.2.0\gw\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_GWLISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = dg4msql)
(ORACLE_HOME = D:\Oracle\Product\11.2.0\gw)
(ENVS = "EXTPROC_DLLS=ONLY:D:\Oracle\Product\11.2.0\gw\bin\oraclr11.dll")
(PROGRAM = dg4msql)
)
(SID_DESC =
(SID_NAME = dg4msql)
(ORACLE_HOME = D:\Oracle\Product\11.2.0\gw)
(PROGRAM = dg4msql)
)
)
GWLISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = CIP)(KEY = EXTPROC1522))
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.90)(PORT = 1522))
)
)
ADR_BASE_GWLISTENER = D:\Oracle\Product\11.2.0\gw
Gateway listener status
LSNRCTL > status GWLISTENER
Connection to (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1522)))
STATUS of the LISTENER
------------------------
Alias GWLISTENER
Version TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Prod
ction
Start date October 13, 2011 11:36:16
Uptime 0 days 0 h 29 min 43 sec
Draw level off
Security ON: OS Local Authentication
SNMP OFF
Listener parameter File D:\Oracle\Product\11.2.0\gw\network\admin\listener.ora
D:\oracle\product\11.2.0\gw\diag\tnslsnr\appsdba\gwlis log listener
tener\alert\log. XML
Summary of endpoints listening...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1522ipc)))
(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp (PORT = 1522))(HOST=192.168.0.90)))
Summary of services...
Service 'dg4msql' has 1 instance (s).
Instance of 'dg4msql', status UNKNOWN, has 2 managers of this service...
The command completed successfully
LSNRCTL >
D:\Oracle\Product\11.2.0\gw\network\admin\sqlnet.ora
sqlnet.ora # Network Configuration file: D:\Oracle\Product\11.2.0\gw\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
# This file is actually generated by netca. But if customers can opt for
# install 'Software Only', this file does not exist and without the native
authentication #, they will not be able to connect to the database on NT.
SQLNET. AUTHENTICATION_SERVICES = (NTS)
NAMES. DIRECTORY_PATH = (TNSNAMES, EZCONNECT)
D:\Oracle\Product\11.2.0\gw\dg4msql\admin\initdg4msql.ora
# This is a custom agent init file which contains the parameters of HS
# which are necessary for the Microsoft SQL Server database gateway
#
# HS init parameters
#
#HS_FDS_CONNECT_INFO=[192.168.0.8]/SRV-TULIP/WZHRM
HS_FDS_CONNECT_INFO=192.168.0.8,1433//wzhrm
HS_FDS_TRACE_LEVEL = OFF
HS_FDS_RECOVERY_ACCOUNT = RECOVERY
HS_FDS_RECOVERY_PWD = RECOVERY
---------------------------------------------------------------------------------------------------------------------------------------------------
D:\Oracle\Product\11.2.0\dbhome\NETWORK\ADMIN\tnsnames.ora
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.90)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
PROD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = tcp)(HOST=192.168.0.230) (PORT = 1521))
(CONNECT_DATA = (SID = PROD))
)
SqlServer =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = tcp)(HOST=192.168.0.90) (PORT = 1521))
(CONNECT_DATA =
(SID = SqlServer))
(HS = OK)
)
dg4msql =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = tcp (PORT = 1522))(HOST=192.168.0.90))
(CONNECT_DATA = (SID = dg4msql))
(HS = OK)
)
Link to database
create database link dg4msql connect to usroracle identified by usroracle using 'dg4msql ';
1 * Select in rvwHLoanApp@dg4msql*
SQL > /.
empId description
------ ---------------------------------------------------------
Mr. Ali Jawad 0001
0002 M. Imran Farooq
0003 M. Ali elmardi
Mr. Mujahid Muhammad 0004
0005 M. Vassallo Malik
Mr. Kashif Imran 0006
Mr. Adeel Sadiq 0009
empId description
------ ---------------------------------------------------------
Mr. Hafiz Muhammad Bilal 0010
Mr. Asif Ahmad Arif 0012
Mr. Muhammad Akram 0018
0019 Mr. Aftab Hussain
Mr. Johann Ménard Attari 0020
Mr. Adnan Saleem Raza 0022
0023 Mr. Badar-Uz-Zaman
15 selected lines.
When to try for some clumns his watch an error. Where the problem lies
SQL > select empId from rvwHLoanApp@dg4msql;
Select empId from rvwHLoanApp@dg4msql
*
ERROR on line 1:
ORA-00904: "EMPID": invalid identifier
SQL > select empId, description of rvwHLoanApp@dg4msql;
Select empId, rvwHLoanApp@dg4msql description
*
ERROR on line 1:
ORA-00904: "DESCRIPTION": invalid identifier
SQL >
SQL >
Waiting for relief. What thing im missing...Naeem,
SQL * Server is case-sensitive for object names must surround the names of columns with double quotes to preserve the case sent to SQL * Server.Select 'empId', 'description' of the rvwHLoanApp@dg4msql;
According to the SQL * Server configuration, you might also need to surround the name of the table in quotes also.
Select "empId", "description" "rvwHLoanApp"@dg4msql;
but this is not necessary in your configuration.
Kind regards
Mike -
Subqueries, addressing deep gives ORA-00904: invalid identifier
Why the following query gives the error:
But this query succeeds:with T as ( select 1 ID from dual union all select 2 ID from dual ) select ID from T where 1 = ( select Cnt from ( select count(*) Cnt from T innerT where innerT.ID = T.ID ) ) /*ORA-00904: "T"."ID": invalid identifier*/ ;
Why the first query gives grammatice "error? There in one addressing deep enough level to the outside world, which seems to be a problem:with T as ( select 1 ID from dual union all select 2 ID from dual ) select ID from T where 1 = ( select count(*) Cnt from T innerT where innerT.ID = T.ID ) /*1 2*/ ;
Can you explain why such a thing is not allowed?innerT.ID = T.ID
Hello
I think it's because correlated subqueries cannot be nested rather than on a single level.
The inner query external very table T is 2 levels.In the second case, there only one & level between inner query and table T, so it works.
I'll try to find some useful links to this topic...
And here's one:
AskTomPublished by: Nicosa 31 May 2010 06:02
(I can't get the link to display correctly...)Published by: Nicosa 31 May 2010 06:02
-
ORA-00904: invalid identifier
Hi all
I'm getting ORA-00904: "SNO_T": invalid identifier will be done in this example. Please let me know where I have error.
create table t4(name varchar2(22),sno number); insert into t4 values('suman2',2); insert into t4 values('suman',1); create or replace type t4_t as object( name_t varchar2(22), sno_t number ); create or replace type t4_m is table of t4_t; / declare l_toys t4_m; l1 pls_integer; begin select t4_t(name_t,sno_t) bulk collect into l_toys from t4; -- DBMS_OUTPUT.PUT_line(l_toys.count); select count(*) into l1 from t4; DBMS_OUTPUT.PUT_line(l1); end; Error report - ORA-06550: line 5, column 21: PL/SQL: ORA-00904: "SNO_T": invalid identifier ORA-06550: line 5, column 2: PL/SQL: SQL Statement ignored 06550. 00000 - "line %s, column %s:\n%s" *Cause: Usually a PL/SQL compilation error. *Action:
Select t4_t (name_t, sno_t)
bulk collect into l_toys
T4;
the columns in your table are called name and sno, so you must use these names in your select statement
t4_t is the manufacturer that expects two values (a string and a number) and having built an object, you will be able to access the object by using object_name.sno_t, but do not all by building this...
HTH
-
The DDL extract fail with ORA-30511: invalid operation of DDL TRIGGER system
Hello
When I tried to do all DDL operation I can see the following trace in ggs_ddl_trace.log with the trace level 2.
It does not insert record in the GGS_DDL_HIST table.
everything seems only when ddl_status.sql has been run...
DDL replication is not the case.
Help, please.
SESS 30445-2012-04-12 11:16:09: DDL: start YVERT found [1147628]
SESS 30445-2012-04-12 11:16:09: DDL: object ID is [74635]
SESS 30445-2012-04-12 11:16:09: DDLTRACE1: before: point in execution = [4]
SESS 30445-2012-04-12 11:16:09: DDLTRACE1: insertToMarker: inString =]
SESS 30445-2012-04-12 11:16:09: DDLTRACE1:
[SESS 30445-2012-04-12 11:16:09: DDLTRACE1:], type = target [0] = [1]
SESS 30445-2012-04-12 11:16:09: DDLTRACE2: insertToMarker: optype marker = [0], current_fragment = [0]
SESS 30445-2012-04-12 11:16:09: DDLTRACE2: insertToMarker: added the fragment part * 1 *]
SESS 30445-2012-04-12 11:16:09: DDLTRACE2:
[[SESS 30445-2012-04-12 11:16:09: DDLTRACE2:], new current fragment [], new length of it]
SESS 30445-2012-04-12 11:16:09: DDLTRACE1: itemHeader: MD_TAB_DDLSTATEMENT (key1 = key2 [] = []) = [change the 'GGUSER' table. ["' Adds YASEEN" (column2 VARCHAR2 (30))], itemMode = [0]
SESS 30445-2012-04-12 11:16:09: DDLTRACE2: escape_string: retVal = ['alter table 'GGUSER'.] ["" YASEEN ' add\ (VARCHAR2\ (30\)------) of Column2 ']
SESS 30445-2012-04-12 11:16:09: DDLTRACE2: itemHeader: retVal = [, G1 =' alter table 'GGUSER'.] ["" YASEEN ' add\ (VARCHAR2\ (30\)------) of Column2 ',]
SESS 30445-2012-04-12 11:16:09: DDLTRACE1: insertToMarker: inString =]
SESS 30445-2012-04-12 11:16:09: DDLTRACE1:, G1 =' alter table 'GGUSER '. "" YASEEN ' add\ (column2 VARCHAR2\ (30\)------) ',
[SESS 30445-2012-04-12 11:16:09: DDLTRACE1:], type = target [4] = [1]
SESS 30445-2012-04-12 11:16:09: DDLTRACE2: insertToMarker: optype marker = [4], current_fragment = [0]
SESS 30445-2012-04-12 11:16:09: DDLTRACE2: insertToMarker: added the fragment part * 2 *]
SESS 30445-2012-04-12 11:16:09: DDLTRACE2:, G1 =' alter table 'GGUSER '. "" YASEEN ' add\ (column2 VARCHAR2\ (30\)------) ',
[SESS 30445-2012-04-12 11:16:09: DDLTRACE2:], new ongoing fragment [, G1 =' alter table 'GGUSER'.] ["" YASEEN ' add\ (VARCHAR2\ (30\)------) of Column2 ',], new length of it [66]
[SESS 30445-2012-04-12 11:16:09: DDLTRACE1: insertToMarker: total_fragments =]
SESS 30445-2012-04-12 11:16:09: DDLTRACE1: insertToMarker: total_fragments (in a loop) = [1]
SESS 30445-2012-04-12 11:16:09: DDLTRACE1: insertToMarker: fragment # = [1] fragment = [, G1 =' alter table 'GGUSER'.] ["" YASEEN ' add\ (VARCHAR2\ (30\)------) of Column2 ',]
SESS 30445-2012-04-12 11:16:09: DDLTRACE1: insertToMarker: insertion in the history, objid [74635]
SESS 30445-2012-04-12 11:16:09: DDL: insertToMarker: ORA-30511: invalid DDL operation in the system triggers
SESS 30445-2012-04-12 11:16:09: DDL: getTableInfo: ORA-30511: invalid DDL operation in the system triggers
* SESS 30445-2012-04-12 11:16:09: DDL: trigger sys. GGS_DDL_TRIGGER_BEFORE: processing error DDL operation [change the 'GGUSER' table. ["' Adds to the YASEEN" (VARCHAR2 (30)) Column2], error ORA-30511: invalid DDL operation in the system triggers, stack error: ORA-06512: at 'GGUSER '. DDLREPLICATION', line 2486 *.
ORA-06512: at line 833 level
SESS 30445-2012-04-12 11:16:09: DDL: cleaning sequence marker [17]
SESS 30445-2012-04-12 11:16:09: DDL: cleaned [2] marker table rows
SESS 30445-2012-04-12 11:16:09: DDL: cleaning sequence DDL [17]
SESS 30445-2012-04-12 11:16:09: DDL: cleaned [0] lines of the DDL tableHello
The recyclebin database is empty. Otherwise please purge the recyclebin and then try to make the changes.
Thank you
Kamal. -
ORA-00904 invalid identifier with the insert command
Please inform me of what's wrong with insert.
Declare
cursor c1 is
Select column_name as Column_namee, data type data_type, data_length as datalen ALL_TAB_COLUMNS where table_name = upper('ALI');
temp_col_names varchar2 (1000);
BEGIN
for j in loop c1
temp_col_names: = temp_col_names | j.column_namee | «, » ;
end loop;
Select substr (temp_col_names, 0, length (temp_col_names)-1) in the double temp_col_names;
dbms_output.put_line (temp_col_names);
INSERT INTO temp_col_names (temp_col_names) SELECT id WHERE Ali ali2 = 4;
END;This means that there is no temp_col_names of the column in the table ALI2. Looks like you are the dynamic SQL search - you want to insert all the table columns ALI in the same set of columns in table ALI2, right? Then use:
EXECUTE IMMEDIATE ' INSERT INTO ali2 (' | temp_col_names |) ') SELECT ' | temp_col_names | "Ali WHERE id = 4';
SY.
-
I'm running 64 Bit Windows JDK 7 connecting to Oracle DB 10.1.0.5.0. Access the Plan to explain in the tool monitor Sessions tab causes the error. This has been true in all 4. releases.
Copy of the report of sessions monitor down to a user defined report, check out the SQL used in the Plan to explain tab and try to run in your 10.1.0.5 database. We do not support this version of the database, but you can change to the sql in your report defined by the user to work for this instance if necessary.
-
ORA-00904 invalid IDENTIFIER IS to COME WHEN you RUN THE AVERAGE SCALAR
SELECT (SELECT tran_descn FROM TRANCODEINFO WHERE a.txn_type = tran_code
) As txn_type, a.tot,.
*(*
SELECT COUNT () OF (* _)
_ SELECT f.txn_auth_id FROM FINGERTXNLOG WHERE f.bank_id = '515' f AND f.txn_date_time BETWEEN
TO_DATE (' ' 2011-03-01 00:00:00 ', ' DD/MM/YY HH24:MI:SS') AND TO_DATE (' ' 2011-11-17 23:59:59 ', ' DD/MM/YY HH24:MI:SS')_
_ AND f.txn_status = 'C' AND f.txn_type = 'BV' AND f.txn_type = a.txn_type AND f.terminal_id = NVL('',f.terminal_id)
*) a*
)
AS (OF) succ_records
SELECT f.txn_type, COUNTY of f (f.txn_auth_id) AS total FROM FINGERTXNLOG WHERE f.bank_id = '515' AND f.txn_date_time BETWEEN
TO_DATE (' ' 2011-03-01 00:00:00 ', ' DD/MM/YY HH24:MI:SS') AND TO_DATE (' ' 2011-11-17 23:59:59 ', ' DD/MM/YY HH24:MI:SS')
AND f.txn_type = 'BV' AND f.terminal_id = NVL('',f.terminal_id) GROUP BY f.txn_type
) athe format of the request, removed some features of underscores and commented on some useless *.
This is what you want?SELECT ( SELECT tran_descn FROM TRANCODEINFO WHERE tran_code = a.txn_type ) AS txn_type, a.tot, ( --* SELECT COUNT (*) FROM (--* SELECT f.txn_auth_id FROM FINGERTXNLOG f WHERE f.bank_id = '515' AND f.txn_date_time BETWEEN TO_DATE ('2011-03-01 00:00:00','YY/MM/DD HH24:MI:SS') AND TO_DATE ('2011-11-17 23:59:59','YY/MM/DD HH24:MI:SS') AND f.txn_status = 'C' AND f.txn_type = 'BV' AND f.txn_type = a.txn_type AND f.terminal_id = NVL('',f.terminal_id) ) a ) AS succ_records FROM ( SELECT f.txn_type , COUNT (f.txn_auth_id) AS tot FROM FINGERTXNLOG f WHERE f.bank_id = '515' AND f.txn_date_time BETWEEN TO_DATE ('2011-03-01 00:00:00','YY/MM/DD HH24:MI:SS') AND TO_DATE ('2011-11-17 23:59:59','YY/MM/DD HH24:MI:SS') AND f.txn_type = 'BV' AND f.terminal_id = NVL('',f.terminal_id) GROUP BY f.txn_type ) a
Maybe you are looking for
-
How to get a list of all available updates and dependencies for the MS products
We are currently working on a patch report (compliance policies). We need to scan all workstations for the patches installed (already DONE!). Now we need to get a XML / List / or something telling us all the patches to release MS, affected software a
-
Windows cannot validate my copy of xp pro, although his active summer AND IS a TRUE COPY
as in the title, had to buy a new hard drive, had to format, etc, etc and reinstall my windows XP Pro, said it has not been activated? (due 30 days to do so, downloaded sp3, now the genuine validation tool says it cannot validate my copy, even if isu
-
I have a thaqt process starts every time that I try to start most of the programs 'anb.exe '. Sound of the antimalware doctor virus. I can't find the executable file for delete and I can't do it again. It prevents me from access to the internet or fr
-
How can I enable virus protection in the Windows Security Center after he died suddenly?
This has always been on, yesterday it shuts off and cannot find a way to get it back on. My computer already has Symantec Protection.
-
800b0100 Code was published after a Windows Update failed... help!
Often this error code appears when the Windows update fails... it does more often than otherwise. The Windows Update is marked as "Important", but if it fails most of the time, I just wonder HOW important it is... Any comments will be greatly apprec