Getting ORA-00904 whle running a procedure!

hi ,
the following procedure is meant for getting the details which has name of the user tables alone along with number of columns,but am getting -ERROR IN BLOCK:::ORA-00904: "tablename": invalid identifier.
DECLARE
v_cols NUMBER:=0;
cursor c is SELECT table_name FROM user_tables ORDER BY table_name;
BEGIN
FOR rec IN c
LOOP
v_cols:=0;
EXECUTE IMMEDIATE 'select count(COLUMN_NAME) from all_col_comments where TABLE_NAME in ('||rec.table_name||') group by TABLE_NAME' INTO v_num_rows;
DBMS_OUTPUT.PUT_LINE (RPAD (rec.table_name, 32) || LPAD (v_num_rows, 9));
END LOOP;
DBMS_OUTPUT.PUT_LINE ('-------------------End_of_Script-------------------');
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('ERROR IN BLOCK:::'||SQLERRM);
END;
if there anything needs to change in procedure ,let me know.

DECLARE
       v_cols NUMBER:=0;
       cursor c is SELECT table_name FROM user_tables ORDER BY table_name;
BEGIN
       FOR rec IN c
      LOOP
          v_cols:=0;
      EXECUTE IMMEDIATE 'select count(COLUMN_NAME) from all_col_comments where TABLE_NAME in ('''||rec.table_name||''') group by TABLE_NAME' INTO v_num_rows;      ------> Added '' before and After Table Name to allow Oracle to consider as String
          DBMS_OUTPUT.PUT_LINE (RPAD (rec.table_name, 32) || LPAD (v_num_rows, 9));
      END LOOP;
      DBMS_OUTPUT.PUT_LINE ('-------------------End_of_Script-------------------');
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('ERROR IN BLOCK:::'||SQLERRM);
END;You can use below version using Parameter Binding (Untested!!!)
DECLARE
       v_cols NUMBER:=0;
       cursor c is SELECT table_name FROM user_tables ORDER BY table_name;
BEGIN
       FOR rec IN c
      LOOP
          v_cols:=0;
      EXECUTE IMMEDIATE 'select count(COLUMN_NAME) from all_col_comments where TABLE_NAME in (:1) group by TABLE_NAME' INTO v_num_rows using rec.table_name;
          DBMS_OUTPUT.PUT_LINE (RPAD (rec.table_name, 32) || LPAD (v_num_rows, 9));
      END LOOP;
      DBMS_OUTPUT.PUT_LINE ('-------------------End_of_Script-------------------');
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('ERROR IN BLOCK:::'||SQLERRM);
END;

Similar Messages

  • Getting ora-0600 when running PROFLOAD.sql

    Hi,
    I was getting ORA-0600 when running PROFLOAD.sql script for DBMS_PROFILER (from SYS account). I am running Oracle 9i personal edition on win98. Did anybody had the same problem??

    Here is the full dump..
    QL> @profload
    Package created.
    Grant succeeded.
    Synonym created.
    create or replace library sys.dbms_profiler_lib wrapped
    ERROR at line 1:
    ORA-00600: internal error code, arguments: [16201], [], [], [], [], [], [], []
    create or replace
    ERROR at line 1:
    ORA-00600: internal error code, arguments: [16201], [], [], [], [], [], [], []
    Testing for correct installation
    PACKAGE BODY sys.DBMS_PROFILER - missing or invalid
    PL/SQL procedure successfully completed.

  • Getting ora:00904 invalid indentifier error while running i query

    Hi,
    I have a remote database and local database both are oracle 10gR2.Now i have written the below mentioned query in my local database and is working fine,but in case remote database it is throughing error ora:00904 invalid indentifier.
    I had export the dump from remote db and import it on my local db and i tried the same and it is working fine on local after that also.
    As i believe that this error usually come for column name not exist or column name or it's length or for any special character in column name of the table.But as i said it is working fine on local db but not in remote db though i am using the same dump for local and remote.
    Though when i am querying the table i can able to fetch data for the any record but when i am using the below mentioned query for the same i am getting the error.As i am doing this to fecth the data for child parent related relationship.
    Can any one suggest is there anything related to configaration or something else.
    Please do let me know if you do want some more information on the query what i am doing inside of it.
    Rgds,
    Anit
    Edited by: Anit A. on Sep 1, 2008 2:32 AM
    Edited by: Anit A. on Sep 1, 2008 2:33 AM

    WITH t
    AS
    SELECT decode(t.spnlevel
    ,3,t.u_quotesdtlid
    ,2,decode((select count(*)
    from u_quotesdtl t2
    where t2.u_quotesdtlid = t.u_quotesdtlid
    and t2.parentspn = (t2.jobgroupid||':'||t2.jobtype)
    ),0,(select t1.u_quotesdtlid
    from u_quotesdtl t1
    where t1.spnitemcode = t.parentspn
    and t1.spnlevel = '3'
    and t1.jobtype = t.jobtype
    and t1.jobgroupid = t.jobgroupid
    and t1.QUOTEID = t.QUOTEID
    ),t.u_quotesdtlid
    ,1,decode((select count(*)
    from u_quotesdtl t2
    where t2.QUOTEID = t.QUOTEID
    and t2.parentspn = (t2.jobgroupid||':'||t2.jobtype)
    ),0,t.u_quotesdtlid,decode((select count(*)
    from u_quotesdtl t3
    where t3.QUOTEID = t.QUOTEID
    and t3.parentspn = (t3.jobgroupid||':'||t3.jobtype)
    and t3.u_quotesdtlid in (select t1.u_quotesdtlid
    from u_quotesdtl t1
    where t1.spnitemcode = t.parentspn
    and t1.spnlevel = '2'
    and t1.jobtype = t.jobtype
    and t1.jobgroupid = t.jobgroupid
    and t1.QUOTEID = t.QUOTEID
    ),0,(select t4.u_quotesdtlid
    from u_quotesdtl t4
    ,(select t1.parentspn
    ,t1.jobtype
    ,t1.jobgroupid
    from u_quotesdtl t1
    where t1.spnitemcode = t.parentspn
    and t1.spnlevel = '2'
    and t1.jobtype = t.jobtype
    and t1.jobgroupid = t.jobgroupid
    and t1.QUOTEID = t.QUOTEID
    ) t5
    where t4.spnitemcode = t5.parentspn
    and t4.spnlevel = '3'
    and t4.jobtype = t5.jobtype
    and t4.jobgroupid = t5.jobgroupid
    and t4.QUOTEID = t.QUOTEID
    (select t1.u_quotesdtlid
    from u_quotesdtl t1
    where t1.spnitemcode = t.parentspn
    and t1.spnlevel = '2'
    and t1.jobtype = t.jobtype
    and t1.jobgroupid = t.jobgroupid
    and t1.QUOTEID = t.QUOTEID
    ,null,t.u_quotesdtlid) as parentquoteid
    ,t.u_quotesdtlid as quotesdtlid
    ,t.spnlevel as spnlevel
    FROM u_quotesdtl t
    WHERE t.QUOTEID ='som key id'
    ORDER BY parentquoteid,t.spnlevel desc
    select * from t;

  • Getting ORA-00904 from various SPARQL statements

    Hi,
    I am currently working on a couple of Java services which offer access to semantic information using Jena. I have implemented two possible adapters so far, one "feeds" from an owl-file directly, one from an Oracle 11g (semantic technologies).
    In both cases, I use SPARQL SELECT and CONSTRUCT statements for my queries. Querying the owl-file-based adapter with these statements, everything works fine. querying the Oracle adapter, I often get the following stacktrace:
    Caused by: java.sql.SQLException: ORA-00904: "TYPE": ungültiger Bezeichner
         at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:74)
         at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:204)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)
         at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3431)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1203)
         at oracle.spatial.rdf.client.jena.Oracle.executeQuery(Oracle.java:352)
         at oracle.spatial.rdf.client.jena.Oracle.executeQuery(Oracle.java:315)
         at oracle.spatial.rdf.client.jena.OracleSemQueryPlan.executeBindings(OracleSemQueryPlan.java:431)
         ... 65 more
    The SELECT statement used is:
    ==============
    PREFIX owl: <http://www.w3.org/2002/07/owl#>
    PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT ?type ?label ?comment
    WHERE { <http://www.demo-uri.com/test.owl#demoInstance> rdf:type ?type .
    OPTIONAL { <http://www.demo-uri.com/test.owl#demoInstance> rdfs:label ?label .
    FILTER(langMatches(lang(?label),'de') || (!langMatches(lang(?label),'*'))) . }
    OPTIONAL { <http://www.demo-uri.com/test.owl#demoInstance> rdfs:comment ?comment .
    FILTER(langMatches(lang(?comment),'de') || (!langMatches(lang(?comment),'*'))) }
    ==============
    The generated SELECT clause is:
    SELECT type$RDFVTYP, type$RDFLTYP, type$RDFLANG, type$RDFCLOB, decode(type$RDFVTYP, 'BLN', ('_:'||substr(type,instr(type,'m',4)+1)), type) type
    FROM table(sdo_rdf_match('(<http://www.demo-uri.com/test.owl#demoInstance> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type) ', sdo_rdf_models('DEMO_MODEL'), sdo_rdf_rulebases('OWLPRIME'), null, null, NULL,' '))
    I am really grateful for any advise! A simple statement like
    [...]WHERE { <http://www.demo-uri.com/test.owl#demoInstance> rdf:type ?type }
    works fine.
    Best,
    Damian

    Thanks for the reply.
    I have changed the statement according to your advice:
    PREFIX owl: <http://www.w3.org/2002/07/owl#>
    PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT ?typ ?lbl ?cmnt
    WHERE { <http://www.demo-uri.com/test.owl#demoInstance> rdf:type ?typ .
    OPTIONAL { <http://www.demo-uri.com/test.owl#demoInstance> rdfs:label ?lbl .
    FILTER(langMatches(lang(?lbl),"de") || (!langMatches(lang(?lbl),"*"))) . }
    OPTIONAL { <http://www.demo-uri.com/test.owl#demoInstance> rdfs:comment ?cmnt .
    FILTER(langMatches(lang(?cmnt),"de") || (!langMatches(lang(?cmnt),"*"))) }}
    but still the same stacktrace :(
    Caused by: java.sql.SQLException: ORA-00904: "TYP": ungültiger Bezeichner
         at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:74)
         at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:204)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)
         at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3431)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1203)
         at oracle.spatial.rdf.client.jena.Oracle.executeQuery(Oracle.java:352)
         at oracle.spatial.rdf.client.jena.Oracle.executeQuery(Oracle.java:315)
         at oracle.spatial.rdf.client.jena.OracleSemQueryPlan.executeBindings(OracleSemQueryPlan.java:431)
         ... 65 more
    Edited by: user13170651 on 22.09.2010 02:32

  • Nested table update gets ORA-00904 with ExecuteSQL, error-free in TOAD

    I'm trying to run an UPDATE query through the ExecuteSQL method
    of the oraDatabase object. The catch seems to be that this one
    affects a nested table (field to be updated is a table itself).
    This SQL runs perfectly in T.O.A.D. ...
    UPDATE B457.AIRLINE a SET
    a.rental_cust_code=B457.RENTCUSTCODELIST(rentcustcodes
    ('45645'),rentcustcodes('1234'),rentcustcodes('234234')) WHERE
    a.AIRLINE_CODE='RCR'
    ...but, it produces the "SQL execution error, ORA-00904: invalid
    column name" when run using ExecuteSQL.
    Do I need to use a different syntax?

    and the complete example
    SQL> create or replace TYPE t_indirizzo AS OBJECT (
      2  via VARCHAR(45),
      3  numero NUMBER,
      4  cap INTEGER(5),
      5  citta VARCHAR(30),
      6  provincia VARCHAR(30),
      7  regione VARCHAR(30)
      8  );
      9  /
    Type created.
    SQL>
    SQL>
    SQL> create or replace TYPE t_telefono AS OBJECT (
      2  num_tel NUMBER(15)
      3  );
      4  /
    Type created.
    SQL>
    SQL> create or replace TYPE t_listaTelefono AS TABLE OF t_telefono
      2  /
    Type created.
    SQL>
    SQL> create or replace TYPE t_cliente AS OBJECT (
      2  cod_cliente NUMBER(8),
      3  indirizzo t_indirizzo,
      4  email VARCHAR(30),
      5  telefono t_listaTelefono
      6  ) NOT FINAL;
      7  /
    Type created.
    SQL>
    SQL> CREATE TABLE cliente OF t_cliente(
      2  cod_cliente NOT NULL,
      3  indirizzo NOT NULL,
      4  email NOT NULL,
      5  PRIMARY KEY (cod_cliente)
      6  ) nested table telefono store as numTelCli_tab
      7  return as value
      8  /
    Table created.
    SQL>

  • Getting ORA-01422 Error in stored procedure

    ORA-01422: exact fetch returns more than requested number of rows
    This page explains the error:
    http://www.techonthenet.com/oracle/errors/ora01422.php
    This is my procedure:
    The select into clause is what's causing the error. I understand the nature of the error, but the strange thing is that when i execute the sql, removing the 'into'
    part with my test-parameters I just receive a single row. Still when I execute my procedure with the same parameters I get the error. What could be wrong?
    create or replace
    PROCEDURE COUNTER_GETACTIVE
    METERPOINTID IN MeterPointCounters.MeterPointId%Type,
    METERPOINTCOUNTERNR IN METERPOINTCOUNTERS.METERPOINTCOUNTERNR%type,
    p_cursor out REFCURSOR_PKG.counter_cursor
    IS
    l_counterNr CounterBridgeTable.CounterNr%type;
    l_meterId CounterBridgeTable.MeterId%type;
    BEGIN
    select counternr, meterid into l_counterNr, l_meterId from CounterBridgeTable where meterpointid = METERPOINTID and meterpointcounternr = METERPOINTCOUNTERNR and datetom is null;
    open p_cursor for select * from counters where counternr = l_counterNr and meterId = l_meterId;
    END COUNTER_GETACTIVE;

    You are actually running this query
    select counternr, meterid from CounterBridgeTable where meterpointid = METERPOINTID and meterpointcounternr = METERPOINTCOUNTERNR and datetom is null;the param name is the same as the column, it is ignoring your param and pretty much doing a self join
    try this:
    create or replace
    PROCEDURE COUNTER_GETACTIVE
    p_METERPOINTID IN MeterPointCounters.MeterPointId%Type,
    p_METERPOINTCOUNTERNR IN METERPOINTCOUNTERS.METERPOINTCOUNTERNR%type,
    p_cursor out REFCURSOR_PKG.counter_cursor
    IS
    l_counterNr CounterBridgeTable.CounterNr%type;
    l_meterId CounterBridgeTable.MeterId%type;
    BEGIN
    select counternr, meterid into l_counterNr, l_meterId from CounterBridgeTable where meterpointid = p_METERPOINTID and meterpointcounternr = p_METERPOINTCOUNTERNR and datetom is null;
    open p_cursor for select * from counters where counternr = l_counterNr and meterId = l_meterId;
    END COUNTER_GETACTIVE;Edited by: tanging on Jun 8, 2010 10:37 AM

  • Update statement getting ORA-00904 invalid identifier

    I am getting this ORA error when I try to conduct an update statement from a column value in one table to a like-named column in another table.
    For instance, in my select, shown below, this query runs like a champ, returning all of my records
    SELECT
    b.ID,
    b.ZIP, a.ZIP,
    a.NAME,
    a.LOCATION
    FROM TBL_ARCHIVE a
    INNER JOIN TBL_UAT b ON
    a.ID = b.ID
    WHERE
    b.ID > 470000  And b.ID <470100;However, if I try to run an update statement with any of the following, I get this error. It seems so strange to me that I'd get an error using the same columns in the update statement, but would return the desired results effectively from the select statement!
    one version of UPDATE
    UPDATE TBL_ARCHIVE a
    SET a.ZIP = TBL_UAT.ZIP
    WHERE TBL_UAT.ID = a.ID;and another
    UPDATE TBL_ARCHIVE
    SET a.ZIP  =
    (SELECT b.ZIP
    FROM TBL_UAT b
    WHERE b.ID <472500 And b.ID >471000)
    FROM TBL_ARCHIVE a
    WHERE a.ID = b.ID)
    WHERE ID IN
    (SELECT ID
    FROM TBL_UAT b
    WHERE b.ID  <472500 And b.ID >471000
    );^ - this one produces a SQL not properly ended. Error ORA-00933: SQL command not properly ended.
    I'm really unsure though, how what I thought was a fairly basic update statement wouldn't work. I'm using Oracle 11g but through either Toad or SQL Plus. I've gotten these same errors in both.
    Though MS Access runs slow as snails, I can manage to run the update statement successfully with it, a thousand records or so at a time. Problem is, I've got about 300K records needing updating.
    I've looked around for similar problems but haven't found one where someone wasn't either using a reserved word for a column, which I'm not, I don't believe, or a problem that really dealt with this error in the context of an update statement.
    But I'd welcome any enlightenment on this.

    rp0428 wrote:
    UPDATE TBL_ARCHIVE a
    SET a.ZIP = TBL_UAT.ZIP
    WHERE TBL_UAT.ID = a.ID;That isn't a valid query and neither is the other one.
    Please post the actual query you are using and the actual complete error message you are getting (everything about the error that is displayed).^^
    That is NOT a valid query?
    How else would you have an UPDATE statement created to set the value of a column in table A to the value of a (in this case, same named) column in table B?
    And keep them in order to update the records appropriately?
    I'll append the create statements momentarily.
    Thanks!
    CREATE TABLE TBL_UAT
    ( ID NUMBER(6),
    ZIP VARCHAR2(10 BYTE) ) and
    CREATE TABLE TBL_ARCHIVE
    ( ID NUMBER(6) NOT NULL, NAME VARCHAR2(50 BYTE),
    EMAIL VARCHAR2(50 BYTE),
    LOCATION VARCHAR2(50 BYTE),
    DEPARTMENT VARCHAR2(50 BYTE),
    PRIORITY VARCHAR2(50 BYTE),
    APPROVING_MGR_NAME VARCHAR2(50 BYTE),
    TYPE1 VARCHAR2(50 BYTE),
    TYPE2 VARCHAR2(50 BYTE),
    CONTACT_NAME VARCHAR2(50 BYTE),
    CONTACT_PHN_NO VARCHAR2(50 BYTE),
    LOAN_NUM VARCHAR2(50 BYTE),
    REF_ID VARCHAR2(50 BYTE),
    BORROWER_NAME VARCHAR2(50 BYTE),
    ADDRESS VARCHAR2(50 BYTE),
    CITY VARCHAR2(50 BYTE),
    ST VARCHAR2(50 BYTE),
    ZIP VARCHAR2(10 BYTE),
    SALE_DATE DATE,
    COMMENTS VARCHAR2(800 BYTE),
    TIME_REQ DATE,
    ACCTLOC VARCHAR2(50 BYTE),
    OTHER_ACCTLOC VARCHAR2(50 BYTE)) Hope this can be of assistance.
    Thanks, folks!
    Edited by: user515689 on Feb 7, 2012 11:59 AM

  • Getting ORA Error while running any Query

    Hi Experts - I am getting below error message for any query i run in Webi. Please help.
    failed to execute with the error ORA-00604: error occurred at recursive SQL level 1
    ORA-01655: unable to extend cluster SYS.C_OBJ#_INTCOL# by 128 in tablespace. (WIS 10901)

    Hello communutiy, hello rohan,
    after updating patches next working day we also get this erreor message
    "ORA-00604: error occurred at recursive SQL level 1 ORA-01655: unable to extend cluster SYS.C_OBJ#_INTCOL# by 128 in tablespace"
    What have you done so far. Could you solve this issue? If yes how?
    Best regards Harry

  • Getting ORA-06508 when running 6i form in 10g

    hi,
    I am upgrading my forms from 6i to 10g. I have created the following directory structure on my system.
    c:\old_system\<module_name>\<forms60> --- All FMBs and FMXs
    c:\old_system\<module_name>\<lib> --- All libraries
    c:\old_system\<module_name>\<reports60> ---All Reports
    c:\10g_upgrade\<module_name>\<forms60> --- All FMBs and FMXs
    c:\10g_upgrade\<module_name>\<lib> --- All libraries
    c:\10g_upgrade\<module_name>\<reports60> ---All Reports
    i have edited the registery entry for
    for forms6i
    Forms60_PATH --- c:\old_system\<module_name>\<lib>
    for forms10g
    Forms_PATH -- c:\10g_upgrade\<module_name>\<lib>
    I have two template forms:
    1. TMXSTAND.FMB
    2. PPSSTAND.FMB inherits TMXSTAND.FMB
    when i run the FPPS003.FMB then it gives this error.
    ON-ERROR raised an unhandled exception ORA-06508.
    Please suggest where is the problem.
    Thanks.
    null

    I have given the proper path of the library folder in Forms_Path. Still I am getting this error...
    Is this error because of having both the versions of forms (6i and 10g)?
    Message was edited by:
    gammit

  • Getting ora-00904 BLOB_CONTENT invalid identifier. Help please.

    Hi everyone,
    I am trying to upload a .jpg file into a custom table with the follwong code:
    DECLARE
    v_id number;
    v_length number;
    v_name varchar2(4000);
    v_mime varchar2(4000);
    v_blob blob;
    begin
    If (:P_F01 is not null) then
    select ID,mime_type,blob_content
    into v_id,v_mime,v_blob from
    APEX_APPLICATION_FILES where name=:P_F01;
    insert into c_file_hdrs(FILEKEY_FK,MECKEY_FK,NAME,ID,MIME_TYPE,FILESIZE,BLOB_CONTENT)
    values (:P1_FILEKEY,:P1_MECKEY_FK,:P1_F01,v_id,v_mime,null,v_blob);
    delete from APEX_APPLICATION_FILES where name = :P1_F01;
    end if;
    end;
    And I am getting an error BLOB_CONTENT invalid identifer. Can anyone suggest what I am doing wrong.
    My TABLE's COLUMNS are as follows:
    MECKEY_FK not null number;
    FILEKEY_FK not null number;
    NAME varchar2(4000);
    ID number;
    MIME_TYPE not null varchar2(4000);
    BLOB_CONTENT NOT null BLOB;
    FILE_SIZE number;
    Thank you in advance,rgds,Suma.

    Check FILESIZE vs. FILE_SIZE.
    Scott

  • Getting ORA-00904 ERROR

    Hi,
    select statmnnt is giving output but while inserting is failing
    getting B: MGR_NUM invalid identifier
    NSERT INTO assc ( b.assc_nm,
              b.STATUS_DT,
              b.STATUS_ID,
              b.first_nm,
              b.last_nm,
              b.curr_title_nm,
              b.curr_field_sales_ind,
              b.MGR_NM)
              select c.assc_nm,
              c.status_dt,
    decode(c.STATUS,'ACTV',1,'INAC',2),
    c.first_nm,
    c.last_nm,
    c.curr_title_nm,
    'N',
    c.MGR_NM
              from ASSCGENTABLE_NEW c
              where c.flag='I';

    should be...
    INSERT INTO assc (
    assc_nm,
    STATUS_DT,
    STATUS_ID,
    first_nm,
    last_nm,
    curr_title_nm,
    curr_field_sales_ind,
    MGR_NM)
    select c.assc_nm,
    c.status_dt,
    decode(c.STATUS,'ACTV',1,'INAC',2),
    c.first_nm,
    c.last_nm,
    c.curr_title_nm,
    'N',
    c.MGR_NM
    from ASSCGENTABLE_NEW c
    where c.flag='I';                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Why I am getting ORA-29257 while running a get ipaddress query?

    Friends,
    The query:
    select machine,utl_inaddr.get_host_address(machine) from v$session where username is not null
    Result:
    Error at line 1:
    ORA-29257
    host bmc01\beating
    How can i resolve this error?
    Thanks & Regards
    Sathyguy

    The machine name is unknown to the Database server. To see if this is the problem try adding that machine in hosts file.

  • Having issues with a left join, getting ORA-00904 error

    Ok this is something very similar to what I am facing, but dumbed down. None of these columns or tables names exist in real life (Very paranoid company I work for, understandable though) but the fundamental problem I am having is like below.
    Basically I know I could have done something similar to this is MS SQL (Or am I dreaming?). If I am right or wrong I need to know a way around this.
    Obviously if you comment out the "CAL.WEEK_SINCE_2005" and "AND CUST.week_since_2005 = CAL.WEEK_SINCE_2005" it would work. But I really need it to display the date as well. So it can be group'ed by week since 2005.
    I will be joining other statements to this. I am hoping on doing this in one select statement instead of creating multiple tables as I am now. All the other joined tables will follow a VERY similar layout to this. So something like this is need to obtain the look.
    When ran I get the following error.
    I look forward to learning what I did wrong and how I can fix it. :)
    select ORG.ORGANIZATION_NAME,
    CUST.CUST_COUNT,
    CAL.WEEK_SINCE_2005
    FROM organization ORG,
    calendar CAL
    LEFT JOIN (
    SELECT CAP.CURRENT_STORE,
    CALEN.week_since_2005,
    count(CAP.inactive_date) CUST_COUNT
    FROM CUST_AGREE_PAST CAP,
    calendar CALEN
    WHERE CAP.active_date is not null
    and CAP.inactive_code in ('T')
    and CAP.inactive_date between '01-sep-07' and sysdate
    and CAP.INACTIVE_DATE = CALEN.CALENDAR_DATE
    and CAP.RSN_CODE_ID in (select rsn_code_id from reasons where title in ('FAIL', 'NO CALL'))
    GROUP BY CAP.CURRENT_STORE,
    CALEN.week_since_2005) CUST
    ON PO.CURRENT_STORE = ORG.ORGANIZATION_NAME
    AND CUST.week_since_2005 = CAL.WEEK_SINCE_2005

    Just noticed a problem (there might be others):
    FROM organization ORG,
    calendar CAL
    LEFT JOIN (You cannot do that - you are mixing Oracle and ANSI join syntax. You have to do one or the other:
    FROM organization ORG
    JOIN calendar CAL on (ORG.col = CAL.col)
    LEFT JOIN (....)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • ORA-00904 with bitmap indexes

    Hi,
    I'm running the following query:
    SELECT
    FLOW.PRODUCT_CODE,
    FLOW.CUSTOMER_SK,
    FLOW.BRAND_SK,
    26,
    FLOW.MPR_SK
    FROM     
    RSB_FACT_FLOW_SD          FLOW,
    RSB_DIM_FLOW               DIM
    WHERE     
    FLOW.FLOW_SK     = DIM.FLOW_SK
    AND     DIM.FLOW_ID                = 'CFRD'
    AND     FLOW.PRODUCT_CODE          = 'G'
    AND     FLOW.FLOW_DATE                >= '01 JAN 2006'
    AND     FLOW.FLOW_DATE                <= '31 JAN 2006'
    AND     EXISTS
         (     SELECT     1
              FROM     RSB_FACT_FLOW_SD          A,
                   RSB_DIM_FLOW          B
              WHERE     
              A.MPR_SK     = FLOW.MPR_SK
         AND A.RECEIVED_DATE >= FLOW.RECEIVED_DATE
              AND     B.FLOW_SK= A.FLOW_SK
              AND     B.FLOW_ID= 'WAO2'
              AND      A.REASON= '02CRO'
    I get ORA-00904: "FLOW"."RECEIVED_DATE": invalid identifier
    This is the defintion of the table:
    CREATE TABLE RSB_FACT_FLOW_SD
    PRODUCT_CODE CHAR(1) NOT NULL,
    WEEK_END_DATE DATE NOT NULL,
    CUSTOMER_SK NUMBER(10) NOT NULL,
    CUSTOMER_ATTRIBUTE_SK NUMBER(10) NOT NULL,
    MPR_SK NUMBER(10) NOT NULL,
    MPR_PROFILE_SK NUMBER(10) NOT NULL,
    SPECCOND_PROFILE_SK NUMBER(10) NOT NULL,
    BRAND_SK NUMBER(10) NOT NULL,
    FLOW_SK NUMBER(10) NOT NULL,
    FLOW_DATE DATE,
    RECEIVED_DATE DATE,
    VALIDATION_STATUS CHAR(1),
    FLOW_TYPE CHAR(1),
    RECEIVED_FROM_SENT_TO VARCHAR2(4),
    REASON VARCHAR2(255),
    FLOW_SEQUENCE NUMBER,
    CUSTOMER_SEGMENT_SK NUMBER(10),
    BRAND_PARTNER_SK NUMBER
    TABLESPACE DW_DATA
    PCTUSED 90
    PCTFREE 0
    PARALLEL
    LOGGING;
    CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX01 ON RSB_FACT_FLOW_SD
    (PRODUCT_CODE) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
    CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX02 ON RSB_FACT_FLOW_SD
    (WEEK_END_DATE) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
    CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX03 ON RSB_FACT_FLOW_SD
    (CUSTOMER_SK) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
    CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX04 ON RSB_FACT_FLOW_SD
    (CUSTOMER_ATTRIBUTE_SK) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
    CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX05 ON RSB_FACT_FLOW_SD
    (MPR_SK) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
    CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX06 ON RSB_FACT_FLOW_SD
    (MPR_PROFILE_SK) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
    CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX07 ON RSB_FACT_FLOW_SD
    (SPECCOND_PROFILE_SK) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
    CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX08 ON RSB_FACT_FLOW_SD
    (BRAND_SK) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
    CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX09 ON RSB_FACT_FLOW_SD
    (FLOW_SK) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
    CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX10 ON RSB_FACT_FLOW_SD
    (RECEIVED_DATE) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
    CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX11 ON RSB_FACT_FLOW_SD
    (FLOW_DATE) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
    CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX12 ON RSB_FACT_FLOW_SD
    (CUSTOMER_SEGMENT_SK) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
    CREATE BITMAP INDEX RSB_FACT_FLOW_SD_IX13 ON RSB_FACT_FLOW_SD
    (BRAND_PARTNER_SK) TABLESPACE DW_INDEXES PARALLEL PCTFREE 0 NOLOGGING COMPUTE STATISTICS;
    If I drop the indexes on the table then the error goes away.
    Any ideas??
    Sheena

    ( SELECT 1
    FROM RSB_FACT_FLOW_SD A,
    RSB_DIM_FLOW B
    WHERE
    A.MPR_SK = FLOW.MPR_SK
    AND A.RECEIVED_DATE >= FLOW.RECEIVED_DATE =====>>>>
    AND B.FLOW_SK= A.FLOW_SK
    AND B.FLOW_ID= 'WAO2'
    AND A.REASON= '02CRO'
    Your sub query has the problem.
    You didn't list flow table in the subquery, therefore, you subquery, dont understand about the column.
    specify flow table in the subquery.
    Your outquery tables doesn't recognized in the sub query.
    Jaffar

  • Sometimes ORA-00904: invalid column

    Hello,
    Some times when i am running a query I get 'ORA-00904: invalid column name'. Next times i run exactly the same query the query runs well for a few times. And in an unpredictable way, exactly the same query fails again.
    I am using Oracle 8i 8.1.7
    Can someone help me out?

    The error does not occur in just a single query. There are multiple query's in whitch the error sometimes occurs. We have been looking for similarity's in the query's, but we haven't found one so far. It seems to be the error does occur more often in query's wich are using a databaselink.
    The error does also occur in update statements.
    This is an example query:
    SELECT DISTINCT
    zt.rowid,
    zt.id,
    zt.begindatum_tim,
    zt.zorgtraject_id,
    zt.SSPC_ZORGTYPE_ID,
    stp_lees_dbc(zrgt.ID, zrgt.initieel_sspc_id, zt.ID)AS dbc,
    stp_lees_dbc_code(zrgt.ID, zrgt.initieel_sspc_id, zt.ID) AS dbc_code
    FROM
    bav_epd_zorgtrajecten zrgt
    ,bav_epd_ztr_zorgtypen zt
    WHERE
    zrgt.ID = :parzorgtrajectid
    AND zrgt.verwijderd_bln = 'N'
    AND zrgt.ID = zt.zorgtraject_id

Maybe you are looking for

  • Where is the wish list

    Put some songs on my stupid wish list and now I can't find it. Supposed to be below Quick Links in the Itunes store home page. Not there.

  • Prompting to save report.

    I support a program that generates a report in PDF format. One of my users is now being prompted to save the report every time they view it. In the past this was not the case, they could generate the report and print and close with no prompt to save.

  • Handling contraint violations in a user friendly way

    How do you trap constraint violation errors is a user friendly manner ... I've seen a number of related posts on the forum but have not yet seen a solution that people are happy with. Ideally, Id like to: - avoid displaying the 'raw' oracle error to

  • [CS5] InDesign Server holding onto script file after being executed?

    Hello, I've run into a scenario which we have a script file dynamically created, saved to disk, then sent to InDesign Server to be executed. The code that tells InDesign Server to execute the script will delete that script file after it's finished ex

  • How can I reinstall CS/Bridge when they do not appear in NW's Control Panel programmed delete listing?

    Bridge in CS6 is returning the error message "Bridge has encountered a problem and cannot read the Cache."  Purging install the software.  However, for some unexplained reason, neither programme is listed under the programme delete option in W7 contr