Error: ORA-00911: invalid character. Where is the character?

Hi all

As I wrote in the topic, I wrote the following code but I get the above error.

Could someone tell me where are the mistakes? Mainly because the console does not specify where it is.

------------------------------------------------------------------------------------------

Select case when ((select EMPRESA

of B_LISTA_EMPLEADOS

where USERNAME = 'ADMIN')) = 'IMASA.

then ((select JORNADA_ANUAL

of B_JORNADAS_Y_RATIOS

where CATEGORY = (())

Select the CATEGORY

of B_LISTA_EMPLEADOS

where USERNAME = 'ADMIN '.

))

and EMPRESA = (())

Select the EMPRESA

of B_LISTA_EMPLEADOS

where USERNAME = 'ADMIN '.

))

and ANO = "2013"

))

else 'no es UN empleado of the empresa"

end case;


like the Jornada

of B_JORNADAS_Y_RATIOS

------------------------------------------------------------------------------------------

Best regards

Hello

Is type data number JORNADA_ANUAL?


then try to_char (JORNADA_ANUAL)

Tags: Database

Similar Questions

  • The AUDIT command in, oracle apex (version 4.2.5.00.08), error "ORA-00911: invalid character '.

    I am trying to run

    "AUDIT INSERT, UPDATE, DELETE on emp BY ACCESS WHENEVER SUCCESSFUL;"

    in "SQL commands" on oracle-apex (version 4.2.5.00.08).

    I get the error message ' ORA-00911: invalid character '.

    Can someone tell me the solution for this?

    Apex environment we need to set the database AUDIT_TRAIL to TRUE for the control

    "AUDIT INSERT, UPDATE, DELETE on emp BY ACCESS WHENEVER SUCCESSFUL;"  to work.

    By their Summit, to be able to change the setting of database AUDIT_TRAIL we have to log-in as a DBA from the link "SQL workshop--> utilities--> on the database.

  • Error trivial Drives Me Crazy - ORA-00911: invalid character - Oracle 10 g

    I have no idea where I was wrong. I get this ORA-00911: invalid character
    I looked at the excerpt from tons of times, but could not find a glitch. Code appear nested into a TOAD
    CREATE TABLE RoomAssociates
    (
         roomAssociatesID           NUMBER(7)                                     , CONSTRAINT roomasso_roomassoid_pk                            PRIMARY KEY(roomAssociatesID)                                                         ,                                                     
         roomID                       NUMBER(7)                                        CONSTRAINT roomasso_roomid_nn                                NOT NULL                                                                                     ,
                                                                                           CONSTRAINT roomasso_roomid_fk                            FOREIGN KEY(roomID) REFERENCES Room(roomID) ON DELETE CASCADE               ,
         roomFacilityID              NUMBER(7)                                      CONSTRAINT roomasso_roomfid_nn                                NOT NULL                                                                                         ,
                                                                                           CONSTRAINT roomasso_roomfid _fk                             FOREIGN KEY(roomFacilityID) REFERENCES RoomFacility(roomFacilityID)          ,
         enSuitID                   NUMBER(7)                                         CONSTRAINT roomasso_ensuitid_nn                             NOT NULL                                                                                          ,
                                                                                           CONSTRAINT roomasso_ensuitid_fk                       FOREIGN KEY(enSuitID) REFERENCES EnSuit(enSuitID)
    );

    Now, this will work:

    CREATE TABLE RoomAssociates
    (
         roomAssociatesID           NUMBER(7)                                     , CONSTRAINT roomasso_roomassoid_pk                            PRIMARY KEY(roomAssociatesID)                                                         ,
         roomID                       NUMBER(7)                                        CONSTRAINT roomasso_roomid_nn                                NOT NULL                                                                                     ,
                                                                                           CONSTRAINT roomasso_roomid_fk                            FOREIGN KEY(roomID) REFERENCES Room(roomID) ON DELETE CASCADE               ,
         roomFacilityID              NUMBER(7)                                      CONSTRAINT roomasso_roomfid_nn                                NOT NULL                                                                                         ,
                                                                                           CONSTRAINT roomasso_roomfid_fk                             FOREIGN KEY(roomFacilityID) REFERENCES RoomFacility(roomFacilityID)          ,
         enSuitID                   NUMBER(7)                                         CONSTRAINT roomasso_ensuitid_nn                             NOT NULL                                                                                          ,
                                                                                           CONSTRAINT roomasso_ensuitid_fk                       FOREIGN KEY(enSuitID) REFERENCES EnSuit(enSuitID)
    );
    

    The error is here:

    CONSTRAINT roomasso_roomfid _fk
    

    Better formatting:

    CREATE TABLE RoomAssociates
    ( roomAssociatesID NUMBER(7), CONSTRAINT roomasso_roomassoid_pk PRIMARY KEY(roomAssociatesID),
      roomID           NUMBER(7)  CONSTRAINT roomasso_roomid_nn     NOT NULL,
                                  CONSTRAINT roomasso_roomid_fk FOREIGN KEY(roomID) REFERENCES Room(roomID) ON DELETE CASCADE,
      roomFacilityID   NUMBER(7)  CONSTRAINT roomasso_roomfid_nn NOT NULL,
                                  CONSTRAINT roomasso_roomfid_fk FOREIGN KEY(roomFacilityID) REFERENCES RoomFacility(roomFacilityID),
      enSuitID         NUMBER(7)  CONSTRAINT roomasso_ensuitid_nn     NOT NULL,
                                  CONSTRAINT roomasso_ensuitid_fk FOREIGN KEY(enSuitID) REFERENCES EnSuit(enSuitID)
    );
    

    Max
    [My Italian blog Oracle | http://oracleitalia.wordpress.com/2009/12/18/table-elimination-oppure-join-elimination-lottimizzatore-si-libera-della-zavorra/]

    Published by: Massimo Ruocchio, December 19, 2009 12:05 AM

  • ORA-00911: invalid character error.

    Hi all

    I use ODI 11 g and Oracle 11 g.

    I use the query in proc in ODI below. When the data in the table is inserted it says ORA-00911: invalid character error.
    INSERT INTO SD_CAMP
    SELECT DISTINCT CAMPGN_NO, PRODUCT, NULL.
    CAMPG_NAM, trunc (sysdate), trunc (sysdate) + 182
    OF SP_ODI_TEMP;

    I also inserted the value also hard coded in ODI, but it still says the same error.
    Values inserted INTO the SD_CAMP ("'SAS06', ' SBC", NULL, 'SB CUST FFT', TO_DATE('02-NOV-12','DD-MON-YY'),)
    TO_DATE('03-MAY-13','DD-MON-YY'));

    I ran this query in Oracle db but his works very well.

    Any help how to solve this problem?

    Thank you
    Lony

    Put it in two different stages.

  • ORA-00911: invalid character in SQL dynamic

    I think I need another set of eyes. I do not see the invalid character in this dynamically generated SQL statement:

    INSERT INTO source_arc
    select v.*, sysdate, 'archived'
    from source v
    where v.id IN  ( SELECT *
                             FROM TABLE( SELECT
                                    CAST(str2tbl( 1,2,4 )
                                                 AS myTableType
                                       )
                                         FROM
                                              dual ));
    

    Here is the complete configuration:

    create or replace type myTableType as table of number;
    /
    
    
    create or replace function str2tbl( p_str in varchar2 ) return myTableType
     as
         l_str   varchar2(32767) default p_str || ',';
         l_n        number;
         l_data    myTableType := myTabletype();
     begin
         loop
             l_n := instr( l_str, ',' );
             exit when (nvl(l_n,0) = 0);
             l_data.extend;
             l_data( l_data.count ) := trim(substr(l_str,1,l_n-1));
             l_str := substr( l_str, l_n+1 );
         end loop;
         return l_data;
     end str2tbl;
     /
    
     create table source
     ( id   number
      ,txt  varchar2(25)
     )
     /
    
     insert into source
     values(1,'aaa')
     /
    
     insert into source
     values(2,'bbb')
     /
    
     insert into source
     values(3,'ccc')
     /
    
     insert into source
     values(4,'ddd')
     /
    
     insert into source
     values(5,'eee')
     /
    
     commit ;
    
     create table source_arc
     ( id  number
      ,txt varchar2(25)
      ,dt  date
      ,comments varchar2(512)
     )
     /
    

    )

    /

    Here is the result when I run this code:

    DECLARE
       i_owner_tbl_arc varchar2(61) := 'source_arc';
       i_owner_tbl     varchar2(61) := 'source' ;
       v_qry       varchar2(32767) := 'INSERT INTO ' ||  i_owner_tbl_arc ;
       g_content_list varchar2(32767) := '1,2,4';
    BEGIN
       v_qry := v_qry || chr(10) ||
           'select v.*, sysdate, ''archived'' ' || chr(10) ||
           'from ' || i_owner_tbl || ' v '      || chr(10) ||
           'where v.id IN  ( SELECT * ' || chr(10) ||
           '                         FROM TABLE( SELECT ' || chr(10) ||
           '                                          CAST(str2tbl( ' || g_content_list || ' ) ' || chr(10) ||
           '                                             AS myTableType ' || chr(10) ||
           '                                   ) ' || chr(10) ||
           '                                     FROM dual ));';
           
           execute immediate v_qry;
    END ;
    /
    ERROR at line 1:
    ORA-00911: invalid character
    ORA-06512: at line 17
    

    Any help appreciated.

    Remove the semicolon at the end of the string and put single quotes while calling the function.

    Try the below

    DECLARE

    i_owner_tbl_arc varchar2 (61): = "source_arc";

    i_owner_tbl varchar2 (61): = 'source ';

    v_qry varchar2 (32767): = 'INSERT INTO ' |  i_owner_tbl_arc;

    g_content_list varchar2 (32767): = '1,2,4';

    BEGIN

    v_qry: = v_qry | Chr (10) |

    "select v.*, sysdate,"archived"| Chr (10) |

    'from ' | i_owner_tbl | ' v '      || Chr (10) |

    «where v.id IN (SELECT * ' |)» Chr (10) |

    ' TABLE (SELECT ' |) Chr (10) |

    "CAST (str2tbl ("' |)) ". g_content_list | ''' ) ' || Chr (10) |

    '                                             AS myTableType ' || Chr (10) |

    '                                   ) ' || Chr (10) |

    '                                     FROM dual ))';

    immediately run v_qry;

    END;

  • 911: 42000: java.sql.SQLException: ORA-00911: invalid character

    Hi all

    I am trying to load the data in the 1 table to another using ODI 10 g. My approach is error ed out in step 3 - load data showing the exception below
    911 : 42000 : java.sql.SQLException: ORA-00911: invalid character
    
    java.sql.SQLException: ORA-00911: invalid character
    
    
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
    
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
    
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
    
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
    
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
    
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:503)
    
         at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:965)
    
         at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:535)
    
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1051)
    
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
    
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3026)
    
         at com.sunopsis.sql.SnpsQuery.executeQuery(SnpsQuery.java)
    
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execCollOrders(SnpSessTaskSql.java)
    
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
    
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
    
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
    
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
    
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
    
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
    
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
    
         at com.sunopsis.dwg.cmd.e.k(e.java)
    
         at com.sunopsis.dwg.cmd.g.A(g.java)
    
         at com.sunopsis.dwg.cmd.e.run(e.java)
    
         at java.lang.Thread.run(Unknown Source)
    When I see the description of the sql that runs to the phase I see below
    select     
         _ACTIVITIES_V.ACTIVITY_ID        C1_ACTIVITY_ID,
         _ACTIVITIES_V.ATTRIBUTE15        C42_ATTRIBUTE15
    from     .COM_ACTIVITIES_V   _ACTIVITIES_V
    where     (1=1)
    OBV when this sql is tried of toad is giving the same error.

    Please advice what's not here


    thnks

    Hello

    In topology-> physical schema Manager, where you set the source of Oracle schema, you left the WORKING PATTERN as empty. Put a schema name in the scheme of work and this. will be preceded by the name of this schema

    Also, for better visibility, you change the table alias name in the interface of
    ACTIVITIESV
    TO
    ACTIVITIES_V

    Thank you
    Fati

  • ORA-00911: invalid character in DBMS_SQLTUNE. REPORT_TUNING_TASK 11.2.0.1

    DECLARE
     my_task_name VARCHAR2(30);
     my_sqltext   CLOB;
    BEGIN
     my_sqltext := 'select l.cp_name, (select count(distinct e.youview_id) '||
    'from mips_mdm.entity_lookup e inner join mips_mdm.tx_status s on e.youview_id = s.youview_id '|| 
    'where e.date_created < TO_TIMESTAMP_TZ(''15-MAY-2011 23.59.59.000000000 +00:00'',''DD/MM/YYYY HH24:MI:SS.FF TZH:TZM'') '||
    'and s.status=''committed'' and e.mop_id=l.id) as Committed, '||
    '(select count(distinct e.youview_id) '||
    'from mips_mdm.entity_lookup e inner join mips_mdm.tx_status s on e.youview_id = s.youview_id '||
    'where e.date_created < TO_TIMESTAMP_TZ(''15-MAY-2011 23.59.59.000000000 +00:00'',''DD/MM/YYYY HH24:MI:SS.FF TZH:TZM'') '||
    'and s.status=''published'' and e.mop_id=l.id) as Published, '||
    '(select count(distinct e.youview_id) '||
    'from mips_mdm.entity_lookup e inner join mips_mdm.tx_status s on e.youview_id = s.youview_id '||
    'where e.date_created < TO_TIMESTAMP_TZ(''15-MAY-2011 23.59.59.000000000 +00:00'',''DD/MM/YYYY HH24:MI:SS.FF TZH:TZM'') '||
    'and s.status=''quarantined'' and e.mop_id=l.id) as Quarantined, '||
    '(select count(distinct e.youview_id)  '||
    'from mips_mdm.entity_lookup e inner join mips_mdm.tx_status s on e.youview_id = s.youview_id '||
    'where e.date_created < TO_TIMESTAMP_TZ(''15-MAY-2011 23.59.59.000000000 +00:00'',''DD/MM/YYYY HH24:MI:SS.FF TZH:TZM'') '||
    'and s.status=''expiredFromQuarantine'' and e.mop_id=l.id) as Expired, '||
    '(select count(distinct e.youview_id) '||
    'from mips_mdm.entity_lookup e inner join mips_mdm.tx_status s on e.youview_id = s.youview_id '||
    'where e.date_created < TO_TIMESTAMP_TZ(''15-MAY-2011 23.59.59.000000000 +00:00'',''DD/MM/YYYY HH24:MI:SS.FF TZH:TZM'') '||
    'and s.status=''failed'' and e.mop_id=l.id) as Failed, '||
    '(select count(distinct e.youview_id) '||
    'from mips_mdm.entity_lookup e inner join mips_mdm.tx_status s on e.youview_id = s.youview_id  '||
    'where e.date_created < TO_TIMESTAMP_TZ(''15-MAY-2011 23.59.59.000000000 +00:00'',''DD/MM/YYYY HH24:MI:SS.FF TZH:TZM'') '||
    'and s.status=''valid'' and e.mop_id=l.id) as Valid, '||
    '(select count(distinct e.youview_id) '||
    'from mips_mdm.entity_lookup e inner join mips_mdm.tx_status s on e.youview_id = s.youview_id '||
    'where e.date_created < TO_TIMESTAMP_TZ(''15-MAY-2011 23.59.59.000000000 +00:00'',''DD/MM/YYYY HH24:MI:SS.FF TZH:TZM'') '||
    'and s.status=''invalid'' and e.mop_id=l.id) as Invalid, '||
    '(select count(distinct e.youview_id)  '||
    'from mips_mdm.entity_lookup e inner join mips_mdm.tx_status s on e.youview_id = s.youview_id '||
    'where e.date_created < TO_TIMESTAMP_TZ(''15-MAY-2011 23.59.59.000000000 +00:00'',''DD/MM/YYYY HH24:MI:SS.FF TZH:TZM'') '||
    'and e.mop_id=l.id) as Total '||
    'from mips_mdm.mop_lookup l order by l.id;';
     my_task_name := DBMS_SQLTUNE.CREATE_TUNING_TASK(
             sql_text    => my_sqltext,
             user_name   => 'MIPS_MDM',
             scope       => 'COMPREHENSIVE',
             time_limit  => 60,
             task_name   => 'my_sql_tuning_taskMIPS4',
             description => 'Task to tune a query on a specified employee');
    END;
    /
    
    
    
    SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK( 'my_sql_tuning_taskMIPS4')
      FROM DUAL;
      
    
    GENERAL INFORMATION SECTION
    -------------------------------------------------------------------------------
    Tuning Task Name   : my_sql_tuning_taskMIPS4
    Tuning Task Owner  : DEPLOY_CTL
    Workload Type      : Single SQL Statement
    Scope              : COMPREHENSIVE
    Time Limit(seconds): 60
    Completion Status  : COMPLETED
    Started at         : 05/24/2011 10:31:59
    Completed at       : 05/24/2011 10:32:53
    
    -------------------------------------------------------------------------------
    Schema Name: MIPS_MDM
    SQL ID     : 9246fjyc01k83
    SQL Text   : select l.cp_name, (select count(distinct e.youview_id) from
                 mips_mdm.entity_lookup e inner join mips_mdm.tx_status s on
                 e.youview_id = s.youview_id where e.date_created <
                 TO_TIMESTAMP_TZ('15-MAY-2011 23.59.59.000000000
                 +00:00','DD/MM/YYYY HH24:MI:SS.FF TZH:TZM') and
                 s.status='committed' and e.mop_id=l.id) as Committed, (select
                 count(distinct e.youview_id) from mips_mdm.entity_lookup e inner
                 join mips_mdm.tx_status s on e.youview_id = s.youview_id where
                 e.date_created < TO_TIMESTAMP_TZ('15-MAY-2011 23.59.59.000000000
                 +00:00','DD/MM/YYYY HH24:MI:SS.FF TZH:TZM') and
                 s.status='published' and e.mop_id=l.id) as Published, (select
                 count(distinct e.youview_id) from mips_mdm.entity_lookup e inner
                 join mips_mdm.tx_status s on e.youview_id = s.youview_id where
                 e.date_created < TO_TIMESTAMP_TZ('15-MAY-2011 23.59.59.000000000
                 +00:00','DD/MM/YYYY HH24:MI:SS.FF TZH:TZM') and
                 s.status='quarantined' and e.mop_id=l.id) as Quarantined,
                 (select count(distinct e.youview_id)  from
                 mips_mdm.entity_lookup e inner join mips_mdm.tx_status s on
                 e.youview_id = s.youview_id where e.date_created <
                 TO_TIMESTAMP_TZ('15-MAY-2011 23.59.59.000000000
                 +00:00','DD/MM/YYYY HH24:MI:SS.FF TZH:TZM') and
                 s.status='expiredFromQuarantine' and e.mop_id=l.id) as Expired,
                 (select count(distinct e.youview_id) from mips_mdm.entity_lookup
                 e inner join mips_mdm.tx_status s on e.youview_id = s.youview_id
                 where e.date_created < TO_TIMESTAMP_TZ('15-MAY-2011
                 23.59.59.000000000 +00:00','DD/MM/YYYY HH24:MI:SS.FF TZH:TZM')
                 and s.status='failed' and e.mop_id=l.id) as Failed, (select
                 count(distinct e.youview_id) from mips_mdm.entity_lookup e inner
                 join mips_mdm.tx_status s on e.youview_id = s.youview_id  where
                 e.date_created < TO_TIMESTAMP_TZ('15-MAY-2011 23.59.59.000000000
                 +00:00','DD/MM/YYYY HH24:MI:SS.FF TZH:TZM') and s.status='valid'
                 and e.mop_id=l.id) as Valid, (select count(distinct
                 e.youview_id) from mips_mdm.entity_lookup e inner join
                 mips_mdm.tx_status s on e.youview_id = s.youview_id where
                 e.date_created < TO_TIMESTAMP_TZ('15-MAY-2011 23.59.59.000000000
                 +00:00','DD/MM/YYYY HH24:MI:SS.FF TZH:TZM') and
                 s.status='invalid' and e.mop_id=l.id) as Invalid, (select
                 count(distinct e.youview_id)  from mips_mdm.entity_lookup e
                 inner join mips_mdm.tx_status s on e.youview_id = s.youview_id
                 where e.date_created < TO_TIMESTAMP_TZ('15-MAY-2011
                 23.59.59.000000000 +00:00','DD/MM/YYYY HH24:MI:SS.FF TZH:TZM')
                 and e.mop_id=l.id) as Total from mips_mdm.mop_lookup l order by
                 l.id;
    
    -------------------------------------------------------------------------------
    ERRORS SECTION
    -------------------------------------------------------------------------------
    - ORA-00911: invalid character
    
    -------------------------------------------------------------------------------
    Please can I know what is cauing this error to occur in SQL tunning games.

    Published by: BluShadow on May 24, 2011 11:13
    addition of {noformat}
    {noformat} tags                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

    >
    "of mips_mdm.mop_lookup the order by l.id;"
    >

    Try to remove the semicolon ';' sql statement (quoted string) and re - run.

    Thank you

    REDA

  • ORA-00911: invalid character

    Hello world

    I create procedures in ODI so I could execute the PL/SQL code on my tables in ODI.

    I tested this stored procedure directly on SQL Developer and it works, but once I put in on a procedure ODI he does not work and gives me an ORA-00911

    So what I did, is that I took this same code and it has run on SQL Developer and it runs quite rightly!

    Any ideas? or sugestion? I really appreciate your time and your advice.

    Best regards.

    Parto of the SP (stored procedure) code:
    All the X are the ABC characters, so there just letters and vowels from A to Z.

    create or replace
    PROCEDURE MY_BEAUTIFUL_SP AS

    BEGIN

    XXXXXX XXXX XXX_X_XXX_2
    XXXXXX XXXX XX MOMO605,
    XXXXXXX_XX XX XXXX,
    XXX_XXX_XX XX XXXX,
    (XXX_XXXXX) XXX XX X_XXX_XXX_X,
    X_XXX_XXX_XXX_X XX XXXX,
    XXXXXXX_XXXX XX XXXXXXX,
    "XXX XXXXXXXXXXXX XXXXXXXXXXXX" XX XXX_XXX_XXXX
    XXX_X_XXX_XXX XXXX
    XXXXXXX XXXXXXX XXXXX
    (
    XXX_XXXXX XXX XXXXXXX XX
    (
    XXXXXXXXXX_XXXXX_XXXX XX 'XXXXXXXXX XXXXX + XXXX. "
    XXXXXXXXX_XXXXX XX 'XXXXXXXXX XXXXX. "
    XXXX XX "XXXX."
    XXXXXX_XXXXX XX "XXXXX."
    XXXXXXXX XX "XXXXXXXX"
    XXXXXXXX XX "XXXXXXXX"
    XXXXX XX "XXXXX."
    XXX_XXXXXXXXXXX XX 'XXX XXXXXXXXXXX. "
    XXXXXXXX XX "XXXXXXXX"
    XXX_XXXXXXX XX 'XXX_XXXXXXX. "
    XX XX "XX."
    XXXXXXXXXXXX XX "XXXXXXXXXXX",.
    XX XXX "XXX".
    )
    )
    XX_XX_XXX = "XXX XXXXXXXXXXXX XXXXXXXXXXXX" XXXXX
    XX XXXXX XXXXXXX, XX_XX_XXX;

    COMMIT;
    END MY_BEAUTIFUL_SP;

    Remove the ';' after VALIDATION and the END MY_BEAUTIFUL_SP

    Also, it is best to have your pl/sql code created at the level of the DB... i.e. of procedure/function and then in ODI you put him on the breast
    BEGIN

    and

    END;

    The main advantage, if in the future, you want to make some changes in the part of pl/sql, you can do it from DB and there is no need to generate ODI scenario

    Thank you
    Fati

  • If I run my query in Oracle, it runs without error, but when I run inside c# gives ORA-00911: invalid character

    I like to run below myQuery in c#, but saw the error. No idea what is the problem? If I'm running myQuery in Oracle, it runs without error. "I put all the +" before starting the myQuery line and "end of the line. but nothing changes.

    myQuery =

    with the CBC as

    (

    Select src.table_name src_table_name, src.column_name src_col_name, src.data_type src_data_type, src.data_length src_data_len, src.data_precision src_data_precision, src.data_scale src_data_scale,

    CBC. Nullable src_nullable, decode (T.Constraint_Type, 'P', 'Primary Key', 'U', 'Unique', ") as src_cons

    all_tab_columns CBC

    left join (select Cc.Column_Name, Uc.Constraint_Type

    of user_cons_columns cc, uc user_constraints

    where Cc.Constraint_Name = Uc.Constraint_Name

    and Cc.Table_Name = Uc.Table_Name) t

    on T.Column_Name = Src.Column_Name

    where table_name = 'INSTRUCTOR' and owner = "ERHAN"

    ),

    As TGT

    (

    Select tgt.table_name tgt_table_name, tgt.column_name tgt_col_name, tgt.data_type tgt_data_type, tgt.data_length tgt_data_len,

    TGT.data_precision tgt_data_precision, tgt.data_scale tgt_data_scale, tgt.nullable tgt_nullable,

    Decode (T.Constraint_Type, 'P', 'Primary Key', 'U', 'Unique', ") as tgt_cons

    from all_tab_columns tgt

    left join (select Cc.Column_Name, Uc.Constraint_Type

    of user_cons_columns cc, uc user_constraints

    where Cc.Constraint_Name = Uc.Constraint_Name

    and Cc.Table_Name = Uc.Table_Name) t

    on T.Column_Name = TGT. Column_Name

    where table_name = 'INSTRUCTOR' and owner = "SARIGUL"

    ),

    col_details as

    (

    Select src.src_table_name, nvl (tgt.tgt_table_name, first_value (tgt_table_name) more (order of nulls last tgt_table_name)) tgt_table_name;

    SRC.src_col_name, src.src_data_type, src.src_data_len, src.src_data_precision, src.src_data_scale, src.src_nullable, src_cons,

    TGT.tgt_col_name, tgt.tgt_data_type, tgt.tgt_data_len, tgt.tgt_data_precision, tgt.tgt_data_scale, tgt.tgt_nullable, tgt_cons

    the CBC

    outer join full tgt

    on)

    SRC.src_col_name = tgt.tgt_col_name

    )

    )

    Select *.

    de)

    Select the case sensitive option

    When tgt_data_type! = src_data_type or tgt_data_len! = src_data_len or tgt_data_precision! = src_data_precision or tgt_data_scale! = src_data_scale or tgt_nullable! = src_nullable

    then 'alter table ' | tgt_table_name | 'Edit ' | tgt_col_name | ' ' || src_data_type | ' ' ||

    -case when src_data_type null ('DATE') then

    on the other

    case

    When src_data_type in ('VARCHAR', 'VARCHAR2')

    then ' (' |) NVL (to_char (src_data_len), ' ') | ') '

    otherwise decode (nvl (src_data_precision-1),-1, null, nvl (to_char (src_data_precision), ' ') |) ', ' || NVL (to_char (src_data_scale), ' ') | ')')

    end

    end

    ||

    cases where tgt_nullable = 'Y' then 'null '.

    of another end 'not null '.

    || tgt_cons

    When tgt_col_name is null

    then 'alter table ' | tgt_table_name | 'Add ' | src_col_name | ' ' ||  ' ' || ' ' || src_data_type | ' ' ||

    -case when src_data_type null ('DATE') then

    on the other

    case

    When src_data_type in ('VARCHAR', 'VARCHAR2')

    then ' ('| nvl (to_char (src_data_len), ' ') |) ') '

    otherwise decode (nvl (src_data_precision-1),-1, null, nvl (to_char (src_data_precision), ' ') |) ', ' || NVL (to_char (src_data_scale), ' ') | ')')

    end

    end

    || tgt_cons

    When src_col_name is null

    then 'alter table' | tgt_table_name: ' drop '. tgt_col_name

    end alter_statement

    of col_details

    )

    where alter_statement is not null;

    using (OracleConnection conn1 = new OracleConnection (connectionString))

    {

    conn1. Open();

    Dim myQuery = "";

    using (OracleCommand = new OracleCommand (myQuery, conn1) crtCommand)

    {

    richTextBox1.AppendText (output);

    richTextBox1.AppendText (crtCommand.ExecuteNonQuery (). (ToString());

    richTextBox1.AppendText (output);

    }

    }

    VR;

    myQuery=
    @"with src as
    (
    ...
    ";
    

    That means a @ before the beginning of a string literal mean? -C# Foire - Site Home - MSDN Articles

    as an example

    OracleCommand cmd = con.CreateCommand();
    cmd.CommandText = @"begin apps.mo_global.init('SQLAP'); begin apps.fnd_global.apps_initialize(5710, 20639, 200); end; end;";
    cmd.ExecuteNonQuery();
    

    richTextBox1.AppendText (crtCommand.ExecuteNonQuery (). (ToString());                            

    is this correct? Not sure

    as example try

     using (OracleConnection conn1 = new OracleConnection(connectionString))
    {
        conn1.Open();
    
        string myQuery = "......";                  
    
        using (OracleCommand crtCommand = new OracleCommand(myQuery, conn1))
            {
                richTextBox1.AppendText(Environment.NewLine);
                // richTextBox1.AppendText(crtCommand.ExecuteNonQuery().ToString());
    
    OracleDataReader reader = crtCommand.ExecuteReader();
    while (reader.Read())
      {
        richTextBox1.AppendText(reader.GetString(0));
        // may be also
        // richTextBox1.AppendText(Environment.NewLine);
      }
    
                richTextBox1.AppendText(Environment.NewLine);
    
            reader.Dispose();
            cmd.Dispose();
            }
    
        con.Dispose();
    }
    
  • Problem of data model ORA-00911: invalid character

    I am confronted with error when I run beep

    Help me


    < name of dataTemplate = "SrBysrtype" description = "ServiceRequestBySrtype" than one dataSourceRef = 'demo' defaultPackage = "BIP_DateRange" >
    < Parameters >
    < name of the parameter 'p_Fromsrdate' = 'char' dataType = / >
    < name of the parameter 'p_Tosrdate' = 'char' dataType = / >
    < / Parameter >
    < dataQuery >
    < SQLStatement instance name = "Q1" >
    <! [CDATA]
    SELECT
    incident. Incident_Number as ServiceRequestNumber,
    To_char (incident.incident_date,'DD-MON-YYYY "") as ServiceRequestDate,
    incident. Summary summary,
    agenttime. AgentName as Nom_agent,
    TO_CHAR (agenttime.agentstarttime,'DD-MM-YYYY HH24:MI:SS) as StartTime.
    TO_CHAR (to_date('00:00:00','HH24:mi:SS') +)
    (agenttime. EndTime - agenttime.agentstarttime), "HH24:MI:SS") as TimeSpent
    OF cs_incidents_all_b the incident cs_agenttime_agv agenttime, where & srwhereclause;]] >
    < / sqlStatement >
    < / dataQuery >
    < name dataTrigger = "beforeReport" source = "BIP_DateRange.BeforeReport ()" / >
    < dataStructure >
    < name of group = "G_SR" datatype = "varchar2" source = "Q1" >
    < element name = "Incident_Number" value = "ServiceRequestNumber" / >
    < element name = "Incident_date" value = "ServiceRequestDate" / >
    < element name = "Summary" value = "Summary" / >
    < element name = "nom_agent" value = "Nom_agent" / >
    < element name = "agentstarttime" value = "StartTime" / >
    < element name = "AgentDuration" value = "TimeSpent" / >
    < / Group >
    < / dataStructure >
    < / dataTemplate >





    create or replace
    package BIP_DateRange as

    srwhereclause varchar2 (1000): = ' ';
    p_Fromsrdate varchar2 (400);
    p_Tosrdate varchar2 (400);

    function BeforeReport return Boolean;

    end BIP_DateRange;




    create or replace
    package body BIP_DateRange as

    function boolean return BeforeReport is
    Start

    If p_Fromsrdate is not null then
    srwhereclause: = 'agenttime.incident_id = incident.incident_id | ' AND incident.incident_date between TO_DATE ('| p_Fromsrdate |', "DD-MON-YYYY")';
    end if;
    If p_Tosrdate is not null then
    srwhereclause: = srwhereclause | "AND TO_DATE ('| p_Tosrdate |',"DD-MON-YYYY")';
    end if;
    Returns true;
    end;

    end BIP_DateRange;




    help me I am new to BEEP with data model

    Hmm, can you send me an email to [email protected] please?

    I think that there are two different methods. In fact I have no test system for this here at the moment, so I can't try for me...

    Add two parameters to your package specifications:

    >
    create or replace
    package BIP_DateRange as

    srwhereclause varchar2 (1000): = '1 = 1';
    P_FROM varchar2 (400);
    p_to varchar2 (400);
    p_fromdate varchar2 (400);
    p_todate varchar2 (400);

    function beforereport (p_from varchar2, p_to in varchar2) return Boolean;

    end BIP_DateRange;

  • error ORA-4068:-l' current state of the package is invalidated

    Hai friends,

    Please see this link

    Problem we faced, it is ' error ora-4068:-l' current state of the package is disabled "in the application.initiallly of customer, we migrated to oracle 9i and 10g 10.2.0.4.0

    We have discussed and obtained the solution as the timestamp of the objects may be different. (we expect the access rights of the table sys.obj$) pls see the link

    Re: oracle error-4068

    But now we are informed senior as below

    (1) error ora-4068 will come only when recompile us the view. is this true?

    (2) 6136074 bug is fixed in 10.2.0.4.0. is it?

    Gurus of give your valuable suggestions

    S

    Packages tend to fail because of their 'package '. A package has a 'State' when it contains the package variable and constant level etc. and the package is called. On the first calling package, the 'State' is created in memory to hold the values of these variables, etc. If an object including the package depends on for example a table is changed somehow example deleted and recreated due to data dependencies, the package then takes a State not VALID. When you do then appealed to the package, Oracle examines the status and see that it is not valid, then determines that the package has a "State". Because something changed the package depended on, the State is taken as being obsolete and is ignored, which causes the error "State package has been abandoned" message.

    If a package has no variables of level package etc. i.e. the 'State' and then, taking the same example above, the whole takes an INVALID state, but when you make then a call to the package, Oracle considers as invalid, but knows that there is no 'State' attached to it and is therefore able to recompile the package automatically and then continue execution without causing error messages. The only exception here is if the thing that the package was dependent on a change of such kind that the package may not compile, in which case you will get an invalid error package type.

    And if you want to know how we prevent Jetty package States...

    Move all variables and constants in a stand-alone package specification and to refer to those of your original package. So when the status of your original packing is invlidated for some reason, it has no State package and can be recompiled automatically, however the packaging containing the vars/const is not cancelled because it has no dependencies, so the State that is in memory for this package will remain and may continue to be used.

    As for package-level sliders, you will need to make these premises to the procedures/functions using them as you won't be able of sliders reference in all of packages like that (not sure on the use of the REF CURSOR but... exists for me to study!)

    This first example shows the State being disabled by adding a new column on the table and causing to give a 'Package State scrapped' error...

    SQL> set serveroutput on
    SQL>
    SQL> create table dependonme (x number)
      2  / 
    
    Table created.
    
    SQL>
    SQL> insert into dependonme values (5)
      2  / 
    
    1 row created.
    
    SQL>
    SQL> create or replace package mypkg is
      2    procedure myproc;
      3  end mypkg;
      4  / 
    
    Package created.
    
    SQL>
    SQL> create or replace package body mypkg is
      2    v_statevar number := 5; -- this means my package has a state
      3
      4    procedure myproc is
      5      myval number;
      6    begin
      7      select x
      8      into myval
      9      from dependonme;
     10
     11      myval := myval * v_statevar;
     12      DBMS_OUTPUT.PUT_LINE('My Result is: '||myval);
     13    end;
     14  end mypkg;
     15  / 
    
    Package body created.
    
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        VALID
    
    SQL>
    SQL>
    SQL> alter table dependonme add (y number)
      2  / 
    
    Table altered.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        INVALID
    
    SQL>
    SQL> exec mypkg.myproc
    BEGIN mypkg.myproc; END;
    
    *
    ERROR at line 1:
    ORA-04068: existing state of packages has been discarded
    ORA-04061: existing state of package body "SCOTT.MYPKG" has been invalidated
    ORA-06508: PL/SQL: could not find program unit being called: "SCOTT.MYPKG"
    ORA-06512: at line 1
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        INVALID
    
    SQL>
    SQL> exec mypkg.myproc
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        VALID
    

    And the following example shows how to get the package in their own specifications of package variables, allows the package to automatically recompile when it is called even if it has become invalid by the action to add a column to the table.

    SQL> drop table dependonme
      2  / 
    
    Table dropped.
    
    SQL>
    SQL> drop package mypkg
      2  / 
    
    Package dropped.
    
    SQL>
    SQL> set serveroutput on
    SQL>
    SQL> create table dependonme (x number)
      2  / 
    
    Table created.
    
    SQL>
    SQL> insert into dependonme values (5)
      2  / 
    
    1 row created.
    
    SQL>
    SQL> create or replace package mypkg is
      2    procedure myproc;
      3  end mypkg;
      4  / 
    
    Package created.
    
    SQL>
    SQL> create or replace package mypkg_state is
      2    v_statevar number := 5; -- package state in seperate package spec
      3  end mypkg_state;
      4  / 
    
    Package created.
    
    SQL>
    SQL> create or replace package body mypkg is
      2    -- this package has no state area
      3
      4    procedure myproc is
      5      myval number;
      6    begin
      7      select x
      8      into myval
      9      from dependonme;
     10
     11      myval := myval * mypkg_state.v_statevar;  -- note: references the mypkg_state package
     12      DBMS_OUTPUT.PUT_LINE('My Result is: '||myval);
     13    end;
     14  end mypkg;
     15  / 
    
    Package body created.
    
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        VALID
    
    SQL>
    SQL> alter table dependonme add (y number)
      2  / 
    
    Table altered.
    
    SQL>
    SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG'
      2  / 
    
    OBJECT_NAME
    --------------------------------------------------------------------------------------------------
    OBJECT_TYPE         STATUS
    ------------------- -------
    MYPKG
    PACKAGE             VALID
    
    MYPKG
    PACKAGE BODY        INVALID
    
    SQL>
    SQL> exec mypkg.myproc
    My Result is: 25
    
    PL/SQL procedure successfully completed.
    
  • Error ORA-00911 create a view with PL/SQL

    Hello. Working with SQL Developer, I'm writing a procedure that creates a view.
    After a compilation successful, whenever I try to run it, I get an error ORA-00911 and I'm not able to find the reason.
    Here is my code. Thanks in advance.
      CREATE OR REPLACE PROCEDURE "DWH_STAR"."STORICO_DATA" (
      DATA_INPUT IN VARCHAR2
    )AS
    BEGIN
      EXECUTE IMMEDIATE '
        CREATE OR REPLACE FORCE VIEW DWH_STAR.V_PORT_STOR_DATA (DATA_DESC, CLIENTE_KEY, PRODOTTO_KEY, AGENTE_KEY, TIPOLOGIA_KEY, 
        NUM_ORDINE, NUM_UNITA, RICAVO_LORDO, RICAVO_NETTO, COSTO_STD_TOTALE, GROSS_PROFIT) AS 
        SELECT
          dt.DATA_DESC,
          fv.CLIENTE_KEY,
          fv.PRODOTTO_KEY,
          fv.AGENTE_KEY,
          fv.TIPOLOGIA_KEY,
          fv.NUM_ORDINE,
          SUM (NUM_UNITA) NUM_UNITA,
          SUM (RICAVO_LORDO) RICAVO_LORDO,
          SUM (RICAVO_NETTO) RICAVO_NETTO,
          SUM (COSTO_STD_TOTALE) COSTO_STD_TOTALE,
          SUM (GROSS_PROFIT) GROSS_PROFIT
        FROM
          F_VENDUTO fv, D_TEMPO dt
        WHERE
          fv.TEMPO_KEY = dt.TEMPO_KEY
          AND TO_NUMBER(TO_CHAR(dt.DATA_DESC,''YYYYMMDD'')) <=' || DATA_INPUT ||'
        GROUP BY
          fv.CLIENTE_KEY,
          fv.PRODOTTO_KEY,
          fv.AGENTE_KEY,
          fv.TIPOLOGIA_KEY,
          fv.NUM_ORDINE,
          dt.DATA_DESC
        ORDER BY 
          dt.DATA_DESC, 
          fv.CLIENTE_KEY,
          fv.PRODOTTO_KEY,
          fv.AGENTE_KEY,
          fv.TIPOLOGIA_KEY,
          fv.NUM_ORDINE;
        UNION
        SELECT
          dt.DATA_DESC,
          fs.CLIENTE_KEY,
          fs.PRODOTTO_KEY,
          fs.AGENTE_KEY,
          fs.TIPOLOGIA_KEY,
          fs.NUM_ORDINE,
          - SUM (NUM_UNITA) NUM_UNITA,
          - SUM (RICAVO_LORDO) RICAVO_LORDO,
          - SUM (RICAVO_NETTO) RICAVO_NETTO,
          - SUM (COSTO_STD_TOTALE) COSTO_STD_TOTALE,
          - SUM (GROSSO_PROFIT) GROSS_PROFIT
        FROM
          F_SPEDITO fs, D_TEMPO dt
        WHERE
          (fs.CAUSA_RESO_KEY = 0
           AND fs.TEMPO_KEY = dt.TEMPO_KEY
           AND TO_NUMBER(TO_CHAR(dt.DATA_DESC,''YYYYMMDD'')) <=' || DATA_INPUT ||'
           )
        GROUP BY
          fs.CLIENTE_KEY,
          fs.PRODOTTO_KEY,
          fs.AGENTE_KEY,
          fs.TIPOLOGIA_KEY,
          fs.NUM_ORDINE,
          dt.DATA_DESC
        ORDER BY 
          dt.DATA_DESC, 
          fs.CLIENTE_KEY,
          fs.PRODOTTO_KEY,
          fs.AGENTE_KEY,
          fs.TIPOLOGIA_KEY,
          fs.NUM_ORDINE
      '
      ;
    END;
    /
     

    delete the order and the semicolon (;) of the first select statement. I hope you know that the operator union the same set of columns to be selected.

    But try to avoid to create objects on the fly, unless and until it is absolutely necessary and inevitable.

    Concerning

    REDA

    Published by: R.Subramanian on June 21, 2010 07:52

    Published by: R.Subramanian on June 21, 2010 07:53

  • Error: ORA-01722: invalid number

    Hello

    Can some please tell me what I'm doing wrong when I try to make a difference?

    Since the format is the same I use this query

    Select b1 - b2 of TMP_1;
    Error: ORA-01722: invalid number
    --create table         
        CREATE TABLE TMP_1
    (
      B1  VARCHAR2(8 BYTE),
      B2  VARCHAR2(8 BYTE)
    ) 
    /
    
    --insert 
    
    INSERT INTO TMP_1 (B1, B2)
         VALUES ('00:02:54', '00:02:10');
    
    INSERT INTO TMP_1 (B1, B2)
         VALUES ('00:05:47', '00:03:56');
    
    INSERT INTO TMP_1 (B1, B2)
         VALUES ('00:12:49', '00:02:37');
    
    INSERT INTO TMP_1 (B1, B2)
         VALUES ('00:49:33', '00:02:09');
    
    INSERT INTO TMP_1 (B1, B2)
         VALUES ('00:06:34', '00:02:39');
    
    INSERT INTO TMP_1 (B1, B2)
         VALUES ('00:02:45', '00:01:41');
    
    INSERT INTO TMP_1 (B1, B2)
         VALUES ('00:01:22', '00:00:22');
    
    COMMIT;
    objective:

    Need to get the difference in the same format as the
     columns example: 00:02:54 

    Please provide examples of data, it is very useful. Here's one way:

    SQL> select b1, b2,
      2         b1 - (to_date(to_char(sysdate, 'dd-mon-yyyy')||' '||b2,'dd-mon-yyyy hh24:mi:ss') - trunc(sysdate)) b3
      3  from tmp_1;
    
    B1                   B2       B3
    -------------------- -------- --------------------
    03-dec-2012 20:13:33 00:02:10 03-dec-2012 20:11:23
    03-dec-2012 18:24:24 00:03:56 03-dec-2012 18:20:28
    03-dec-2012 21:48:33 00:02:37 03-dec-2012 21:45:56
    03-dec-2012 15:50:09 00:02:09 03-dec-2012 15:48:00
    03-dec-2012 14:06:24 00:02:39 03-dec-2012 14:03:45
    03-dec-2012 21:47:15 00:01:41 03-dec-2012 21:45:34
    

    John

  • Error: ORA-29283: invalid file so that registerdatabase operation

    We get the error during the registration of the agent to the server
    AGENT_HOME/bin/schagent - registerdatabase port > < host > <
    Error:
    Oracle Scheduler Agent registration
    The agent registration failed!
    Error: ORA-29283: invalid file operation
    ORA-06512: at "SYS." UTL_FILE", line 536
    ORA-29283: invalid file operation

    Database version: 11.1.0.7.0

    Someone at - he seen these errors?

    Published by: Gaham on August 10, 2009 12:03 AM

    Published by: Gaham on August 10, 2009 12:04 AM

    Hello

    This can happen if you have recently changed ORACLE_HOME for the database. We're currently tracking this as a bug.

    To work around this problem, you can do

    delete the PLANNER directory $ _WALLET_DIR;

    -replace ORACLE_HOME with the full path to your new oracle home
    - and use-instead of / for Windows
    Create directory PLANNER$ _WALLET_DIR as "ORACLE_HOME/Planner/portfolio";

    Hope this helps,
    Ravi.

  • DB Link error: ORA-12154: TNS: could not resolve the connect identifier specified

    Hi all

    We need to make an entry in the tnsname.ora file in a local database to connect to the remote database using db link?

    Here is my code: -.

    create the database link * _DBLINK

    connect to the USER IDENTIFIED BY 'user '.

    using '(DESCRIPTION =)

    (ADDRESS_LIST =

    (ADDRESS = (PROTOCOL = TCP) (HOST = *. *. *. *)(PORT = 1521))

    )

    (CONNECT_DATA = (SERVICE_NAME = REM)

    )';

    After the creation of the DB connection when I'm trying to run select 1 of dual@***_DBLINK

    He throws me an error ORA-12154: TNS: could not resolve the connect identifier specified

    Am I expected to do an entry in the file tnsname.ora for "REM". I don't remember making any changes in the file tnsname.ora for the creation and access of the remote database via dblink.

    Help, please.

    Thanks in advance.

    2925917 wrote:

    Hi all

    We need to make an entry in the tnsname.ora file in a local database to connect to the remote database using db link?

    Here is my code: -.

    create the database link * _DBLINK

    connect to the USER IDENTIFIED BY 'user '.

    using '(DESCRIPTION =)

    (ADDRESS_LIST =

    (ADDRESS = (PROTOCOL = TCP) (HOST = *. *. *. *)(PORT = 1521))

    )

    (CONNECT_DATA = (SERVICE_NAME = REM)

    )';

    After the creation of the DB connection when I'm trying to run select 1 of dual@***_DBLINK

    He throws me an error ORA-12154: TNS: could not resolve the connect identifier specified

    Am I expected to do an entry in the file tnsname.ora for "REM". I don't remember making any changes in the file tnsname.ora for the creation and access of the remote database via dblink.

    Help, please.

    Thanks in advance.

    I've learned to trust in your obfuscation you covered something important, or you are showing some apples and oranges.  Error to declare you come from not being able to find referenced in tnsnames.ora entry, but the way you say you created your link db, you hardcoded the entire connection, so he never users tnsnames.ora.

    I would change the definition of db_link

    create the database link * _DBLINK

    connect to the USER IDENTIFIED BY 'user '.

    using "REM."

    Then create an entry in your tnsnames.ora

    REM =

    (DESCRIPTION =

    (ADDRESS_LIST =

    (ADDRESS = (PROTOCOL = TCP) (HOST = *. *. *. *)(PORT = 1521))

    )

    (CONNECT_DATA = (SERVICE_NAME = REM)

    )

    )

    Also, use server name instead of the HOST = IP address

    The closer looks that you can miss brackets final closing on your original definition.

Maybe you are looking for

  • Why firefox is unable to answer a direct question without all this bs you have to do?

    http://rvzr-a.akamaihd.NET/SD/wrap-0.01.html?u=http%3A%2f%2Frvzr-a.akamaihd.NET%2Fsd%2Fapps%2Ffusionx%2F0.0.4.html%3Faff%3D1700-1044 This site is popping up on firefox on many computers. Why in the hell can't firefox blocking fix the issue without ha

  • ratings does not work on Iphone6s more

    I just bought an Iphone6s more and I am surprised that I can't make drawings in the application notes. to the tune of my iPad2, I see the symbol to make a drawing, but not on my iphone. Thanks in advance Patrick

  • Satellite Pro L40 - cannot install Windows XP

    Material: Satellite Pro L40, HDD 80 GB, 1.5 GB of RAM Software: Windows XP + SP2 install CD, floppy disk with AHCI HDD ICH8M_32bit drivers drivers created according to the instructions in "how to install Windows XP on a L40.pd"f of Toshiba (which is

  • the windos not updated

    Microsoft Silverlight (KB979202)

  • My Linksys wireless router is not all sites loading...

    It's quite frustrating because it took me a day or 2 perfectly set up my wireless network. I have finally the network set up after tackling various issues under this... In any case, my PC does not load some Web pages, and I can't really say why. It i