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

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
    &#123;code&#125;
    (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 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.

  • 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

  • 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

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

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

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

Maybe you are looking for

  • F110 Message : Payment order created, invoice not paid.

    Dear, All Experts. I have done F110, I am getting this message :- Payment order 1000000454 for RUB 14.998,00- was generated for payment method T In F110 I can see the payment order report also, but why invoice is not getting paid ? Or I am missing so

  • Problem RFC sender

    Hello, I have a new Problem about a sending RFC in XI. Once I send a test-RFC from R/3 se37 it reaches the rfc sender channel but there I get an error in cc-monitoring(the same is displayed in R/3 then as well). The error says: Processing error cause

  • Replenishment Control / Follow-on Document

    Hi How can I associate a kind of purchase requisition to be the follow-on document in Replenishment Control? It works fine whith the standard but I need to use the new one I've created. Thanks, Patrício

  • Check current job status

    HI, I am not able to check which job is currently running in our database, could anybody suggest me what is the command for that? Regards Gagan

  • Why does Adobe say Mozilla doesn't allow download of "Reader"?

    While trying to install Adobe Products (Reader), the installation screen instructs that if you use Mozilla, then you must read the installation instructions. Pressing the "button" does not take you to the installation instructions. However, I've had