can a sql statement cause different sql_id?

can a sql statement cause different sql_id? reason why I ask... in my AWR report by looking at the sql section I found even with different sql_id sql query... .i was thinking of a sql can have only a single sql_id... .i double checked 5 or 6 times the sql text... they are the exact same, but different sql_id... .is it possible?

No, it is not possible.

However if you compare:

select * from emp.scott 

with

select * FROM emp.scott

These two will have different hash values, because the hash value is case-sensitive.

I know, Oracle uses the portion of the MD5 to generate the SQL_ID and the HASH_VALUE of a sql statement.

Bearing in mind the last, it would be possible that two different sql queries have same hash values.

I recommend Tanel Poder's article on the relationship between the SQL_ID and HASH_VALUE (it's a very good article)

http://blog.tanelpoder.com/2009/02/22/sql_id-is-just-a-fancy-representation-of-hash-value/

Tags: Database

Similar Questions

  • SQL statement causes the database to hang

    Guys,

    a DBA told me that there is something wrong with this SQL statement and causes a blockage of database...

    Please check.

    SELECT field1 FROM table1 WHERE Field1 LIKE ' %% ' AND field2 = '123456' ORDER BY Field2 ASC

    Tell me, what is the problem with statement above. The LIKE operator is?

    Thanks for the help!

    Are not specifically related to your question, but having a clause such as ' where Field2 ='123456 "and then you place your order on Field2 is not really going to do much for you, all values will be identical!

    Carl

  • Copy SQL statement to another database with the same SQL_ID

    Is there a reliable way to copy a sql statement in a database to another preserving the formatting so it ends with the same SQL_ID.

    I want to copy a statement of the shared pool to a test database to develop a plan to import sql database in production.

    In the past, I just did ' select sql_fulltext from v$ sql "in SQL Developer and pasted the result into a spreadsheet SQL Developer and run it.   The statement is now in the pool shared with the correct sql_id.

    This does not work for instruction, I am currently in train.  It ends with a different id of sql.

    I know it's probably a problem of formatting, but the statement is 1000 characters and a manual check will take forever.

    You could put in a SQL Tuning Set and transfer it.

  • find sql_id using the sql statement, including the carriage return and tab...

    Hello. all.

    I wonder how to find sql_id using a sql statement, including transport retrun and tab space multiple.
    To be more precise,

    My sql is:

    Select
    col_a,
    col_b,
    ..
    ..

    I usually use the following query to find the sql_id

    Select sql_id in v$ sql where sql_text like 'MY SQL STATEMENT %.

    When MY SQL STATEMENT includes carriage return and tab space multiple, how can I do?

    Thanks in advance.
    Best regards.

    Hello

    Did you look at regular expressions? Use regexp_like instead of as.

    http://www.Stanford.edu/dept/ITSS/docs/Oracle/10G/server.101/b10759/conditions018.htm

    Kind regards

  • How can I pass a condition of the table in the sql statement?

    For example, in the table in the COND Varchar2 column (200) there is the value ' VAR > 10'.

    | COND |

    |' VAR > 10' |

    where VAR is the name of the table column. I would like to make statement CASE WHEN VAR > 10 AND 0... I tried with as subquery

    WHEN BOX (SELECT COND FROM TABLE WHERE...) THEN 0, but it does not work.

    Hello

    You can do this by using dynamic SQL.

    that is to say:

    declare
      v_stm      varchar2(4000);
      v_cond      varchar2(100);
      v_result    integer;
    begin
      select cond
        into v_cond
        from yourtable
      where a=1;
    
      v_stm := 'select case when '||v_cond||' then 0 ...';
    
      -- dynamic sql
      execute immediate v_stm
        into v_result;
    
    end;
    /
    

    Remember that, in general, dynamic SQL has a performance degradation that SQL static and should be avoided when possible.

    Storage condition or the SQL statements in the tables is not a good practice.

    Kind regards.

    Alberto

  • error in pseudo-column "DECODE" can be used within an SQL statement

    Hi gurus,

    Your help is grealty appreciated. Please help me.


    I'm trying to see if I can use the function decode as below and get the error, here below vPlatformfrom value would be QA or MTS


    vDataBase1 :='@'|| Decode (vPlatformfrom, 'STD', 'STD', 'QA', 'QA')


    Before we check function NVL to a single platform, but now we need the database based on the platform is here.

    -vDataBase1 :='@'|| NVL (vPlatformto, 'MTS');

    Error:

    PLS-00204: pseudo-column "DECODE" or function may be used within an SQL statement

    > So, here, instead of the decode function, I can use this case as below:

    Well... you can, but why?  In your CASE, you simply return the same value as the variable.

    You might as well use: vDataBase1: = vPlatformfrom;  It would reach exactly the same thing.

    If vPlatformfrom can be a null value, you will need to decide what database to use or an exception.  I think you're original code (NVL) were probably more correct, but I can't decide which.

    (and don't bother selecting double, it is an unnecessary sql statement which must be analysed, etc..)

  • Cannot use scroll effects in Muse so fluid mode, each page can cause different fluids on the fixed sections?

    Cannot use scroll effects in Muse so fluid mode, each page can cause different fluids on the fixed sections?

    Example: I have 4 pages and alone is fluid and the other are fixed?

    Yes, you can have effects from scrolling on a site which is partially adapted to the needs, as each page is independent of the others. Muse only disables the effects when you add a breakpoint to a page.

    David

    https://creativemuse.co

  • Can I write merge SQL statement having count (*)?

    Hi, this is a follow-up to my previous post question. I tried to use a SQL statement of merger to solve my problem, but now I come across another problem.
    Now, I have a table where the field updated necessary is a partial PK
    When you use a SQL statement of merger, I put a where clause clause that check if count (*) = 1 because of the constraint of PK
    Where I put the count ()) = 1 clause?

    Here are the details:
    I have two tables TA and TB, where TA contains the fields IDS, FULLNAME, TYPE and tuberculosis contains the fields ID, NAME
    I want to update the names in TB for TA names where TB.ID = TA.ID and TA. TYPE = 'ABC '.
    {ID, first NAME} are PKs but for the same ID, there may be more than 1 firstname.
    for example
    TA
    -------------------------------
    ID | FULLNAME | TYPE
    1 Caroline T ABC
    2 Mary C DEF
    3 Peter J ABC

    TB
    ----------------------
    ID | FIRSTNAME
    1 Caroline
    1 Carol
    1 C,
    3 Peter

    I need to update TB with the new names of TA where type is 'ABC', but only for those areas that have count (TB.ID) = 1
    When I try to run this SQL statement

    merge into TB B using TA A
    on (A.ID = B.ID and A.TYPE = 'ABC')
    when matched, then update the value B.FIRSTNAME = substr (A.FULLNAME, 1, instr (A.FULLNAME, ',') - 1)

    I got this error SQL error: ORA-00001: unique constraint (TEST.) PK_TB) violated
    which I believe is because I've updated these fields say ID = 1, with 'Caroline '.
    This means that I'll have to add a clause with count (TB.ID) = 1
    How would you do it?

    Server Oracle 11 g is
    Thank you!

    Hello

    One way is to join your and tb in the USING clause and eliminate duplicates it.

    MERGE INTO     tb     dst
    USING   (
             SELECT    ta.id
             ,           REGEXP_SUBSTR ( MIN (ta.fullname)
                                    , '^[^,]*'
                            )     AS firstname
             FROM      ta
             JOIN      tb  ON  ta.id     = tb.id
             WHERE     ta.type      = 'ABC'
             GROUP BY  ta.id
             HAVING    COUNT (*)     = 1
         )                   src
    ON     (scr.id      = dst.id)
    WHEN MATCHED THEN UPDATE
    SET     dst.firstname     = src.firstname
    ;
    

    If you would care to post CREATE TABLE and INSERT statements for your sample data, and then I could test this.

    I used REGEXP_SUBST instead of SUBSTR and INSTR to search for the first name, because I find it a little cleaner, and because it returns something even when there is none "," fullname, which I assume is what you really want. (None of the fullnames in your sample data have ','s.) You can use SUBSTR and INSTR instead.

  • Why DECODE can be used in the sql statement

    Hello

    Why not works sql1 but sql2.

    decode (1,0,0,1) Select SQL 1) in the var of the double;

    SQL 2) var = decode (1,0,0,1);

    Please specify.

    Kind regards

    Kishore

    decode has been implemented by Oracle to allow "if then else" type determination in SQL statements.

    It was not necessary in PL because PL already had if THEN ELSE as part of the language.

    Since that time became a standard ANSI for SQL, this CASE is now implemented in SQL and PL

    It's just the way it is.

    Your other does not work because it is the PL code, not a query SQL, and DECODE only exists in SQL.

    You'd better stop using DECODE and start to use the CASE instead.

  • Trying to count the number of different occurrences in a SQL statement.

    I am trying to achieve a sql statement, taking into account the number of occurrences of date for a person gives. ... Here's my query so far...

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

    Select TO_DATE(SUBSTRC(trim(ppei.pei_information4),1,10),'RRRR/MM/DD') start_date, ppei.person_id,.
    case
    When ppei.person_id = 130385 then count(TO_DATE(SUBSTRC(trim(ppei.pei_information4),1,10),'RRRR/MM/DD'))
    END AS count_test
    of per_people_extra_info iepp
    where ppei.information_type = 'XXPER_CALL_IN_LOG. '
    and ppei.person_id = 130385
    Group of TO_DATE(SUBSTRC(trim(ppei.pei_information4),1,10),'RRRR/MM/DD'), ppei.person_id
    -----
    START_DATE PERSON_ID COUNT_TEST
    ------------------------- ---------------------- ----------------------
    MARCH 1, 11 130385 1
    MAY 20, 11 130385 1
    JUNE 12, 11 130385 1
    20 JUNE 11 130385 1
    18 AUGUST 11 130385 1

    5 selected lines

    That's what I want the data to look at...

    START_DATE PERSON_ID COUNT_TEST
    ------------------------- ---------------------- ----------------------
    MARCH 1, 11 130385 1
    MAY 20, 11 130385 2
    JUNE 12, 11 130385 3
    20 JUNE 11 130385 4
    18 AUGUST 11 130385 5


    Is it possible to do this?

    There is always a way ;-)
    And, if you'd be working with data easy, as I showed you, it would be easier for you and for the people in this forum.
    Select the field you need. Don't know what exactly you need to allow you to choose and to strengthen

    with test_data as
    (
    select to_date('01-MAR-11','DD-MON-RR') START_DATE, 130385 person_id, 'yes'  pei_information5 from dual union all
    select to_date('20-MAY-11','DD-MON-RR') START_DATE, 130385 person_id, 'yes'  pei_information5 from dual union all
    select to_date('12-JUN-11','DD-MON-RR') START_DATE, 130385  person_id, 'no'  pei_information5 from dual union all
    select to_date('20-JUN-11','DD-MON-RR') START_DATE, 130385  person_id, 'yes'  pei_information5 from dual union all
    select to_date('18-AUG-11','DD-MON-RR') START_DATE, 130385  person_id, 'yes'  pei_information5 from dual union all
    select to_date('01-MAR-11','DD-MON-RR') START_DATE, 111111 person_id, 'yes'  pei_information5 from dual union all
    select to_date('2-MAY-11','DD-MON-RR') START_DATE, 111111 person_id, 'no'  pei_information5 from dual union all
    select to_date('2-JUN-11','DD-MON-RR') START_DATE, 111111  person_id, 'no'  pei_information5 from dual union all
    select to_date('3-JUN-11','DD-MON-RR') START_DATE, 111111  person_id, 'no'  pei_information5 from dual union all
    select to_date('1-AUG-11','DD-MON-RR') START_DATE, 111111  person_id, 'yes'  pei_information5 from dual)
    ---
    select start_date,person_id,pei_information5,
      count(*) over (partition by person_id order by start_date) count_test,
      count(*) over (partition by person_id,pei_information5 order by start_date) count_test2,
      sum(case when pei_information5 ='yes' then 1 else 0 end) over (partition by person_id order by start_date) count_test3,
      sum(case when pei_information5 ='yes' then 1 else 0 end) over (partition by person_id,pei_information5 order by start_date) count_test4
      from test_data
      order by person_id,start_date;
    
    START_DATE                PERSON_ID              PEI_INFORMATION5 COUNT_TEST             COUNT_TEST2            COUNT_TEST3            COUNT_TEST4
    ------------------------- ---------------------- ---------------- ---------------------- ---------------------- ---------------------- ----------------------
    01.03.2011 00:00:00       111111                 yes              1                      1                      1                      1
    02.05.2011 00:00:00       111111                 no               2                      1                      1                      0
    02.06.2011 00:00:00       111111                 no               3                      2                      1                      0
    03.06.2011 00:00:00       111111                 no               4                      3                      1                      0
    01.08.2011 00:00:00       111111                 yes              5                      2                      2                      2
    01.03.2011 00:00:00       130385                 yes              1                      1                      1                      1
    20.05.2011 00:00:00       130385                 yes              2                      2                      2                      2
    12.06.2011 00:00:00       130385                 no               3                      1                      2                      0
    20.06.2011 00:00:00       130385                 yes              4                      3                      3                      3
    18.08.2011 00:00:00       130385                 yes              5                      4                      4                      4                      
    
  • Why a sql statement has become slow after upgrade to 11g database

    Hello

    My previous version of the database is 9I and any sql statement are well-developed.
    but after upgrading to 11g database, a sql statement become slowly.

    My senior dba friend told me there are a few different calculating methods from 9i to 11g.
    is any body can explain this different methods from 9i to 11g, and what should be attention to calculate at what level 9i to 11g. I thank.

    Sean

    The administrator of yours is correct. What he meant, 9i, the works of the optimizer with different formulas and 11 g, there are different formulas. PS this sometimes causes when you upgrade from 9i (or even 10g too), analyze the queries that worked with RBO in 9i perfectly and used indexes, all of a sudden they stop using it because the CBO think not that this is a good choice. It would be too difficult to put formulas here by anyone, but what I can say is that to buy a book.
    http://www.Amazon.com/cost-based-Oracle-fundamentals-experts-voice/DP/1590596366

    And practice on 9i, 10g and 11g. It would say a lot of formulas used by oracle.

    HTH
    Aman...

  • How to run a SQL statement to use a specific implementation plan

    Hi all

    I have a SQL that has recently been run badly. I tried the Advisor tuning SQL for the given SQL query and it gives the following information:

    GENERAL INFORMATION SECTION

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

    Name of the task of tuning: 2q94zb7djr2xn

    The owner task of tuning: LMDBPROD

    Type of work: single SQL statement

    County of execution: 2

    The current run: EXEC_8869

    Type of execution: TUNE SQL

    Scope: COMPLETE

    Time Limit (seconds): 60

    Status: COMPLETED

    Started on the: 03/02/2014-20:43:39

    To the: 03/02/2014 20:44:25

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

    Name of the schema: LMDBPROD

    SQL ID: 2q94zb7djr2xn

    SQL text: SELECT NPCOMMON. FGET_ACTION_CODE (ORDNUM) ACTIONCODE, STATUS,

    SUMA COUNT (*) FROM SORDER, WHERE HEADORDNUM IS NOT NULL AND

    NPCOMMON. FGET_PRODUCTOFFER4ORDER (ORDNUM) IN (SELECT ID FROM)

    PRODUCTOFFER WHERE PPSPECIFICATION_ID IN (SELECT ID FROM)

    PPSPECIFICATION WHERE PCLASS_CODE IN (SELECT PCLASS_CODE FROM)

    ARUSERGROUP WHERE CODE IN (SELECT ARUSERGROUP_CODE FROM)

    ARUSER_ARUSERGROUP WHERE ARUSER_USERNAME =: B1 AND STATUS = '1')

    AND STATUS = '1'))) GROUP BY NPCOMMON. FGET_ACTION_CODE (ORDNUM),

    STATUS

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

    RESULTS SECTION (1 result)

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

    1-alternative Plan conclusion

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

    Some implementation plans alternative for this statement was found by searching

    performance data in real-time and historical of the system.

    The following table lists these plans sorted by their average time.

    See "SECTION of ALTERNATIVE PLANS" section for detailed information on each

    plan.

    plan ID hash last visit elapsed note of origin (s)

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

    1 617797893 2013-07-11/07: 45:20 9.555 no reproducible STS

    2 1311086720 2014-01-31/04: 00:44 19.569 AWR

    3 1226863820 2014-01-31/18: 00:24 AWR 21.158

    4 1359606848 2014-02-03/16: 00:34 21.492 AWR original plan

    The plan with hash 617797893 seems the most efficient one and is based on some specific SQL Tuning Set I ran on this time. But the note says that the plan is not reproducible. Is there anyway how can I force the SQL statement to execute the plan? The database version is Standard Edition 11.2.0.1.0

    Best regards

    Rodriguez

    Hello

    I think you can use this

    http://rnm1978.WordPress.com/2011/06/28/Oracle-11g-how-to-force-a-sql_id-to-use-a-plan_hash_value-using-SQL-baselines/

    before 11 g, we used to create an outline stored for this.

    concerning

  • MERG to sql statements

    any body can help me to merg below of the sql statements for the information

    No. 1

    Select S.USERNAME, s.sid, s.osuser, t.sql_id, sql_text

    de v$ sqltext_with_newlines t, V$ SESSION s

    t.Address = s.sql_address

    et t.hash_value = s.sql_hash_value

    et s.status = 'ACTIVE'

    et s.UserName <> 'SYSTEM'

    order by s.sid, t.piece

    /


    Statements #2


    SELECT SID, to_char (start_time,'hh24:mi:ss') stime,

    message, (sofar/totalwork) * 100%

    DE v$ session_longops

    sofar/totalwork < 1

    /


    I tried


    Select S.USERNAME, s.sid, s.osuser, t.sql_id, sql_text, to_char (sl.start_time,'hh24:mi:ss') stime,

    1. SL.message, (sl.sofar/sl.totalwork)* 100%

    de v$ sqltext_with_newlines t, V$ SESSION s, v$ session_longops sl

    where s.sid = sl.sid

    and where t.Address = s.sql_address

    et t.hash_value = s.sql_hash_value

    et s.status = 'ACTIVE'

    et s.UserName <> 'SYSTEM'

    et sl.sofar/sl.totalwork < 1

    order by s.sid, t.piece


    but it gives me error.


    SQL > select S.USERNAME, s.sid, s.osuser, t.sql_id, sql_text, to_char(sl.start_time,'hh24:mi:ss') stime,.

    2 sl.message, (sl.sofar/sl.totalwork)* 100%

    3 v $ sqltext_with_newlines t, V$ SESSION s, v$ session_longops sl

    4 where s.sid = sl.sid

    5 and where t.address = s.sql_address

    and t.hash_value = s.sql_hash_value

    6 and 7 s.status = 'ACTIVE '.

    8 and s.username <>'SYSTEM '.

    9 and WHERE the sl.sofar/sl.totalwork < 1

    10 decree by s.sid, t.piece

    11.

    and where t.address = s.sql_address

    *

    ERROR on line 5:

    ORA-00936: lack of expression

    any body can help out?

    Not tested, but you can try:

    SELECT s.sid,

    s.Serial #.

    s.machine,

    Round (SL.elapsed_seconds/60). ':' || MOD(SL.elapsed_seconds,60) has elapsed,

    Round (SL.time_remaining/60). ':' || MOD(SL.time_remaining,60) remaining.

    ROUND (sl.sofar/sl.totalwork*100, 2) progress_pct.

    t.sql_id,

    t.sql_text

    V $ session s,.

    v$ session_longops sl.

    v$ sqltext_with_newlines t

    WHERE s.sid = sl.sid

    AND s.serial # sl.serial = #.

    and t.address = s.sql_address

    and t.hash_value = s.sql_hash_value

    and s.status = 'ACTIVE '.

    and s.username <> 'SYSTEM '.

    order of s.sid, t.piece;

    Or see if you can find a useful script here:

    http://www.Oracle-base.com/DBA/scripts.php

  • table/view not found when creating a package, but can execute sql...

    I'm trying to create a package I'm ora-00942 table or view does not exsit, but when I run with the same user tries to create the package in the sql statement that gives NO error through fine.

    Any idea what can cause that?

    -drop table demo_hdr_trgt

    -drop table demo_hdr_stg

    -It's the tabe belong to the other user not my own schema

    connect tstdata/tstdata

    create the table demo_hdr_stg as floor (dbms_random.value (1,101)) select id, floor (dbms_random.value (1001,100001)) double amt connect by level < = 100

    /

    -It's my diagram

    connect me3/me3

    create the table demo_hdr_trgt in select * from hdr_stg where 1 = 0

    /

    Select * from tstdata.demo_hdr_stg by id

    /

    Select * from demo_hdr_trgt by id

    /

    -business for this temporary table to demo rule

    ALTER TABLE demo_hdr_trgt add PRIMARY KEY (id)

    /

    -table to the control of the error for the DML

    Start

    DBMS_ERRLOG. CREATE_ERROR_LOG('tstdata.) DEMO_HDR_STG');

    end

    /

    -Follow-up of the load table if he succeeds

    CREATE TABLE demo_RESULT_TAB

    (VARCHAR2 (100) 'RUN_NAME',)

    VARCHAR2 (100) "V_MODULE."

    VARCHAR2 (100) "V_ACTION."

    NUMBER OF "ROWCOUNT".

    )

    /

    -Follow-up of the other error table

    CREATE TABLE demo_ERROR_TAB

    (VARCHAR2 (100) 'RUN_NAME',)

    VARCHAR2 (100) "V_MODULE."

    VARCHAR2 (100) "V_ACTION."

    NUMBER OF "SQLCODE"

    "SQLERRM' VARCHAR2 (4000).

    "CALL_STACK' CLOB

    )

    /

    -package charge demo

    create or replace package demo_hdr_pkg as

    procedure hdr_ldr (run_name varchar2);

    end demo_hdr_pkg

    /

    create or replace package body demo_hdr_pkg as

    procedure hdr_ldr (run_name varchar2) is

    number of v_sqlcode;

    v_sqlerrm varchar2 (1000);

    v_module varchar2 (100): = "demo_hdr_pkg.hdr_ldr";

    v_action varchar2 (100): = "insert into hdr_trgt";

    number of v_rowcount;

    Start

    DBMS_APPLICATION_INFO.set_module (module_name = > v_module,)

    action_name = > v_action);

    -the sql code that gives ora-00942 errors that I can review independent

    -INSERT / * + append PARALLEL * /.

    INSERT / * + PARALLEL * /.

    IN demo_hdr_trgt, SELECT id, tstdata.demo_hdr_stg amt

    LOG ERRORS IN tstdata. ERR$ (run_name) _demo_HDR_STG

    REJECT LIMIT UNLIMITED;

    v_rowcount: = number of lines sql %;

    INSERT into demo_result_tab (run_name, v_module, v_action, rowcount) values (run_name, v_module, v_action, v_rowcount);

    commit;

    exception when others then

    dbms_output.put_line(SQLCODE||) e '|| SQLERRM);

    v_sqlcode: = sqlcode;

    v_sqlerrm: = sqlerrm;

    insert into demo_error_tab (run_name, v_module, v_action, sqlcode, sqlerrm, call_stack) values (run_name, v_module, v_action, v_sqlcode, v_sqlerrm, dbms_utility.format_call_stack);

    commit;

    -dbms_scheduler to analyze the error table and send e-mail

    end;

    end demo_hdr_pkg

    /

    -test

    declare

    v_runname varchar2 (100): = to_char (sysdate, 'YYYY_MM_DD_HH24_MI_SS');

    Start

    demo_hdr_pkg.hdr_ldr (v_runname);

    end

    /

    Select * from demo_hdr_stg by id

    /

    Select * from demo_hdr_trgt by id

    /

    Select * from demo_error_tab

    /

    Select * from demo_result_tab

    /

    This question is asked almost every day...

    http://martincarstenbach.WordPress.com/2010/05/27/the-difference-between-a-direct-grant-and-a-role-in-PLSQL/

    Summary, you need a DIRECT grant (not through a role), or you could modify the procedure to use the rights of the appellant (the default is rights define).

    See you soon,.

  • Word key missing in to_number conversion in the SQL statement select error

    ORA-00905: lack keyword for the below SQL statement error. It should be of to_number (m.EQUIP_SUB_CLASS_ID, '9999')
    between 3800 and the 3699 where Clause. Is that what I miss in the SQL below?

    SELECT  M.EQUIP_NO,M.EQUIP_CLASS_ID, M.EQUIP_DESCR,M.ORG_ID
      from  MAMIS.EQUIP M
     where M.EQUIP_NO in  (  SELECT  M.EQUIP_NO  from  MAMIS.EQUIP M, MAMIS.ORG O 
    where upper(M.ORG_ID) like upper(O.ORG_ID) 
    and length(replace(translate(M.EQUIP_SUB_CLASS_ID, '0123456789', '000000000'), '0')) is null
    and upper(M.fleet_status) like 'ACTIVE'  
    and upper(M.ORG_ID) not like 'NA'  
    and to_number(m.EQUIP_SUB_CLASS_ID , '9999') 
    between 3699 and 3800  )

    Hello

    I don't see obvious errors.

    Whenever you have a problem, please post a full test script that people can run to recreate the problem and test their ideas. Include CREATE TABLE and INSERT statements for all of the tables involved and the results desired from these data. Format your code so people can read and understand.
    See the FAQ forum {message identifier: = 9360002}

    I saw a couple of things you need to know about Oracle, but none of them would cause an error "Missing key word".

    There is no point in using the LIKE operator if you do use wildcards. For example

    upper (M.fleet_status)      like 'ACTIVE'  
    

    is slower than, but otherwise equivalent to

    upper (M.fleet_status)      = 'ACTIVE'  
    

    What are you trying to do here?

    length ( replace ( translate ( M.EQUIP_SUB_CLASS_ID
                                , '0123456789'
                        , '000000000'
                        )
               , '0'
               )
           )               is null
    

    Want to see if m.equip_sub_class_id consists only of numbers, from ' 0 'to 9'?
    If so, you can simply say

    TRANSLATE ( m.equip_sub_class_id
           , 'X0123456789'
           , 'X'
           )          IS NULL
    

    Depending on your front end, you may need a sem, i-colon (;) the end of your query.

Maybe you are looking for

  • error-200279 card USB-4431 DSA

    I use USB-4431 dynamic signal acquisition card.  I have the program set out in the attachment.  I am trying to generate a control shaker random vibration signal and at the same time reading back 2 analog inputs. When I run my code with the full progr

  • processor update

    A lot of the qustions on the processors. Is it worth upgrading from a processor or just get a new PC? I have a Pavilion 2500 with a 1.4 GHz of AMD processor. How can I know what is compatible? Do I have to get a motherboard as well? Win a lot if I le

  • upgrade windows free 10

    can I get the free windows upgrade 10 if I am running windows vista Home premium?

  • Development for Curve 8520

    I installed the BlackBerry Java plug-in for Eclipse (version: 1.3.0) and I have applied for my BlackBerry Curve 8520 (with OS 5.0.0). I am able to test the application on the Simulator, but I can not compile for my cell phone because the eclipse uses

  • How many addresses e-mail can enter for a single request?

    During an application for electronic signature, it seems that I can enter several e-mail addresses.  How are they allowed?