Problem in SQL Query Execution

Hi,
I have tried to Insert Data in Table (Using MySQL) , and as far as i know there is no error in my program and it's executing well with out showing any error and throwing exception. Database connected successfully. I have given the full code here. Help me to execute this program as soon as possible .Thanks in advance.
Code:_
public class MysqlConnect{
public static void main(String[] args) {
System.out.println("MySQL Connect Example.");
Connection conn = null;
String url = "jdbc:mysql://localhost:3306/";
String dbName = "demo";
String driver = "com.mysql.jdbc.Driver";
String userName = "root";
String password = "root";
try {
Class.forName(driver);
conn= DriverManager.getConnection(url+dbName,userName,password);
try{
Statement st = conn.createStatement();
System.out.println("Connection Established");
int value = st.executeUpdate("INSERT INTO demo.login VALUES("+17+","+"'G'"+","+"'GG'"+","+70+")");
System.out.println("1 Row Inserted"+ value);
conn.close();
System.out.println("Disconnected from database");
catch(SQLException Se)
System.out.println("Exception::SQL Statement Not Executed");
} catch (Exception e) {
e.printStackTrace();
Regards,
Prabu
Edited by: [email protected] on Apr 17, 2008 11:10 AM
Edited by: [email protected] on Apr 17, 2008 11:13 AM

I think there is some problem in sql statement u have written code as shown bollow
st.executeUpdate("INSERT INTO demo.login VALUES("17",""'G'"",""'GG'"","70")");
i think the proper statement is as shown bellow
st.executeUpdate("INSERT INTO demo.login VALUES('17','G','GG','70')");
(if all u have 4 columns in u r table of type varchar)
and if this is not solution for ur problem let me know the table structure , i mean columns and datatype of columns.

Similar Messages

  • Problems in SQL Query

    Dear All,
    I am having some problem in SQL query. I am trying to get total sum of one inventory using the following query it works fine:
    sum(case when mt.transaction_quantity > 0 then (mt.transaction_quantity) else 0 end) "TOT_IN"
    ,sum(case when mt.transaction_quantity >= 0 then 0 else (abs(mt.transaction_quantity)) end) "TOT_OUT"
    But when I breakup the total sum into monthly breakup it fails to return the correct some could any one help what is wrong in the following query which is returning incorrect monthly sum. Following is that query. Your help in this regard would highly be appreciated.
    sum(case when mt.transaction_quantity > 0 then (decode (floor (floor (to_date('17-MAR-2009')- mt.transaction_date) / 30), 0, mt.transaction_quantity, null)) else 0 end) "MONTH1_IN"
    ,sum(case when mt.transaction_quantity >= 0 then 0 else (decode (floor (floor (to_date('17-MAR-2009')- mt.transaction_date) / 30), 0, abs(mt.transaction_quantity), null)) end) "MONTH1_OUT"
    Thanks

    Hi,
    Sorry, I don't really understand what you want.
    Whenever you have a question, it helps to post:
    (1) The version of Oracle (and any other relevant software) you're using
    (2) A little sample data (just enough to show what the problem is) from all the relevant tables
    (3) The results you want from that data
    (4) Your best attempt so far (formatted)
    (5) The full error message (if any), including line number
    Executable SQL statements (like "CREATE TABLE AS ..." or "INSERT ..." statements) are best for (2).
    If you can present your problem using commonly available tables (for example, tables in scott schema, or views in the data dictionary), then you can omit (2).
    Formatted tabular output is okay for (3). Type these 6 characters
    {code}
    (small letters only, inside curly brackets) before and after the tabular text, to preserve spacing.
    What exactly do you mean by "monthly breakup"?
    If you want separate figures for each calendar month, Blushadow's suggestion (TRUNC (mt.transaction_date, 'MM')) is what you want.
    If you want separate figures for the last 30 days before today, then something like what you posted ("FLOOR ((:target_date - mt.transaction_date) / 30)": the extra FLOOR doesn't help any) should work, so if you ran the query on March 17, 2009, the first "month" would be February 16 through March 17.
    In a CASE statement, there's rarely any need to use DECODE. The following is equivalent to the last line of code you posted:
    ,       SUM ( CASE
                WHEN  mt.transaction_quantity >= 0
                THEN  0
                WHEN  TO_DATE ('17-MAR-2009', 'DD-MON-YYYY') - mt.transaction_date
                        BETWEEN 0
                        AND     29.99999  -- 30 days minus a fraction of a second
                THEN  ABS (mt.transaction_quantity)
               END
             )          AS month1_outDon't you find this easier to understand (and debug)?

  • 30EA4 Problem using MySql: "Query execution was interrupted"

    Any query executes the first time but a second execution always causes the error "Query execution was interrupted"
    (Update: I just installed the prodcution release of sql delveloper 2.1.1.64.45 and have the same issue)
    I am using MySql driver 5.1.15
    Others seem to have a similar issue and I tries the older JDBC drivers but the 5.0.4 cause the connection to hang and the 5.0.8 caused the same problem "Query execution was interrupted"
    Vendor Code 1317 Query execution was interrupted MySQL
    I am using Windows7 64 bit (sql developer and jdk are 32 bit), see below
    MySql version
    -------------------------------------------------------+
    | Variable_name | Value |
    -------------------------------------------------------+
    | innodb_version | 1.1.4 |
    | protocol_version | 10 |
    | slave_type_conversions | |
    | version | 5.5.8 |
    | version_comment | MySQL Community Server (GPL) |
    | version_compile_machine | x86 |
    | version_compile_os | Win64 |
    -------------------------------------------------------+
    SQL Develper Info:
    About
    Oracle SQL Developer 3.0.03
    Version 3.0.03
    Build MAIN-03.97
    Copyright © 2005, 2011 Oracle. All Rights Reserved.
    IDE Version: 11.1.1.4.37.59.36
    Product ID: oracle.sqldeveloper
    Product Version: 11.1.2.03.97
    Version
    Component     Version
    =========     =======
    Java(TM) Platform     1.6.0_24
    Oracle IDE     3.0.03.97
    Versioning Support     3.0.03.97
    Properties
    Name     Value
    ====     =====
    awt.toolkit     sun.awt.windows.WToolkit
    class.load.environment     oracle.ide.boot.IdeClassLoadEnvironment
    class.load.log.level     CONFIG
    class.transfer     delegate
    file.encoding     Cp1252
    file.encoding.pkg     sun.io
    file.separator     \
    http.agent     Mozilla/5.0 (Java 1.6.0_24; Windows 7 6.1 x86; en_IE) ICEbrowser/v6_1_3
    ice.browser.forcegc     false
    ice.pilots.html4.ignoreNonGenericFonts     true
    ice.pilots.html4.tileOptThreshold     0
    ide.AssertTracingDisabled     true
    ide.bootstrap.start     7381246437329
    ide.build     MAIN-03.97
    ide.conf     C:\Program Files (x86)\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf
    ide.config_pathname     C:\Program Files (x86)\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf
    ide.debugbuild     false
    ide.devbuild     false
    ide.extension.search.path     sqldeveloper/extensions:jdev/extensions:ide/extensions
    ide.firstrun     true
    ide.java.minversion     1.6.0_04
    ide.launcherProcessId     2204
    ide.main.class     oracle.ide.boot.IdeLauncher
    ide.patches.dir     ide/lib/patches
    ide.pref.dir     C:\Users\mark\AppData\Roaming\SQL Developer
    ide.pref.dir.base     C:\Users\mark\AppData\Roaming
    ide.product     oracle.sqldeveloper
    ide.shell.enableFileTypeAssociation     C:\Program Files (x86)\sqldeveloper\sqldeveloper.exe
    ide.splash.screen     splash.gif
    ide.startingArg0     C:\Program Files (x86)\sqldeveloper\sqldeveloper.exe
    ide.startingcwd     C:\Program Files (x86)\sqldeveloper
    ide.user.dir     C:\Users\mark\AppData\Roaming\SQL Developer
    ide.user.dir.var     IDE_USER_DIR
    ide.vcs.noapplications     true
    ide.work.dir     C:\Users\mark\Documents\SQL Developer
    ide.work.dir.base     C:\Users\mark\Documents
    ilog.propagatesPropertyEditors     false
    java.awt.graphicsenv     sun.awt.Win32GraphicsEnvironment
    java.awt.printerjob     sun.awt.windows.WPrinterJob
    java.class.path     ..\..\ide\lib\ide-boot.jar
    java.class.version     50.0
    java.endorsed.dirs     C:\Program Files (x86)\Java\jdk1.6.0_24\jre\lib\endorsed
    java.ext.dirs     C:\Program Files (x86)\Java\jdk1.6.0_24\jre\lib\ext;C:\Windows\Sun\Java\lib\ext
    java.home     C:\Program Files (x86)\Java\jdk1.6.0_24\jre
    java.io.tmpdir     C:\Users\mark\AppData\Local\Temp\
    java.library.path     C:\Program Files (x86)\sqldeveloper;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files\TortoiseSVN\bin;C:\Program Files\SlikSvn\bin\;C:\Program Files (x86)\Java\jdk1.6.0_24\bin;C:\Program Files (x86)\OpenVPN\bin;C:\tools\apache-maven-3.0.2\bin;C:\tools\mysql-5.5.8-winx64\bin
    java.naming.factory.initial     oracle.javatools.jndi.LocalInitialContextFactory
    java.protocol.handler.pkgs     oracle.jdevimpl.handler
    java.runtime.name     Java(TM) SE Runtime Environment
    java.runtime.version     1.6.0_24-b07
    java.specification.name     Java Platform API Specification
    java.specification.vendor     Sun Microsystems Inc.
    java.specification.version     1.6
    java.util.logging.config.file     logging.conf
    java.vendor     Sun Microsystems Inc.
    java.vendor.url     http://java.sun.com/
    java.vendor.url.bug     http://java.sun.com/cgi-bin/bugreport.cgi
    java.version     1.6.0_24
    java.vm.info     mixed mode
    java.vm.name     Java HotSpot(TM) Client VM
    java.vm.specification.name     Java Virtual Machine Specification
    java.vm.specification.vendor     Sun Microsystems Inc.
    java.vm.specification.version     1.0
    java.vm.vendor     Sun Microsystems Inc.
    java.vm.version     19.1-b02
    jdbc.library     /C:/Program Files (x86)/sqldeveloper/jdbc/lib/ojdbc6.jar
    line.separator     \r\n
    log.file.name     ..//log/datamodeler.log
    oracle.home     C:\Program Files (x86)\sqldeveloper
    oracle.ide.util.AddinPolicyUtils.OVERRIDE_FLAG     true
    oracle.jdbc.mapDateToTimestamp     false
    oracle.translated.locales     de,es,fr,it,ja,ko,pt_BR,zh_CN,zh_TW
    oracle.xdkjava.compatibility.version     9.0.4
    orai18n.library     /C:/Program Files (x86)/sqldeveloper/jlib/orai18n.jar
    os.arch     x86
    os.name     Windows 7
    os.version     6.1
    path.separator     ;
    reserved_filenames     con,aux,prn,lpt1,lpt2,lpt3,lpt4,lpt5,lpt6,lpt7,lpt8,lpt9,com1,com2,com3,com4,com5,com6,com7,com8,com9,conin$,conout,conout$
    sqldev.debug     false
    sun.arch.data.model     32
    sun.boot.class.path     C:\Program Files (x86)\Java\jdk1.6.0_24\jre\lib\resources.jar;C:\Program Files (x86)\Java\jdk1.6.0_24\jre\lib\rt.jar;C:\Program Files (x86)\Java\jdk1.6.0_24\jre\lib\sunrsasign.jar;C:\Program Files (x86)\Java\jdk1.6.0_24\jre\lib\jsse.jar;C:\Program Files (x86)\Java\jdk1.6.0_24\jre\lib\jce.jar;C:\Program Files (x86)\Java\jdk1.6.0_24\jre\lib\charsets.jar;C:\Program Files (x86)\Java\jdk1.6.0_24\jre\lib\modules\jdk.boot.jar;C:\Program Files (x86)\Java\jdk1.6.0_24\jre\classes
    sun.boot.library.path     C:\Program Files (x86)\Java\jdk1.6.0_24\jre\bin
    sun.cpu.endian     little
    sun.cpu.isalist     pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86
    sun.desktop     windows
    sun.io.unicode.encoding     UnicodeLittle
    sun.java2d.ddoffscreen     false
    sun.jnu.encoding     Cp1252
    sun.management.compiler     HotSpot Client Compiler
    sun.os.patch.level     
    svnkit.sax.useDefault     true
    user.country     IE
    user.dir     C:\Program Files (x86)\sqldeveloper\sqldeveloper\bin
    user.home     C:\Users\mark
    user.language     en
    user.name     mark
    user.timezone     Europe/Paris
    user.variant     
    windows.shell.font.languages     
    Extensions
    Name     Identifier     Version     Status
    ====     ==========     =======     ======
    Check For Updates     oracle.ide.webupdate     11.1.1.4.37.59.36     Loaded
    Code Editor     oracle.ide.ceditor     11.1.1.4.37.59.36     Loaded
    Component Palette     oracle.ide.palette1     11.1.1.4.37.59.36     Loaded
    Data Miner     oracle.dmt.dataminer     11.2.0.1.9.96     Loaded
    Database Connection Support     oracle.jdeveloper.db.connection     11.1.1.4.37.59.36     Loaded
    Database Object Explorers     oracle.ide.db.explorer     11.1.1.4.37.59.36     Loaded
    Database UI     oracle.ide.db     11.1.1.4.37.59.36     Loaded
    Diagram Framework     oracle.diagram     11.1.1.4.37.59.36     Loaded
    Diagram Javadoc Extension     oracle.diagram.javadoc     11.1.1.4.37.59.36     Loaded
    Diagram Thumbnail     oracle.diagram.thumbnail     11.1.1.4.37.59.36     Loaded
    Diff/Merge     oracle.ide.diffmerge     11.1.1.4.37.59.36     Loaded
    Extended IDE Platform     oracle.javacore     11.1.1.4.37.59.36     Loaded
    External Tools     oracle.ide.externaltools     11.1.1.4.37.59.36     Loaded
    File Support     oracle.ide.files     11.1.1.4.37.59.36     Loaded
    Help System     oracle.ide.help     11.1.1.4.37.59.36     Loaded
    History Support     oracle.jdeveloper.history     11.1.1.4.37.59.36     Loaded
    Import/Export Support     oracle.ide.importexport     11.1.1.4.37.59.36     Loaded
    Index Migrator support     oracle.ideimpl.indexing-migrator     11.1.1.4.37.59.36     Loaded
    JDeveloper Runner     oracle.jdeveloper.runner     11.1.1.4.37.59.36     Loaded
    JViews Registration Addin     oracle.diagram.registration     11.1.1.4.37.59.36     Loaded
    Log Window     oracle.ide.log     11.1.1.4.37.59.36     Loaded
    Mac OS X Adapter     oracle.ideimpl.apple     11.1.1.4.37.59.36     Loaded
    Navigator     oracle.ide.navigator     11.1.1.4.37.59.36     Loaded
    Object Gallery     oracle.ide.gallery     11.1.1.4.37.59.36     Loaded
    Oracle IDE     oracle.ide     11.1.1.4.37.59.36     Loaded
    Oracle SQL Developer     oracle.sqldeveloper     11.1.2.03.97     Loaded
    Oracle SQL Developer - 3rd Party Database Browsers     oracle.sqldeveloper.thirdparty.browsers     11.1.1.03.97     Loaded
    Oracle SQL Developer - DBA Navigator     oracle.sqldeveloper.dbanavigator     11.1.1.03.97     Loaded
    Oracle SQL Developer - Extras     oracle.sqldeveloper.extras     1.1.1.03.97     Loaded
    Oracle SQL Developer - File Navigator     oracle.sqldeveloper.filenavigator     11.1.1.03.97     Loaded
    Oracle SQL Developer - Migrations Antlr3 Translator     oracle.sqldeveloper.migration.translation.core_antlr3     11.1.1.03.97     Loaded
    Oracle SQL Developer - Migrations Application Migration     oracle.sqldeveloper.migration.application     11.1.1.03.97     Loaded
    Oracle SQL Developer - Migrations Core     oracle.sqldeveloper.migration     11.1.1.03.97     Loaded
    Oracle SQL Developer - Migrations DB2     oracle.sqldeveloper.migration.db2     11.1.1.03.97     Loaded
    Oracle SQL Developer - Migrations DB2 Translator     oracle.sqldeveloper.migration.translation.db2     11.1.1.03.97     Loaded
    Oracle SQL Developer - Migrations Microsoft Access     oracle.sqldeveloper.migration.msaccess     11.1.1.03.97     Loaded
    Oracle SQL Developer - Migrations Microsoft SQL Server     oracle.sqldeveloper.migration.sqlserver     11.1.1.03.97     Loaded
    Oracle SQL Developer - Migrations MySQL     oracle.sqldeveloper.migration.mysql     11.1.1.03.97     Loaded
    Oracle SQL Developer - Migrations Sybase Adaptive Server     oracle.sqldeveloper.migration.sybase     11.1.1.03.97     Loaded
    Oracle SQL Developer - Migrations T-SQL Translator     oracle.sqldeveloper.migration.translation.core     11.1.1.03.97     Loaded
    Oracle SQL Developer - Migrations Teradata     oracle.sqldeveloper.migration.teradata     11.1.1.03.97     Loaded
    Oracle SQL Developer - Migrations Translation UI     oracle.sqldeveloper.migration.translation.gui     11.1.1.03.97     Loaded
    Oracle SQL Developer - Object Viewer     oracle.sqldeveloper.oviewer     11.1.1.03.97     Loaded
    Oracle SQL Developer - Real Time SQL Monitoring     oracle.sqldeveloper.sqlmonitor     11.1.1.03.97     Loaded
    Oracle SQL Developer - Reports     oracle.sqldeveloper.report     11.1.1.03.97     Loaded
    Oracle SQL Developer - Scheduler     oracle.sqldeveloper.scheduler     11.1.1.03.97     Loaded
    Oracle SQL Developer - Schema Browser     oracle.sqldeveloper.schemabrowser     11.1.1.03.97     Loaded
    Oracle SQL Developer - SearchBar     oracle.sqldeveloper.searchbar     11.1.1.03.97     Loaded
    Oracle SQL Developer - Snippet     oracle.sqldeveloper.snippet     11.1.1.03.97     Loaded
    Oracle SQL Developer - Spatial     oracle.sqldeveloper.spatial     11.1.1.03.97     Loaded
    Oracle SQL Developer - TimesTen     oracle.sqldeveloper.timesten     2.0.0.03.97     Loaded
    Oracle SQL Developer - Tuning     oracle.sqldeveloper.tuning     11.1.1.03.97     Loaded
    Oracle SQL Developer - Unit Test     oracle.sqldeveloper.unit_test     11.1.1.03.97     Loaded
    Oracle SQL Developer - User Extensions Support     oracle.sqldeveloper.userextensions     11.1.1.03.97     Loaded
    Oracle SQL Developer - Worksheet v2     oracle.sqldeveloper.worksheet     11.1.1.03.97     Loaded
    Oracle SQL Developer - XML Schema     oracle.sqldeveloper.xmlschema     11.1.1.03.97     Loaded
    Oracle SQL Developer Data Modeler     oracle.datamodeler     3.0.0.665     Loaded
    Oracle SQL Developer Data Modeler - Reports     oracle.sqldeveloper.datamodeler_reports     11.1.1.03.97     Loaded
    PROBE Debugger     oracle.jdeveloper.db.debug.probe     11.1.1.4.37.59.36     Loaded
    Peek     oracle.ide.peek     11.1.1.4.37.59.36     Loaded
    Persistent Storage     oracle.ide.persistence     11.1.1.4.37.59.36     Loaded
    Property Inspector     oracle.ide.inspector     11.1.1.4.37.59.36     Loaded
    QuickDiff     oracle.ide.quickdiff     11.1.1.4.37.59.36     Loaded
    Replace With     oracle.ide.replace     11.1.1.4.37.59.36     Loaded
    Runner     oracle.ide.runner     11.1.1.4.37.59.36     Loaded
    VHV     oracle.ide.vhv     11.1.1.4.37.59.36     Loaded
    Versioning Support     oracle.jdeveloper.vcs     11.1.1.4.37.59.36     Loaded
    Versioning Support for Subversion     oracle.jdeveloper.subversion     11.1.1.4.37.59.36     Loaded
    Virtual File System     oracle.ide.vfs     11.1.1.4.37.59.36     Loaded
    Web Browser and Proxy     oracle.ide.webbrowser     11.1.1.4.37.59.36     Loaded
    XML Editing Framework IDE Extension     oracle.ide.xmlef     11.1.1.4.37.59.36     Loaded
    audit     oracle.ide.audit     11.1.1.4.37.59.36     Loaded
    classpath: protocol handler extension     oracle.jdeveloper.classpath     11.1.1.0.0     Loaded
    jdukshare     oracle.bm.jdukshare     11.1.1.4.37.59.36     Loaded
    mof-xmi     oracle.mof.xmi     11.1.1.4.37.59.36     Loaded
    oracle.ide.dependency     oracle.ide.dependency     11.1.1.4.37.59.36     Loaded
    oracle.ide.indexing     oracle.ide.indexing     11.1.1.4.37.59.36     Loaded
    palette2     oracle.ide.palette2     11.1.1.4.37.59.36     Loaded
    status     oracle.ide.status     11.1.1.4.37.59.36     Loaded
    Edited by: user501466 on 19-Mar-2011 03:21

    Hi Dermot,
    Some clarification.
    I have tried these 3 drivers below with the following results:
    5.0.4 First Query succeeds, Second gives error "Unknown prepared statement handler (131072) given to mysqld_stmt_execute". At this point I can exit SQL Developer. If I run it a third time then the query does not complete and any attempt to exit SQL Developer results in "Connection is currently busy, try again?" and ultimately I have to kill it.
    5.0.8 First Query succeeds, Second Query fails with Query execution was interrupted. Subsequent queries give the same result.
    5.1.15 Same as 5.0.8
    I tried your suggestion, removed the driver, restarted, installed the 5.0.4 driver and restated and ran the test,
    (I added a drop table so I could run it repeatedly) and it works repeatedly if I choose "Run as script F5".
    DROP TABLE table1;
    CREATE TABLE table1(col1 int);
    INSERT INTO Table1 values(1);
    SELECT * FROM table1;
    SELECT * FROM table1;
    But If I execute the query "select * from table1" using "Run Statement Ctrl-Enter" twice then I get problem behaviour as described above.
    I looked in the logfile for SQLDeveloper but it was empty.
    I also tried creating a new database as root and connecting as root (same result)
    I also tried the NightlyBuild of 5.1 and 6.0 but gave the same result as 5.1.5.
    I have two other tools for accessing MySql: Toad and MySql workbench, both of which work but I've used SQL Developer with Oracle for some years and would like to keep using it.
    I just tried connecting to a remote MySQL database and that seems to work without problems.
    I'm thinking it may be related to some incompatibility between SQLDeveloper and the MySQL installed locally.
    I'll try another version....
    Ok I installed a 32 bit version of MySql 5.5.10. I thought things were working but now I still get the problem but it is much more intermittent.
    Now I can get it by modifying the query ie.
    select * from table1; (works repeatedly untill followed by a change to the query)
    select * from table1 order by col1; (fails)
    Another case
    select * from table1 order by col1; (works repeatedly)
    select * from table1 order by col1 asc; (fails first time)
    very weird...
    Edited by: user501466 on 26-Mar-2011 06:19

  • Problem with SQL Query Action

    Hi,
    I have a problem in using transactions with SQL Querys.
    I developed a TA based an SQL Querys against a MS SQL Server by using the jtds driver.
    After execution of the sql query I iterate through the result data by using the repeater action on the xMII XML results of the query. Using the jtds driver all table and field names are in lower case letters.
    Now I changed the data server to test it with oracle to an oracle database by using the oracle jdbc driver. The database and tables on both Oracle and MS are created with the same sql script.
    The oracle driver returns table and field names in only capital letters. So the created transaction can not be used. Because it for example accesses the node "type" in the XML structure which is fine for jtds. But when oracle is used, the node has the name "TYPE", so the TA tries to use node type but there is only node TYPE that causes the TA to run into an error.
    Anyone has an idea how to avoid / solve this problem?
    Regards
    Timo

    That's exactly what I used as solution now.
    Instead of doing
    "select fieldname from tablename"
    I do now
    "select fieldname as "fieldname" from tablename"
    So both in Oracle and Microsoft SQL Server the returned field names of the query are in lower case letters.
    Thank you for your help.
    Regards Timo

  • Problem with SQL query region source containing OLAP clauses

    Hi team,
    I believe I found a bug when HTMLDB validates the SQL Query in a report region.
    My query includes an ORDER BY clause within a windowing function and HTMLDB refuses to accept the source owing to the presence of the ORDER BY and the column heading sort preference.
    Clearly the order-by in a window function has little to do with the column heading sort, but this error prevents me from updating the conditional display item in the page definition.
    Note also that the page was imported smoothly from the 1.5 version, so probably the region source is not checked at that time, but only when you update it "manually".
    So, in the end, if I don't change anything the page works because the sql query is assumed to be correct but unfortunately I need to change the condition and I cannot.
    The problem shows up in page 126 of app 21670, SQL query region.
    Bye,
    Flavio
    PS: may be I can work around this by using the pl/sql function returning the sql query.

    Flavio,
    We're aware of this problem. For now, your workaround is described in this thread:
    HTMLDB 1.6 and "order by" in analytic functions
    Sergio

  • Problem in sql query because of order by clause

    Hi All,
    I am facing a one problem in my one sql query.I am using Oracle 10gR2.
    Query is given below:
    SELECT t1.ename
            FROM T1, T2
           WHERE T1.EMPNO = 1234
             AND T1.ACCOUNTNO = T2.ACCOUNTNO
             AND T1.SEQ = T2.SEQ
           ORDER BY T2.SEQThe Plan of the query is :
    | Id  | Operation                     | Name                 | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT              |                      |     2 |   218 | 11716   (1)| 00:00:41 |
    |*  1 |  TABLE ACCESS BY INDEX ROWID  | T1                   |     1 |    89 |     1   (0)| 00:00:01 |
    |   2 |   NESTED LOOPS                |                      |     2 |   218 | 11716   (1)| 00:00:41 |
    |*  3 |    TABLE ACCESS BY INDEX ROWID| T2                   |     2 |    40 | 11715   (1)| 00:00:41 |
    |   4 |     INDEX FULL SCAN           | PK_T2_SEQ            | 58752 |       |   122   (5)| 00:00:01 |
    |*  5 |    INDEX RANGE SCAN           | FK_ACCOUNTNO         |     3 |       |     0   (0)| 00:00:01 |
    ----------------------------------------------------------------------------------------------------Now i want to reduce the time of this query.
    If i am removing Order by clause from query than performance of the query is totally perfect but with order by clause its taking a time.
    I have already set SORT_AREA_SIZE but still nothing is improving.
    Welcome and thanks for your suggestions.
    Thanks,
    Edited by: BluShadow on 23-Jun-2011 07:55
    added {noformat}{noformat} tags and formatted explain plan to make it readable.  Please see {message:id=9360002} for details on how to post code and data                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi,
    There are a couple of things I do not understand.
    1. Why don't you put {noformat}{noformat} around your code, it makes it so much easier to read, especially your explain plan
    2. You claim that the ORDER BY is problematic compared to no order by. Then why do you choose to post only one plan?
    3. It is hard to understand how your tables relate, and which indexes you have and which you don't.
    - PK_T2_SEQ, does this mean that SEQ alone is primary key of T2?
    - If SEQ is primary key of T2, why do you join on accountno, seq and not just seq?
    - If SEQ is primary key of T2 one of the tables is denormalized.
    4. FK_ACCOUNTNO, is this an index on accountno, alone?
    - Or is this AccountNo, Seq?
    5. Is there no index on T1.EMPNO?
    Above could of course just be a case of my not understanding the names of your indexes.
    So, here are my guesses:
    Above plan is for the ORDER BY query. That means the optimizer, has chosen to full scan PK_T2_SEQ, since data is then read according to the ORDER BY.
    (This could be a bad choice)I
    You could try and order by t1.seq, instead. Result should be the same.
    Regards
    Peter                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Problem with SQL Query

    I am a java developer and having problem writing a simple sql query. Any help is highly appreciated.
    USER_LOGIN
    CREATE TABLE USER_LOGIN
    EMAIL_ADDRESS VARCHAR2(30 BYTE) NOT NULL,
    PASSWORD VARCHAR2(30 BYTE) NOT NULL,
    LAST_NAME VARCHAR2(20 BYTE),
    FIRST_NAME VARCHAR2(20 BYTE),
    STATUS VARCHAR2(1 BYTE)
    DATA:
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, klein, james, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, cullen, sarah, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, cole, kling, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, stein, amy, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, stone, edward, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, simps, harris, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, brown, steven, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, kumar, vikram, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, gray, susan, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, green, monica, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, tile, eric, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, parder, sergey, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, fossil, bill, 1);
    This is just the sample data. In production I have around 30,000 records and I have a requirement to retrieve the records in a batch of 5,000 at a time.
    For testing on the above 10 records, I need to retrieve 3 at a time.
    For instance: From my java servlet phase listener, I am going to run a loop, inside which I make a database call. For the first time inside the loop, it has to fetech records 1 to 3, the second time 4 to 6, the third time 7 to 9 and finally the last record. I will be able to pass two parameters for start and end row indexes.
    I have come up with the following query...
    SELECT U.EMAIL_ADDRESS,
    U.PASSWORD,
    U.LAST_NAME,
    U.FIRST_NAME,
    U.STATUS
    FROM USER_LOGIN U
    WHERE ROWNUM > /*start index*/ AND ROWNUM < /*end index*/
    ORDER BY EMAIL_ADDRESS
    But the results are not as expected. It works well for the first batch where start index is 0 and end index is 4, but it returns zero records when start index is 3 and end index is 7. Any help on this would be highly appreciated
    Thanks.

    Saludos Sirgeneral,
    This is one of the technique you should be working on
    SELECT * FROM(
    SELECT ROWNUM rn,e.* FROM emp e
    ORDER BY empno)
    WHERE rn BETWEEN &st_range AND &end_rangeIn your case the query would be
    select * from(
    SELECT rownum en, U.EMAIL_ADDRESS,
    U.PASSWORD,
    U.LAST_NAME,
    U.FIRST_NAME,
    U.STATUS
    FROM USER_LOGIN U
    ORDER BY EMAIL_ADDRESS)
    where rn between 4 and 6); --second set for exampleCheers!!!
    Bhushan

  • 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.

  • Database Link Problem-Peculiar SQL stmt execution.. Please help

    Hi all,
    This is a strange problem i'm facing while running the following query.
    This query is run on the local machine which is fetching data from another remote database. All the functions included also are fetching data from the remote database through db links.
    I know lot of db links are into picture, but the requirement is like this only.
    SQL :SELECT billing_extract_subscriber.get_external_id_types_descr
    (ciem.external_id_type,
    'ra_delhi'
    ) AS "EXTERNAL_ID_TYPE",
    ciem.external_id, ciem.subscr_no customer_equip_map_subscr_no,
    ciem.subscr_no_resets, s.subscr_no servive_subscriber_no,
    s.service_active_dt, s.service_inactive_dt, s.is_prepaid,
    billing_extract_subscriber.get_status_values_descr
    (ss.status_id,
    'ra_delhi'
    ) AS "STATUS_VALUES",
    billing_extract_subscriber.get_status_type_values_descr
    (ss.status_type_id,
    'ra_delhi'
    ) AS "STATUS_TYPE_VALUES",
    ss.subscr_no service_status_subscr_no, NULL "point_target",
    NULL "customer_corridors_subscr_no", cmc.component_id, cmc.package_id,
    billing_extract_subscriber.get_component_name_descr
    (cmc.component_id,
    'ra_delhi'
    ) AS "COMPONENT_NAME",
    billing_extract_subscriber.get_package_def_values_descr
    (cmc.package_id,
    'ra_delhi'
    ) AS "PACKAGE_NAME",
    cmc.component_status,
    billing_extract_subscriber.get_mkt_code_values_descr
    (cf.mkt_code,
    'ra_delhi'
    ) AS "MKT_CODE",
    cf.account_no,
    billing_extract_subscriber.get_bill_period_descr
    (cf.bill_period,
    'ra_delhi'
    ) AS "BILL_PERIOD",
    cf.account_type,
    billing_extract_subscriber.get_account_category_descr
    (cf.account_category,
    'ra_delhi'
    ) AS "ACCOUNT_CATEGORY",
    billing_extract_subscriber.get_gender_descr (cf.gender,
    'ra_delhi'
    ) AS "GENDER"
    FROM customer_id_equip_map@ra_delhi ciem,
    service@ra_delhi s,
    service_status@ra_delhi ss,
    cmf_package_component@ra_delhi cmc,
    cmf@ra_delhi cf
    WHERE ciem.subscr_no = s.subscr_no
    AND s.subscr_no = ss.subscr_no
    AND s.parent_account_no = cf.account_no
    AND s.service_active_dt >= cf.date_active
    AND NVL (s.service_inactive_dt, '31-dec-9999') <=NVL (cf.date_inactive, '31-dec-9999')
    AND s.service_active_dt <= ciem.active_date
    AND NVL (s.service_inactive_dt, '31-dec-9999') >=NVL (ciem.inactive_date, '31-dec-9999')
    AND cmc.parent_account_no = cf.account_no
    AND ciem.active_date <= cmc.active_dt
    AND NVL (ciem.inactive_date, '31-dec-9999') >=NVL (cmc.inactive_dt, '31-dec-9999');
    *1. Now when i'm running this sql all as a whole I'm getting the error:*
    ORA-00904: "S"."SERVICE_INACTIVE_DT": invalid identifier
    ORA-02063: preceding line from RA_DELHI
    Sometimes Invalid Identifier, sometimes invalid table etc. is coming.
    *2. Now when i'm running the above query after breaking into two parts is :*
    a. first part .. WHERE clause is removed -
    SELECT billing_extract_subscriber.get_external_id_types_descr
    (ciem.external_id_type,
    'ra_delhi'
    ) AS "EXTERNAL_ID_TYPE",
    ciem.external_id, ciem.subscr_no customer_equip_map_subscr_no,
    ciem.subscr_no_resets, s.subscr_no servive_subscriber_no,
    s.service_active_dt, s.service_inactive_dt, s.is_prepaid,
    billing_extract_subscriber.get_status_values_descr
    (ss.status_id,
    'ra_delhi'
    ) AS "STATUS_VALUES",
    billing_extract_subscriber.get_status_type_values_descr
    (ss.status_type_id,
    'ra_delhi'
    ) AS "STATUS_TYPE_VALUES",
    ss.subscr_no service_status_subscr_no, NULL "point_target",
    NULL "customer_corridors_subscr_no", cmc.component_id, cmc.package_id,
    billing_extract_subscriber.get_component_name_descr
    (cmc.component_id,
    'ra_delhi'
    ) AS "COMPONENT_NAME",
    billing_extract_subscriber.get_package_def_values_descr
    (cmc.package_id,
    'ra_delhi'
    ) AS "PACKAGE_NAME",
    cmc.component_status,
    billing_extract_subscriber.get_mkt_code_values_descr
    (cf.mkt_code,
    'ra_delhi'
    ) AS "MKT_CODE",
    cf.account_no,
    billing_extract_subscriber.get_bill_period_descr
    (cf.bill_period,
    'ra_delhi'
    ) AS "BILL_PERIOD",
    cf.account_type,
    billing_extract_subscriber.get_account_category_descr
    (cf.account_category,
    'ra_delhi'
    ) AS "ACCOUNT_CATEGORY",
    billing_extract_subscriber.get_gender_descr (cf.gender,
    'ra_delhi'
    ) AS "GENDER"
    FROM customer_id_equip_map@ra_delhi ciem,
    service@ra_delhi s,
    service_status@ra_delhi ss,
    cmf_package_component@ra_delhi cmc,
    cmf@ra_delhi cf
    The query is running fine.
    b. when i'm running the another part where i'm removing the functions and replacing with then also it is running fine. e.g*
    SELECT *
    FROM customer_id_equip_map@ra_delhi ciem,
    service@ra_delhi s,
    service_status@ra_delhi ss,
    cmf_package_component@ra_delhi cmc,
    cmf@ra_delhi cf
    WHERE ciem.subscr_no = s.subscr_no
    AND s.subscr_no = ss.subscr_no
    AND s.parent_account_no = cf.account_no
    AND s.service_active_dt >= cf.date_active
    AND NVL (s.service_inactive_dt, '31-dec-9999') <=NVL (cf.date_inactive, '31-dec-9999')
    AND s.service_active_dt <= ciem.active_date
    AND NVL (s.service_inactive_dt, '31-dec-9999') >=NVL (ciem.inactive_date, '31-dec-9999')
    AND cmc.parent_account_no = cf.account_no
    AND ciem.active_date <= cmc.active_dt
    AND NVL (ciem.inactive_date, '31-dec-9999') >=NVL (cmc.inactive_dt, '31-dec-9999');
    *3. I can trace out there is some problem related to the concurrent db links getting opened.*
    i've done resizing the following parameters as well but isn't working :
    NAME TYPE VALUE
    open_cursors integer 3000
    open_links integer 100
    open_links_per_instance integer 100
    read_only_open_delayed boolean FALSE
    session_max_open_files integer 10
    NAME TYPE VALUE
    open_cursors integer 3000
    open_links integer 100
    open_links_per_instance integer 100
    read_only_open_delayed boolean FALSE
    session_max_open_files integer 10
    SQL>
    SQL> sho parameter distributed
    NAME TYPE VALUE
    distributed_lock_timeout integer 300
    I've tried breaking up the query but in any case i'm opening same no. of dblinks. So it din't help me.
    Kindly Suggset what to do? Is there any more parameter which govern maximum db links opened at a time? or is this problem due to someother reasons?
    Database Details :
    Version : 10.2.0.3.0
    Platform : HP UX

    Hi all,
    NO RESPONSE AT ALL???
    Well not a PROBLEM....
    I got my solution so thought of writing it here for everybody's reference.
    SQL> alter session set events '10176 trace name context forever';
    Session altered.
    SQL> alter system flush shared_pool;
    System altered.
    And then I have execute original query given by Prabhat, it's running fine.
    Applies to:
    Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 11.1.0.7
    This problem can occur on any platform.
    Symptoms
    -- Problem Statement:
    Following query over dblink having Local database 9iR2 and remote 10gR2 works..
    select *
    from ctps3.institutions@ctps3 i,
    ctps3.state_types@ctps3 s,ods.institutions oi
    where s.stt_state_type_id (+) = i.stt_state_type_id
    and oi.ctps_insttn_id = i.inst_insttn_id
    and i.inst_modifd_dt = trunc(sysdate)
    and (nvl (oi.inst_state_txt, 'x') <> nvl (s.stt_state_type_nm, 'x'))
    and (nvl (oi.inst_phone_txt, 17) <> nvl (i.inst_phone_txt, 17));
    The same query fails when both local and remote databases are 10g R2, with following errors:
    ERROR at line 2:
    ORA-00904: "OI"."INST_STATE_TXT": invalid identifier
    ORA-02063: preceding line from CTPS3
    Cause
    Outer join query over dblink can fail with ORA-904, as referenced in:
    Bug 6620988 QUERY OVER DBLINK FAILS WITH ORA-904 SELECTING DATE
    Predicates are not checked to verify if they belong to same network node when we attempt to colocate the remote tables. This results in wrongly generating remote query and ORA-904
    REDISCOVERY INFORMATION:
    1. ORA-904
    2. DB link
    3. OJ predicates across network nodes
    4. predicates wrongly pushed network nodes
    Solution
    -- To implement the solution, please execute the following steps::
    Use the workaround of disabling colocated joins via event 10176 and force a hard parse to happen
    (ie by flushing the shared pool), ie:
    SQL> alter session set events '10176 trace name context forever';
    SQL> alter system flush shared_pool;
    or
    For a permanent fix, request a One-Off Backport of 6620988 for the appropiate platform.
    References
    Bug 6620988 - QUERY OVER DBLINK FAILS WITH ORA-904 SELECTING DATE

  • Problems witth sql query from servlet

    hi,
    I have a servlet that accesses a MySql database to get the ID of an employee based on employee name (grabbed from session). My problem is that :
    empName contains a whitespace (String empName ="abc xyz")
    When I try to give this to the query:
    String query ="select id from user where eName =" +empName;
    Now I keep getting a "SQL syntax error:please check your syntax to use near 'xyz' at line 1." here which I think is because of the white space in the empName. ( I tried dummy empName without spaces).
    How do I get around this ..I cannot keep the names in the database without any space since they are being dislpayed in other pages. I tried doing a trim() on the empName before passing it to the sql query but I keep getting the same error.
    Is there any way I could query the DB with a white space in the empName?
    Thanks,
    G.
    Is there any way to

    Second of all: Use prepared statements:
    like:
    insertStatement = "SELECT ? FROM ? WHERE name=?";                    
    stmnt = _sql_connection.prepareStatement(insertStatement);
    stmnt.setString(1, "name");
    stmnt.setString(2, "table");
    stmnt.setString(3, "test");This is more secure. If you do it the above way i could enter some thing like
    *; DROP TABLE *; --
    You dont want a user to kill your whole db, dont you?
    so your querry String query ="select  id from user where eName = '" +empName +"'"; will end up:
    select  id from user where eName = '*'; DROP TABLE *; -- 'where everything after -- is ignored because this is a comment flag.

  • Problem use SQL query in coding report with SBO

    Hi everyone!
    I have problem in execute query to delete and create a report with SQL 2000 in SAP.
    Try
            oForm.DataSources.DataTables.Item(0).ExecuteQuery("DELETE FROM rptReport")
    Catch ex As Exception
    End Try
             oForm.DataSources.DataTables.Add("TestReport")
             oForm.DataSources.DataTables.Item(0).ExecuteQuery("SELECT     Number, RefDate, Memo        into  rptReport   FROM         dbo.OJDT")
             oTable = oForm.DataSources.DataTables.Item("TestReport")
    This code is error. I don't know how to execute 2 this sql command. Hope everyone help me hix hix!  .

    /Invalid query tree  [300-33]. The SQL error is 8180/
    But search in SQL book hasn't got that err. Some person spoke ExecuteQuery property wasn't support Table Delete and Create, it only support simple Select... I tried to use Recordset but don't success. Can I use "Delete" and "Select ... Into..."   query another style??? Help me, please...!!!

  • Strange problem with SQL query in toad.

    Guys,
    My colleague is up with a strange problem with an SQL query that if it is run in toad encounters the "ORA-03113: end-of-file on communication channel" problem,but if run in SQL plus executes just fine.
    Do anyone have thoughts about this strange error in toad?
    Thanks!!!!
    Regards,
    Bhagat

    Not sure what version of TOAD you have but it may have shipped with SQLMonitor which montiors SQL sent from Windows apps . Navigation should be similar to;
    Start~Programs~Quest Software~TOAD for Oracle~Tools~SQLMonitor
    or
    C:\Program Files\Quest Software\Toad for Oracle\SQLMonitor.exe
    To use it, start TOAD and connect, start SQLMonitor and click the checkbox for TOAD.exe, then execute the query. SQLMonitor will show you the actual query that TOAD sent to the client. It may be exactly what you sent or it may contain some extras.

  • Re: Problem in SQL Query

    Hi Billy,
    Thanks for ur reply. It was very helpful. I do have a small problem i want to reterieve a column called doc_class_description from a table called class which also contains the doc_class_code. To be more clear
    tablename: Class
    the fields are:
    Name Null? Type
    DOC_CLASS_CODE NOT NULL NUMBER(10)
    DOC_CLASS_DESCRIPTION VARCHAR2(1000)
    I want to reterieve this column DOC_CLASS_DESCRIPTION along with the columns in subclass table in the same format as asked yesterday.
    for ur reference:
    fields in subclass table are:
    Name Null? Type
    DOC_CLASS_CODE NUMBER(10)
    DOC_SUBCLASS_CODE NOT NULL NUMBER(10)
    DOC_SUBCLASS_DESCRIPTION VARCHAR2(1000)
    My output should look like:
    DOC_CLASS_CODE DOC_CLASS_DESCRIPTION DOC_SUBCLASS_CODE DOC_SUBCLASS_DESCRIPTION
    12 ABC 1 XYZ
    2 DFG
    Can the same query given yesterday be modified

    Duplicate thread
    Re: Problem with SQL query

  • Exact time of SQL query execution.

    Hi,
    Is there any way to get the exact time of execution of particular SQL query.
    Oracle Version : 10.2.0.4.0
    OS : Sun OS.
    Thx,
    Gowin.

    In general it's pretty hard.
    Look at V$SQLSTAT.ELAPSED_TIME and DBA_HIST_SQLSTAT.ELAPSED_TIME_TOTAL/DELTA (need a license).
    It will give you accurate results for a non-parallel query. For parallel queries you'll get a total time spent by all slaves.
    Also you can enable tracing either on database or session level and analyze the trace files generated.
    Edited by: Max Seleznev on Nov 4, 2011 12:06 PM

  • JSTL : problems with sql:query /forEach  tag

    I am not able to iterate thru the resultset provided by <sql:query> tag in JSTL. rowcount and columnName works, which means that query does produce a resultset. However, the <c:forEach> tag doesnt display the retrieved data. Code is approx like:
    c:catch var="e">
    <sql:query var="queryResults" >
    select * from emp
    </sql:query>
    </c:catch>
    <c:if test="${e!=null}">The caught exception is: ${e}
    ${queryResults.rowCount} <br>
    <c:forEach var="row" items="${queryResults.rows}">
    <tr>
    <td> <c:out value="${row.EMPNO}" /></td>
    </tr>
    </c:forEach>
    </table>
    Error thrown is :
    javax.servlet.ServletException: Unable to find a value for "EMPNO" in object of class "java.lang.String" using operator "."
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
         org.apache.jsp.jsp.sql.query_jsp._jspService(query_jsp.java:92)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    Pls. help!

    Thanks a lot all. My problem was solved by simply replacing the taglib directive
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    to
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    Cheers!

Maybe you are looking for

  • PC shuts down when I plug the iPod USB cable in :(

    Hi, I have just bought an iPod Nano 8GB. Downloaded the latest version of iTunes and installed. Then as soon as plugged the USB cable into the PC it shut down instantly. I had to wait a good 5 minutes when before it would boot back up again. I have t

  • Show stacked canvas when form is opened

    Hi, I'm working with forms 6i. My form has one multi-record block. Due to the amount of fields that need to be shown we split the block across 2 canvases, the first fields are shown in the primary canvas and next to it is something like an overflow,

  • Bridge CS4 Won't Download Images

    I just bought a new computer with Wndows 8.1. I've installed Adobe Creative Suite 4 and encountered a problem with Bridge CS4. When I select File > Get Photos From Camera the dialogue box comes up, but it gets stuck on "Loading Device List... Please

  • Help: iTunes and Quicktime problems

    Hello I have read so many topics similar to this and followed the advice there but no luck. So i am on my knees with what to do. I miss iTunes! When the latest update came out, i updated it and after the install i could not open iTuens. I got the fol

  • Vista 64 installed, won't launch - The folder "iTunes cannot be found...

    or created, and is required. The default location for this folder is inside the "Music" folder. The folder does seem to be there. Any ideas? Thank you!