Problem in SQL query in MDB database

Hello all,
                    I am using mdb database and want to read specific time stamp record based on time stamp. I am using simple sql query but I am getting one error. Please let me know where I am making mistake(s). One error is operator missing. VI and database is attached.
My query is -SELECT * FROM Downloaded_120 where col2 between 13:00:00 04-06-2013 and 14:00:00 04-06-2013
Thanks.
Kudos are always welcome if you got solution to some extent.
I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
Attachments:
VI and database.zip ‏372 KB

http://digital.ni.com/public.nsf/allkb/4012B21BA0876907862576110070FC0A
You're missing the #s, too.
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

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)?

  • 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

  • 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 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 generated by setString

    Using Creator 2EA2 I have a rowset based on this query (it's actually only the last bit of it with the third parameter that is a problem):
    SELECT director.director_id,  director.name FROM director, director_last_modified WHERE name REGEXP '^[A-C]'  AND director_last_modified.dir_last_modified > ? AND director_last_modified.dir_last_modified <= ?  AND director.director_id = director_last_modified.director_id AND director_last_modified.dir_flagged = ? ORDER BY name; I use setObject to set the first and second parameters to a date. The third parameter refers to field in the database which indicates whether or not a director is 'flagged'. It's a TINYINT in a MySQL table and may contain either 0 or 1. If the user wants to see 'flagged' directors, I want to set the third parameter to 1. If they want to see all directors I want to set the third parameter to 0 OR 1.
    So I use setString with a String variable for the parameter:
    setString(3, strCriterion3);If strCriterion3 has been set as follows:
    strCriterion3 = "1";the generated SQL query ends with:
    director_last_modified.dir_flagged = '1' ORDER BY name; JDBC supplies the two apostrophes. So it would seem to follow that in order to produce a query which ends with:
    director_last_modified.dir_flagged = '1' OR '0' ORDER BY name;I shoud set strCriterion3 with:
    strCriterion3 = "1' OR '3";
    in order to get the required apostrophes.
    However, the generated query is then:
    director_last_modified.dir_flagged = '1\' OR '0\' ORDER BY name;How do I get rid of those backslashes? I've tried double apostrophes, by the way - that just gives me more backslashes.
    Thanks for any help you can offer.

    [Sorry, but I missed the parentheses from the query. It should end with:
    [code]AND (director_last_modified.dir_flagged = ?) ORDER BY name;
    - not that that makes any difference to the apostrophes problem.]
    I've just discovered a solution in this thread http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=56228
    So I've replaced = ? in the query with LIKE ?
    I then set strCriterion3 to either "1" or "%". That will do nicely, but it seems a bit of kludge and, under different circumstances, I'd still need to get rid of those pesky apostrophes. Any ideas?

  • 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

  • How to set fetchsize of sql Query when using Database Adapter.

    Hi All,
    I am using DatabaseAdapter to connect to database and retriving huge amount of data.For improvement in the performance I want to set the "fetchsize" of sql query. I know fetchsize can be preset in Java using Jdbc 2.0 API.Please let me know how to set this value in BPEL when using DBAdapter?
    Thanks
    Chandra

    I talked to the developer of the db adapter - and he told me this feature will be available in BPEL PM 10.1.3 (which is supposed to be production later this year, and a public beta soon). If this is an emergency I would recommend going throug Oracle support and have them file an enhancement for 10.1.2.0.2
    hth clemens

  • Store SQL Query in Oracle database

    Hello,
    I am storing SQL query in database. here is an example of query.
    INSERT INTO TABLE_1 Values (' " + getValue1() + " ', ' " + getValue2() + " ' )
    getValue1() and getValue2() are functions to retrieve values.
    When I read query from the database and execute it, it doesn't read values from function.
    After I read query from database I would expect it to be
    INSERT INTO TABLE_1 Values ('value1', ' value2' ) but it is not reading values and trying to execute whatever I got from database.
    Any help?
    Thanks

    Thanks for your reply. Let me give you more info.
    All I am trying to do is storing queries in oracle
    database to use it in future for reporting. As I am
    doing reporting where clause will be different every
    time. Reporting involves queries not updates. But in any case that means that you would use a java SQL string that is useable via a prepared statement. As such your statement would look like....
    INSERT INTO TABLE_1 Values (?,?)
    Is it not possible to substitute variable string I
    got from database?What do you mean?
    SQL is SQL. You construct SQL so it is valid and runs. Can you construct SQL so it runs a function/select and uses that value in some more SQL - depends on the database, but usually.
    But that has nothing to do with java - it is SQL.
    Query contains variables that I have in Java code .Then it is SQL. It is java. You use bind variables (see PreparedStatement) and assign values to it.
    The SQL for such a query would look like the following...
    select field1, field2 from table1 where id=?
    In your java you would then use something like PreparedStatement.setInt(1, 100), to fill in the value for the '?' in the above.
    You might also note that your solution will not work for any arbritrary SQL statement unless you are also storing meta data about the SQL itself. For instance the following SQL statements would return the same result set but your java code would have to populate the bind variables different for both...
    select field1, field2 from table1 where id=? and name=?
    select field1, field2 from table1 where name=? and id=?

  • 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 in SQL Query

    Hi Guru
    Please help me to make a SQL query to retrieve appropriate data.In my database table has columns like Reg_no, Order_no. Please find out those records where Order_no same but different Reg_no.But dont show those records where same order_no has same reg_no.
    Reg_no Order_no
    1 55
    2 55
    3 57
    4 57
    5 58
    5 58
    5 58
    6 59
    6 59
    7 60
    7 60
    Thanks in advance
    Mokarem

    may be try
    SELECT DISTINCT Order_no,Reg_no
    FROM <your tablename>added query
    Message was edited by:
    devmiral

  • Executing SQL query in portal database

    Hi ,
       I wish to do a simple POC . I need to create a table from NWDS , populate it with some data and then access the table data using an sql query . I am aware how to create a table but I am not sure where exactly to write the query .
    What I would like to understand is
    1) If I create a table where would that table get created (The database) ?
    2) Where would I write that query in NWDS ?
    3) How would I execute that query in that database ?
    Please help for the same .
    (Needless to say that I always award points )
    Regards
    Deepak Singh

    Hi Gopal ,
       Thanks for the reply .This is what I did . I am pasting the whole code of the class that I am using to do the POC .
    package com.gravity;
    import java.sql.Connection;
    import java.sql.Statement;
    import java.util.Hashtable;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    /*import sun.jdbc.odbc.ee.DataSource;/
    @author Administrator
    To change the template for this generated type comment go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    public class DataHandling {
    public static void DataPost(){
         Connection con = null ;
         try {
    Added code
            Hashtable env = new Hashtable();
              env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
              System.out.println("initial_context_factory put ");
              env.put(javax.naming.Context.PROVIDER_URL, "gms29:50004");
              System.out.println("provide_url put ");
              env.put(javax.naming.Context.SECURITY_PRINCIPAL, "j2ee_admin");
              System.out.println("security_principal put ");
              env.put(javax.naming.Context.SECURITY_CREDENTIALS, "gravity");
              env.put("domain", "true");
              env.put("force_remote", "true");
              System.out.println("security_credentials put ");
              InitialContext iCtxt = new InitialContext(env);
              System.out.println("Object made for initial context ");
              DataSource ds = (DataSource) iCtxt.lookup("jdbc/my_db");
              System.out.println("Datasource obtained ");
              try {
                   con = ds.getConnection();
                   Statement stmt = con.createStatement();
                        String query1 ="insert into EmpData (EMPCODE,EMPNAME) VALUES('naveen',125188)";
                        String query2 ="insert into EmpData (EMPCODE,EMPNAME) VALUES('deepak',125189)";
                        String query3 ="insert into EmpData (EMPCODE,EMPNAME) VALUES('rajeev',125190)";
                   stmt.executeUpdate(query1);
                   stmt.executeUpdate(query2);
                   stmt.executeUpdate(query3);
                  }catch (Exception e) {
                   e.printStackTrace();
             }catch (Exception e) {
                    e.printStackTrace();
                                         } finally {
                                            try {
                                            con.close();
                                                }catch (Exception e) {
                                                e.printStackTrace();
    public static void main (String[] args){
         System.out.println("Hello");
         DataPost();
    I have imported all the driver jar files and sapj2eeclient.jar in the classpath .
    Also the drivers found in the path
    172.16.161.11\usr\sap\EP1\DVEBMGS00\j2ee\cluster\server0\bin\ext\com.sap.portal.jdbcdrivers
    have all been added to the classpath .(Not sure if this is required)
    Let me know what you find wrong in my code and in the meanwhile I will try to implement what you suggested .
    Regards
    Deepak Singh

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

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

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

Maybe you are looking for