Search with LIKE on Long datatype

I'm running a query on Oracle 10g on the 'dba_triggers' data dictionary view
I'm getting ORA-0093: inconsistence datatypes: expected NUMBER got LONG
What should I do to fix the syntax to make like words with long
SELECT *
FROM DBA_TRIGGERS T
WHERE T.trigger_body LIKE 'ABC%'
---

Use this approach
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:315118200346261192

Similar Messages

  • Formatted Search with like

    I'am tring to do a Formatted Search with this: SELECT     DISTINCT T0.Code, T0.Name
    FROM         T0 LEFT OUTER JOIN
                      ORDR ON T0.Name = ORDR.U_PDischar WHERE T0.Name Like '$[ORDR.U_PDISCHAR] %%' ORDER BY T0.Name
    but it not work any help... thanks
    Message was edited by: Juan F Vásquez

    Hi,
    This worked for me:
    SELECT DISTINCT T0.Code, T0.Name
    FROM T0 LEFT OUTER JOIN
    ORDR ON T0.Name = ORDR.U_PDischar WHERE T0.Name
    Like $[ORDR.U_PDISCHAR] + '%%'  ORDER BY T0.Name
    Not whit this same fields, but with others.
    Hope helps,
    Ibai Peñ

  • Multi line pattern search with like

    Hi All,
    I am using oracle 9i. I want to search for multi - line pattern.
    for e.g.
    update tablename
    set columnname .
    I used select * from user_source where text like '%update tablename%set columnname%' but this only seem to work if update tablename set columnname is in the same line .
    Thanks.

    Well, no wonder it does not work. USER_SOURCE stores one line of text per row, so column text by definition can not contain multi-line strings . One solution could be analytic function LEAD:
    SQL> create or replace
      2    procedure p1
      3      is
      4      begin
      5          update emp
      6             set ename = ename;
      7  end;
      8  /
    Procedure created.
    SQL> select  distinct name
      2    from  (
      3           select  s.*,
      4                   lead(text) over(partition by name order by line) next_text
      5             from  user_source s
      6          )
      7    where text like '%update emp%'
      8      and next_text like '%set ename%'
      9  /
    NAME
    P1
    SQL> SY.

  • Help with Like Prepared statement

    Hi,
    Below is a part of the code in my test application which I am using for searching the phone book.
    I want to do a pattern search with like, but for some reason, my code is not fetching me the results.
    It just gives Zero results.
    But if i use "=" it works fine.
    I have highlighted the important part
    Can you please guide me to correct this code ?
    public class DBprgm {
    ResultSet result;
    public ResultSet getSearch(String a) {
              try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:source", "sa" , "");
    Statement st = con.createStatement();
    PreparedStatement ps = con.prepareStatement("select from friends where fname like ? ");*
    *String x = "%"+a+"%";*
    *ps.setString(1, x);*
    result = ps.executeQuery();
         catch (SQLException s){
              s.printStackTrace();
         catch (ClassNotFoundException c){
              c.printStackTrace();
         return result;
    }

    Your code leaks Connections! You create a Connection and never close it, that's a pretty bad idea.
    What database are you using? From a quick glance the code seems correct (apart from the problem I mentioned above, of course).
    Edit: also, I see that you're using the JDBC-ODBC bridge. That JDBC driver has only very limited functionality and also has a few tiny bugs. Generally I'd strongly suggest that you avoid it and use your databases native JDBC drivers instead. Maybe that's also the problem here, but I can't say for sure.

  • I would like to replace my 4 cell battery in my HP Envy 17" with a much longer lasting battery

    I would like to replace my 4 cell battery in my HP Envy 17" with a much longer lasting battery

    You would get the details here:
    http://partsurfer.hp.com/search.aspx
    Wish you luck,
    Karthik
    --Say "Thanks" by clicking the Kudos (purple thumbs up icon in the lower right corner of a post)
    --Please mark the post that solves your problem as "Accepted Solution"

  • Exporting a table with Long datatype col. name

    Hello,
    I need help exporting a table, One of the column is long datatype.
    How can I do this without using Export Util?
    Is it possible.
    (If someone has a solution then PLEASE Email
    me)
    URGENT.
    Thanks.
    Pankaj Patel.

    Just wanted to find out, if you already solved this problem. I have a similar issue with long column. I am trying to sql dump a table with long column that will be imported into another database(probably using sql*load), but the spooled file puts the data from the long column in separate lines 80 char long and not on a single line. I have set the long to 64000 and linesize to 32000. Wrap is on too.
    null

  • VERY URGENT: problem in sql query with long datatype in weblogic

    I have a problem while tryind to retrieve a column value with a long datatype using servlet and oci driver and the server is weblogic5.1 .I have used prepared statement the problem comes in the
    preparedStatement.executeQuery().
    The sql Query is simple query and runs well in all cases and fails only when the long datatype column is included in the query.
    The exception that comes on the weblogic server is that :
    AN UNEXPECTED EXCEPTION DETECTED IN THE NATIVE CODE OUTSIDE THE VM.

    Did you try changing the driver then?
    Please use Oracle's thin driver instead of the oci driver.
    There are many advantages of using the type 4 driver. the first and foremost being that it does not require oracle client side software on your machine. Therefore no enteries to be made in tnsnames.ora
    The thin driver is available in a jar called classes112.zip the class which implements the thin driver is oracle.jdbc.driver.OracleDriver
    the connection string is
    jdbc:oracle:thin:@<machine name>:1521:<sid>
    please try out with the thin driver and let me know.
    regards,
    Abhishek.

  • Using Decode with "Long" datatypes

    Hi,
    I want to use a select statement in a view which uses a decode function involving a "long" datatype. But doing some raises an error "Invalid datatypes". Is there a way around?
    Anupam.

    I'm a bit puzzled as to what it is you are trying to achieve (it has been an afternoon for vague requirements). Normally the sort of data that we would want to store in a LONG is ,er, long and therefore not susceptible to use in a DECODE. But it does not matter, because we can only manipulate LONGs in PL/SQL and that does not parse DECODE statements. We will have to use IF...ELSE constructs instead.
    CREATE OR REPLACE FUNCTION l2v (pl in rowid)  RETURN VARCHAR2
    AS
        ll LONG;
        rv VARCHAR2(20);        
    BEGIN
       SELECT col1
       INTO ll
       FROM   T_LONG
       WHERE  rowid = pl;
       IF ll LIKE '%text%'
       THEN
          rv := 'yes!';
       ELSE
          rv :=  'noooo';
       END IF;
       RETURN rv;
    END;
    SQL> select l2v(rowid) from t_long;
    L2V(ROWID)
    yes!
    yes!
    SQL> You can use this function in a query. Note that it is doing a SELECT in its own right so this will not be a very performant solution if you build the view on a big table.
    Cheers, APC

  • Substr with long datatype

    i try to use the substr function with the long datatype but it gave me error ora-00932 inconsistant datatypes...........

    i had saw u r given link and try that example also but it gave me the same ora-06502
    declare
    text_c1 varchar2(32767);
    sql_cur varchar2(2000);
    begin
    sql_cur := 'select '||'text'||' from
    '||'alpine'||'.'||'letters'||' where letter_id =
    '||chr(39)||7||chr(39);
    dbms_output.put_line (sql_cur);
    execute immediate sql_cur into text_c1;
    text_c1 := substr(text_c1, 1, 4000);
    --RETURN ;                                      
    dbms_output.put_line (TEXT_C1);
    END;

  • How to get length of data on column with long datatype

    How to get length of data on column with long datatype without using pl/sql block

    ...another reason not to use LONG datatype for columns.
    Oracle advises to switch to LOB columns instead
    SQL> create table t
      2  (x long)
      3  /
    Table created.
    SQL> insert into t values (rpad ('x', 10000, 'x'))
      2  /
    1 row created.
    SQL> alter table t
      2  modify x clob
      3  /
    Table altered.
    SQL> desc t
    Name                                      Null?    Type
    X                                                  CLOB

  • Selecting From Column with Long Datatypes

    create table temp
    a long
    insert into temp values ('abc');
    commit;
    select * from temp
    where a = 'abc'
    I am getting the following error while am tring to select a = 'abc';
    ora-00997 : illegal use of LONG datatype
    How can i select values from a column with long datatypes

    insert into temp values ('abc');
    cannot (must not) work, when the column is type long (thats a numeric type!!)
    -> here you get an ora- 00911 errorcode
    that the select doesn't work then should be clear.
    mfg f.humer

  • Can I update my iPod video1 with search function like iPod video2?

    Can I update my iPod video1 with search function like iPod video2?
    how could I do?
    I have already download and installed iTunes 7.0.2
    thx

    The Search feature is currently only available on iPods which shipped with it; no publicly available download will add it to older iPods.
    (19614)

  • Since update, no keyboard clicks, apps are without sound, and searching with Duck Duck Goose is like going back to the dark ages. Yet another release not well tested.

    SSince the update, I have no keyboard clicks on my iPad, no sound on many of the apps, And searching with the Duck is like going back to the dark ages. I hate Google but at least it works! I am getting soooo tired of releases that aren't fully de-bugged before they're released.

    http://www.apple.com/feedback/
    is the proper avenue to send comments to apple

  • Creating tables with a long datatype

    I'm trying to create a table which is a copy of a table (and its contents) which has a long datatype column.
    I've got an error on the usual
    create table temp_XXXXX as select * from temp;
    statement.
    Any ideas please

    Can't be done using the CTAS syntax (see the SQL language reference for more details).
    To move LONG/LONG RAW data from one table to another will require some programming. If the LONG data is <32k you could do it in PL/SQL, otherwise you will need to do it in some other language/interface (maybe java?).

  • Extracting clob/blob/long datatypes in delimited file

    I have a few tables in database that have clob/blob/long datatypes. I need to unload this data into delimited file and reload the data into another database. I don't want to use export/import.
    Currently the code that i have can handle varchar2, number, date datatypes quite easily using sqlloader.
    The tables are not too big (hundred to 10k rows approximately) and performance is important but not crucial. The script can run for a few minutes unloading data, that is fine. Code maintenance is of higher priority with pl/sql being the preferred scripting language.
    From the sqlloader manual, i glean that use of special delimiter is important, something like <startlob> and <endlob> .
    I need ideas on how to do this.

    Hi Buddy.
    I am having same kind of Problem. I am using very similar procedure Instead of PUT_RAW I am using put line.
    Writing is not a problem after writing the image into a file I cannot open that. That means Image got corrupted. If you find out some solutions for your problem please help me
    My email id is [email protected]
    Thanks
    AJI

Maybe you are looking for