Home Answers Viewqa SQL Sql querry not working

 
 


anjuman
Sql querry not working
0 Answer(s)      9 months ago
Posted in : SQL

Hello... Am developing a web application where granite blocks are to be traced.. The main blocks are cut into cut-blocks at first.. Then these cut-blocks are converted to slabs.. I use two tables here:

  1. cutblockdata contains the data of cut-block.
  2. slabcutblockdata contains the data of slabs.

CBID is cutblock ID.

My code:

ResultSet rc=st.executeQuery("select DISTINCT APP.CUTBLOCKDATA.* from APP.CUTBLOCKDATA,APP.SLABCUTBLOCKDATA where APP.CUTBLOCKDATA.CBID<>APP.SLABCUTBLOCKDATA.CBID)");

   while(rc.next())
       {
       RowCount++;
       }
     System.out.println("ROWCOUNT: "+RowCount);

Suppose i have 3 cut-blocks. For the first time my output for the above query is:

ROWCOUNT:0

Now I convert cut-block1 into slab. Executing the query again my output is:

ROWCOUNT:2

"2" indicates that there are remaining 2 cut-blocks. The output is correct here.

But.. When I convert cut-block2 into slab. Executing the query again my output is:

ROWCOUNT:3

The output is wrong here. I should get ROWCOUNT:1

For the first two times my query is getting executed properly.. But not for the rest of the times.. I need to resolve it quickly too.. Please help.. Thanks in advance..

View Answers









Related Pages:
Sql querry not working
Sql querry not working  Hello... Am developing a web application where granite blocks are to be traced.. The main blocks are cut into cut-blocks at first.. Then these cut-blocks are converted to slabs.. I use two tables here
JTextfields working with JTextArea
JTextfields working with JTextArea  I have 2 database tables one... sql = "select pHistory from patient where pName" + " = '"+textboxValue+"'"; PreparedStatement ps = con.prepareStatement(sql
This Query is no working in sql developer it is giving Ora-0933 exception SQL command not properly ended exception
This Query is no working in sql developer it is giving Ora-0933 exception SQL command not properly ended exception  SELECT * from employees ORDER BY first_name limit 0,10;   Hi Friend, Please clarify your problem
sql - SQL
hours and i am working on live updates of this. for each time-interval end app
sql - JDBC
sql  hi am keerthi java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Source=:src Destination=:dest'. am working with this from last 2 days plzzz anybody give
SQL Date
SQL Date         The SQL Date is used when you are working with dates. This include... with Example The Tutorial illustrate a Example from SQL Date. In this Tutorial
UITapgesturerecognizer not working
UITapgesturerecognizer not working  uitapgesturerecognizer not working
SQl Date
SQL Date       The SQL Date is used when you are working with dates. This include... The Tutorial illustrate a Example from SQL Date. In this Tutorial, we
how to declare a auto increment in sql - SQL
how to declare a auto increment in sql  Dear sir, How to declare a auto increment insql? i used a identity but it is nt working in sql,so please helpme sir.. Thanks and Regards Harini Veerapur  Hi Friend
sql exception - JSP-Servlet
sql exception  Dear sir , I am working in a web-based project, In my system it is working fine but at client side getting the following exception so how to resolve this help me... java.sql.SQLException: ORA-28231
htpasswd working
htpasswd working   hii, What does htpasswd do?   hello, htpasswd creates a new user in a specified group, and asks to specify a password for that user
Datagrid not working
Datagrid not working  The code here is working fine, apart from the fact that that I'm using netbeans 6.5 and the servlet v2.5 and struts 1.1.... working. please help me out
sql
difference between sql and oracle  what is the difference between sql and oracle
sql
sql  how to get first row in sql with using where condition in sql? how to get last row in sql with using where condition in sql
Why this is not working...?
Why this is not working...?  import java.util.*; public class Family { int size_of_family=0; public Person[] members=new Person[size_of_family]; Person d = new Person(); public Family (int size_of_family){ members = new
jsp -sql - JSP-Servlet
jsp -sql  Hello Sir/Madam, Please send me the error in the following sql code if any. I did not get any error message and iam not getting.... In the above code second condition entrydate>='todayc' is not working. Please help me
sql
sql  I want interview sql questions   Please visit the following link: SQL Tutorials
Sql
Sql  how to find maximum of a101,a102,a103 from a table in sql
Data Conversion In Sql Server 2005
Data Conversion In Sql Server 2005  Hi I am working vb.net & sql server 2005 database. I am storing date (MM/DD/YYYY) format. now I have problem in sql date conversion (DD/MM/YYYY). Can you help how to convert date
SQL
SQL  hii What is sql?   hello, SQL, which stands for Structured Query Language, is a special-purpose language used to define, access, and manipulate data. SQL is non procedural, meaning that it describes
sql
sql  returning value from a store procedure in sql with example   Please visit the following links: http://www.roseindia.net/mysql/mysql5/stored-procedures-and-functions.shtml http://www.roseindia.net/sql/create
SQL
SQL  In my computer i have microsoft sql 2008.how can i set that in the cmd.i want to use that in cmd.what is the default username and password
SQL
SQL   1)How to Store 1000 records in Oracle object. 2)Write a query for calculate highest, 3rd Highest & 10th highest salary from emp teble. 3)What is Sequence. 4)How to use rowid in Sql. 5)What is Views. 6)How
SQL
SQL  how to get ( 15 march 2011) and (15/03/2011) output using SQL   Use the following queries to get the data from database in the given format. For (15 march 2011) format: SELECT DATE_FORMAT(dob, '%d %M %Y') FROM
SQL
SQL  how to get ( 15 march 2011) and (15/03/2011) output using SQL   Use the following queries to get the data from database in the given format. For (15 march 2011) format: SELECT DATE_FORMAT(dob, '%d %M %Y') FROM
SQL
SQL Trigger query  Why we use the Trigger and what it's uses?   A database trigger is procedural code that is automatically executed..., user events, and SQL statements to subscribing applications 10)Restrict DML
Update not working in hibernate.
Update not working in hibernate.  Update not working in hibernate
SQL
tables EMP, and DEPT, the structure for which are given above. Write SQL queries
SQL
events, user events, and SQL statements to subscribing applications 10)Restrict DML
SQL
, user events, and SQL statements to subscribing applications 10)Restrict DML
SQL
events, and SQL statements to subscribing applications 10)Restrict DML
Executing Set of SQL statements in Java
Executing Set of SQL statements in Java  Hi, I am trying to execute a procedure which is stored in MS SQL server's database. I have configured... is not working. Please help
SQL Example, Codes and Tutorials
.    SQl Date The SQL Date is used when you are working... SQL Example, Codes and Tutorials       SQL Tutorials: Collection of SQL tutorials for beginners
Focus method not working in firefox
Focus method not working in firefox  object.focus() is not working in firefox and chrome the element is not focused what was the problem
SQL
sql
SQL
sql
sql
sql
SQL
SQL
SQL
SQL
SQL
SQL

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.