Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa SQL Sql querry not working
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


anjuman
Sql querry not working
0 Answer(s)      2 years and 2 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..


Advertisement
View Answers

Related Tutorials/Questions & Answers:
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
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
Advertisements
UITapgesturerecognizer not working
UITapgesturerecognizer not working  uitapgesturerecognizer not working
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
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
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  . Given two tables: table1(player, groundname, numcenturies); table2(ground_name, country); Write and SQL query for the following: " Select all the players from table1 who has
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
Comparing arrays not working correctly?
Comparing arrays not working correctly?  Comparing arrays not working correctly
Update not working in hibernate.
Update not working in hibernate.  Update not working in hibernate
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
SQL
events, user events, and SQL statements to subscribing applications 10)Restrict DML
SQL
events, and SQL statements to subscribing applications 10)Restrict DML
SQL
tables EMP, and DEPT, the structure for which are given above. Write SQL queries
SQL
, user events, and SQL statements to subscribing applications 10)Restrict DML
Nitobi Grid is not working in IE10/IE11
Nitobi Grid is not working in IE10/IE11  Nitobi grid is working in IE8, but not working in IE10/IE11. we are using above two javascript files to open the grid
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
html dropdown not working firefox
html dropdown not working firefox  I am writing a Dropdown code in HTML which is not working in firefox. What could be the reason as it's perfectly working in IE and Crome. Thanks
calender working in struts - Struts
calender working in struts  when i execute the following code ,that is working properly if i convert to struts html tags that code is not working please help me to rectify the problem
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
Advertisements
 

 

 

DMCA.com