Select from table containing clob

If i try to select from table containing clob column in SQL PLus it gives error.
Tab1 contains 3 clob columns and 1 blob column
select * from tab 1;
SP2-0678: Column or attribute type can not be displayed by SQL*Plus
The same statement works in SQL Developer and I am able to see the result.
Actually i am writing the queries and they will be used by Java developers in their JSP page.
So what happens here? Can Java use these select statements or will it throw error like SQL Plus?

BLOB column content can't be displayed in SQL*Plus:
SQL> create table t_blob (b blob);
Table created.
SQL> edit
Wrote file afiedt.buf
  1* insert into t_blob values('01')
SQL> /
1 row created.
SQL> commit;
Commit complete.
SQL> select * from t_blob;
SP2-0678: Column or attribute type can not be displayed by SQL*PlusBlob and clob columns content can be processed using DBMS_LOB
package procedures and functions or using client's language (like Java)
methods. See JDBC specification.
Rgds.

Similar Messages

  • Getting an error while selecting from table having CLOB column.

    Hi All,
    I have below table created in My oracle database version Oracle Database 11g Enterprise Edition Release 11.2.0.1.0.
    CREATE TABLE my_clob -- Dummy table created
    (DataBody CLOB);
    Current Database Character set - WE8MSWIN1250.
    On the front end of my application, I have one form through which I can save/edit data in the above table. If I'm creating one new entry in the above table then it first check with existing record to avoid the duplicate entry and the this point application create the below select statement on the above table and return the error "ORA-00932: inconsistent data types: expected - got CLOB".
    I can not change the sql statement.
    SELECT * FROM my_clob WHERE databody IS NULL OR databody ='';
    Even when I run the same statement on my DB server I’m getting the same error. Shown below
    SQL> SELECT * FROM my_clob WHERE databody IS NULL OR databody ='';
    SELECT * FROM my_clob WHERE databody IS NULL OR databody =''
    ERROR at line 1:
    ORA-00932: inconsistent datatypes: expected - got CLOB
    SQL>
    Is there anything with OraOLEDB which causing this error? Please help me out to get rid of this error.
    Thanks,
    Santosh

    You cannot compare directly a CLOB column with a VARCHAR2 column. In your case you don't need to do such comparison because Oracle consider zero length strings as null values:
    SQL> create table my_clob(data int, databody clob);
    Table created.
    SQL> insert into my_clob values(1, null);
    1 row created.
    SQL> insert into my_clob values(2, '');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from my_clob where databody is null;
          DATA
    DATABODY
             1
             2About null values in Oracle, please read http://docs.oracle.com/cd/E11882_01/server.112/e26088/sql_elements005.htm#SQLRF30037.

  • The SQL statement "SELECT * FROM "SDBAH"" contains the semantics error[s]:

    Hello all together,
    actually I try to implement an user interface for using BRTools from a J2EE Application.
    I created a datasource-alias "BRTOOLS" using netweaver administrator.
    inside the implementation i execute the following code:
    DataSource ds = (DataSource) ctx.lookup("jdbc/BRTOOLS");
    Connection con = ds.getConnection();
    String query = "select * from SDBAH;";
    Statement stmt = con.createStatement();
    try {
       ResultSet rs = stmt.executeQuery(query);
    As the result I get the following message:
    The SQL statement "SELECT * FROM "SDBAH"" contains the semantics error[s]: - 1:15 - the table or view >>SDBAH<< does not exist.
    Using SQLplus or dbconsole I can see and use the table SDBAH. The table scheme is "SAPSR3DB"which is the standard scheme for J2EE.
    If I try:
    select * from SAPSR3DB.SDBAH;
    I get the same result.
    What is wrong in my constellation?
    Thank you very much in advance.
    Greetings Stephan

    Dear Yordan,
    yes I did a restart of the whole system.
    If I do a wrong lookup:
    e.g:
    DataSource ds = (DataSource) ctx.lookup("jdbc/BRToolsFailure");
    where Alias  "BRToolsFailure" does not exist, I get
    Object not found in lookup of BRToolsFailure.
    So I think that the Alias of the default data source is right and visible.
    Next try:
    I use an already existing alias "ADS" in my code and get the same message:
    The SQL statement "SELECT * FROM "SDBAH"" contains the semantics error[s]: - 1:15 - the table or view >>SDBAH<< does not exist.
    If I extend the tablename with the scheme-name "SAPSR3DB" I get the following:
    The SQL statement "SELECT * FROM "SAPSR3DB"."SDBAH"" contains the semantics error[s]: - 1:24 - the table or view >>SDBAH<< does not exist
    When I use SQLPLUS SAPSR3DB/password and call:
    select * from SDBAH;
    I get a result like expected.
    Thanks a lot,
    Stephan

  • Html form for select * from table a

    Hi all,
    I m looking for report on header/footer part from one apex pages
    which will display context from table a, like sql statement
    select * from table a, written in html.
    Is any examples in java script/html select from tables
    (and same insert into table A (...) select * from table b)
    thanks,
    Gordan

    Hello Gordan,
    Do you want to show the whole report or just some data of it?
    If it's for ex just the name and address you could create two items and have a process or computation to fill it with your select statement.
    If it's the whole report, just create the report and put it in for ex. Region 1. In your page template you can specify that Region 1 needs to come into the footer.
    Regards,
    Dimitri
    -- http://dgielis.blogspot.com/
    -- http://apex-evangelists.com/
    -- http://apexblogs.info/

  • Xmlgen.getxml("select * from table") returns null pointer exception

    I am running oracle 8i on solaris server and clinet on windows
    NT and i am this select statement
    select xmlgen.getxml("select * from table") from dual ,its
    returning null pointer exception,i have tried it through
    jdbc,even then its returning xml as
    <?xml version = '1.0'?>
    <ERROR>java.lang.NullPointerException</ERROR>
    can any body tell me the error.Help will be really appreciated.I
    need an urgent response,if some one can guide me please.
    My email is [email protected],if you can give me a quick
    response on this email,your effot will be appreciated.
    thanks
    Masood

    What is actually throwing the NullPointerException? rs.getMetaData() or table.setModel()?

  • How do I do SELECT * FROM TABLE WHERE KEY IN ({list})?

    The title says it all really.
    Is there a reasonable performant way to perform the query
    SELECT * FROM TABLE WHERE KEY IN ({list})where {list} is String []?
    I am currently creating a PreparedStatement with a for loop like this   StringBuffer sb = new StringBuffer ("SELECT * FROM TABLE WHERE ID IN (");
      for (int ii=0;ii<keys.length;ii++) {
        sb.append (keys [ii]);
        if (ii != keys.length-1) sb.append (",");
      sb.append (")");but this means that the prepared statement is created each time I call my method and so I'm not sure that the optimizer will find it easy to cope with. Is there a construction that I'm missing along the lines of SELECT * FROM TABLE WHERE KEY = ? where I can create the PreparedStatement once and just call setObject or something on it when the values in {list} change?

    but this means that the prepared statement is created
    each time I call my method and so I'm not sure that
    the optimizer will find it easy to cope with.You are right, the optimizer won't find that easy to deal with (presuming that is even relevant for your driver/database.) But most optimizers won't do anything with statements that change and that is what you are doing.
    You could create several prepared statements which have a common number of bind variables. For example 10 statements with from 1 to 10 bind values. This will work if most of the queries use those.

  • Select * from table not working with Oracle OBDC driver

    Hello,
    In our web development we have been using the MS ODBC for Oracle
    driver to connect to our Oracle db. We decided to try the
    Oracle ODBC driver because it supports the commandTimeout
    property in ASP which the MS driver does not. The problem I'm
    running into now is that all of our select * from table
    statements appear not to be working. The Oracle ODBC driver
    version we are using is ver 8.00.05.00. Is there something that
    I'm not doing properly? If I take the same select * from table
    statement and name the columns, I dont get any error. Otherwise
    I'm getting a Subscript out of range error. It seems strange to
    me that this driver would not support a select * from table
    statement (which I''m told is the case by another developer
    here).
    Is there something I'm missing?
    Thanks,
    Pete

    I'm positive I have a connection. Otherwise I wouldn't get a
    response when I name the columns instead of using *.
    There must be something else that I'm missing or doing wrong.
    I've actually been looking into alternative ODBC drivers to see
    if I have the same problems but none that I have found support
    commandTimeout.
    Any other ideas?

  • Performace Which is better ?  : Bapi inside a loop OR Select from Tables

    Hi Gurus,
    I have a report which displays purchase info records.
    If I am selecting from tables i need to use EINA, EINE, EORD and some other tables.
    There is a BAPI which gets all purchase info records specific to a vendor , material , purchasing organisation.
    QUESTION: Performace wise which is the better Approach, either selecting from tables or BAPI for Purchase info records
    Regards
    Avi.

    Whether it using BAPI or select. you need to check the performance. If you have full key for these tables EINA, EINE, EORD  then mak a select outside of the loop and within loop use READ TABLE statement with binary search. of if you want multiple records within loop then use loop insdie loop.
    Your final objective is to minimise the database hits . If you use bapi inside loop then your database hits will be more
    select from EINA
    select from EINE
    select from EORD
    loop at itab,
      read table EINA
      read table EINE
      read table EORD
    endloop

  • Special Grant to use "Select * from Table(cast..."??

    Hi,
    I've recently created the types and function to use the Table(Cast(funtion) as type)). It works fine, and gives me the correct result. I've granted execute on the types and on the function to a role that is enabled for a user, but when the user tries to use the "select * from table(cast(function) as type))", he gets a "ORA-01031: Insufficient Privileges" error message. Is there any other grant that must be given to the role, so that the user can execute the select?
    Thanks in advance!
    Daniel

    Hi Kamal,
    I'm not sure what anonymous PL/SQL block means. When I (or the user) try to run the select, I enter all the information, i.e., the owners for the type and function: "select * from table(cast(a.my_function(my_argument) as a.my_type))". I'm trying to use SQLPlus at this time, and I have Oracle 8i.
    I didn't to explicitly grant execute to the user because that would go against some rules I have to follow... I'll se if I give it a try though!
    Thanks!

  • Expression Framework / SELECT * FROM TABLE(CAST(...

    Hello!
    Is it possible to build the following with Toplink Expression Framework?
    Example:
    CREATE TYPE TY_OB_TEST AS OBJECT
    ( SYSTOP_NR NUMBER(5,0)
    SYS_NR NUMBER(5,0)
    IM_SYS_NAME VARCHAR2(80) ) ;
    CREATE TYPE TY_TB_TEST AS TABLE OF TY_OB_TEST;
    Package1.FUNCTION1 returns Type TY_TB_TEST.
    SQL:
    select * from TABLE(CAST(PACKAGE1.FUNCTION1(42)) AS TY_TB_TEST ));
    thank you!
    Harald.

    Nope, just use SQL.
    - Don

  • Insert into table a (select * from table b) - need pk?

    Hi there.
    I'm going to insert into table FINAL (select * from table STAGING) - same structure but in STAGING the ID column has nulls.
    Do I need to provide the ID (primary key) for table FINAL or will it get created based on sequence/trigger?
    If I were doing this in a loop I'd get the next val from the sequence but on a simple insert, I'm curious.
    thanks!

    hmm.. what is ?
    it didn't like it.
    Error(11,4): PLS-00103: Encountered the symbol "[" when expecting one of the following:     begin case declare exit for goto if loop mod null pragma    raise return select update while with <an identifier>    <a double-quoted delimited-identifier> <a bind variable> <<    close current delete fetch lock insert open rollback    savepoint set sql execute commit forall merge    <a single-quoted SQL string> pipe
    9i, sqldeveloper                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Select * from table as of Scn fails in powercenter

    Hi all, I have written the below query in SQL override of a Powercenter mapping. This fails with 'FROM keyword not found where expected' error. Can you please suggest how else I can fetch last committed data from my source?Select * from table AS OF SCN <Scn no>

    Hi All, I have multiple flat files which i need to load in a single table.I did that using indirect option at session level.But need to dig out on how to populate substring of header in name column in target table. i have two columns Id and Name. in all input file I have only one column 'id' with header like H|ABCD|Date. I need to populate target like below example. File 1                                    File2     H|ABCD|Date.                      H|EFGH|Date.1                                            42                                            5  3                                            6 Target tale: Id    Name1     ABCD2     ABCD3     ABCD4     EFGH5     EFGH6     EFGH can anyone help on what should be the logic to get this data in a table in informatica.

  • How to achieve that "SELECT * FROM table WHERE age BETWEEN 18 AND 23 AND n"

    How to achieve the SQL like that "SELECT * FROM table WHERE age BETWEEN 18 AND 23 AND name = 'Will' " with BDB C-API
    The primary key in the primary database is 'age' ,and the secondary key in the secondary index is 'name' ,in a lot of examples ,there are all simple , but how to do that complex one.thx~

    but this means that the prepared statement is created
    each time I call my method and so I'm not sure that
    the optimizer will find it easy to cope with.You are right, the optimizer won't find that easy to deal with (presuming that is even relevant for your driver/database.) But most optimizers won't do anything with statements that change and that is what you are doing.
    You could create several prepared statements which have a common number of bind variables. For example 10 statements with from 1 to 10 bind values. This will work if most of the queries use those.

  • Can I simulate SELECT * FROM TABLE WHERE ROW IN (1111,2222) using SQLJ

    I have a fct like
    public void fct(String inStr) {
    String str = "SELECT * FROM TABLE WHERE ROW IN" + inStr;
    // then I xecute the query using JDBC connection
    But I want to do the same thisn using SQLJ like:
    public void fct(String inStr) {
    #sql [nctx] iter = { SELECT * FROM TABLE WHERE ROW IN :inStr}
    When I run the second version and give a parameter like "(1111,2222)" it gives
    ORA-01722: invalid number error.
    Is there a way to give parameters to in clauses of SQLJ statements.
    Thanks in regard.

    This is a SQLJ FAQ. You can find the FAQ at:
    http://technet.oracle.com/tech/java/sqlj_jdbc/htdocs/faq.html
    Your question is addressed in the following section:
    http://technet.oracle.com/tech/java/sqlj_jdbc/htdocs/faq.html#variablesizevaluelist
    Note that that section has a typo. The lines:
    ? // populate mynumbers
    #sql { SELECT * FROM tab WHERE col in (:(a[0]),:(a[1]),?};
    should read:
    ... // populate mynumbers
    #sql { SELECT * FROM tab WHERE col in (:(a[0]),:(a[1]),...};
    By the way, with the next release SQLJ will support pasting in of dynamic SQL fragments. Then you'll be able to do pretty much what you are trying to accomplish here (albeit with slightly different syntax). Until then you'd have to use the workarounds from the FAQ.

  • Reason behind this query ,SELECT * FROM table WHERE 1 0

    HEllo,
    I would like to know the reason behind using this query ,
    SELECT * FROM <table> WHERE 1 < 0
    before executing the actual SQL query.
    Is there any special reason or the JDBC receiver side is configured like that.
    Is there any option to overcome this process like, can we remove this option or stop using this.
    Why the JDBC adapter basically sending this query on the DB?
    Thanks,
    Soorya,

    Hi,
    if you run this query, you wont be able to see any records of the table.
    SELECT * FROM <table> WHERE 1 < 0
    if you run this query you will see all records
    SELECT * FROM <table> WHERE 0 < 1
    same with SELECT * FROM <table> WHERE 1=1
    So you can check this out that whats happening in your code before executing actual query. just try to co-relate.
    regards
    Aashish Sinha
    PS : reward points if helpful

Maybe you are looking for