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



Home Answers Viewqa SQL Sql querry not working

Have Programming Question? Ask it here!
 
 
 


anjuman
Sql querry not working
0 Answer(s)      2 years 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
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
Comparing arrays not working correctly?
Comparing arrays not working correctly?  Comparing arrays not working correctly
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
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
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
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
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
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
sql - SQL
order by SQL Query  What is order by in SQL and when this query is used in SQL?Thanks!  Hi,In case of mysql you can user following query.Select salary from salary_table order by salary desc limit 3,1Thanks
file_exists php not working
file_exists php not working  file_exists php not working. Please give me the simple example
sql - SQL
want query? 4.what is the diffrence between sql and plsql?  Hi Friend... HAVING n>1; Difference between SQL and PL/SQL: SQL is a structured query...(select,insert,update etc.), manipulate objects(DDL) and data(DML). PL/SQL
sql - SQL
sql  write a dyamic sql program to display the name of a employee whose salary is <5000  Hi Friend, Use the following query... the following link: http://www.roseindia.net/sql/ Thanks
Dynamic-update not working in Hibernate.
Dynamic-update not working in Hibernate.  Why is dynamic update not working in hibernate?   Dynamic-update is not working. It means when you are running your update, new data is added in your table in place
UIWebView zoom not working
UIWebView zoom not working  Hi, I don't know why UIWebView zoom not working? Tell the solution. Thanks   Hi, Open the .xib file and set scalesPageToFit to YES. Thanks
Working of POS Terminal
Working of POS Terminal  Hi there, thanks for this post. Just curious how actual POS terminal will interact with PHP. PHP doesn't provide hardware interaction. Thanks for reply. Regards
StandardServiceRegistryBuilder not working in Hibernate 4.3.1
StandardServiceRegistryBuilder not working in Hibernate 4.3.1  Hi, It seems that the StandardServiceRegistryBuilder not working in Hibernate 4.3.1.... working with the Hibernate 4.3.1 and it is giving following error message: Access
background images in css not working
background images in css not working  In the application i'm passing a background image from CSS in the given format ... background-image: url("Image\backgroundImage.GIF"); which is not working. So, please give me an example
calculate working hour
calculate working hour  why echo not come out? <html><body> <form action="<?php $_SERVER['PHP_SELF'];?>" method="post"> Working hour : <input name="workout" type="text"/><input name="submit1
Working with Eclipse IDE - Struts
Working with Eclipse IDE  hello, i am beginner to eclipse . i want to run my first struts program in eclipse 3.2. what are the steps for running struts in eclipse . Any body plz, tell me the setting environment of eclipse
php <? ?> tag not working
php tag not working  why PHP tags not working in my application?   This might happen when your shortopentag is turned off. So, you will have to turn it on by changing the status of this PHP tag in php.ini file. Here
SQL - SQL
SQL  Jus c da case we hve certain images in some folder or some area in sql can we create trigger or procedure so dat in front like in asp page while clicking image it will be showed in page ...... ...I mean writing code for each
SQL - SQL
SQL  How to combine 'LIKE' and 'IN' operators in sql query?   select name from tab1 where name like 'R%' AND city in('bangalore','mumbai'); Table Name: tab1 FieldName ===================== | name | city
command prompt is compilation is not working
command prompt is compilation is not working   Dear java users can anyone help me to run the program in command line prompt i tried by selecting the environment variable and class path and path in my system my program
window.open() not working - Ajax
is that the pop up window is not at all working.. Once I click the button, the page
sql - SQL
sql functions with examples  I need sql functions with examples to learn fast.  Hi friend,<%@ page language="java" import...("SQL statement is not executed!"); } } catch (Exception e
sql - SQL
hours and i am working on live updates of this. for each time-interval end app
Ajax not working in jsp
Ajax not working in jsp  I'm using Netbean, Ajax validation in the following code is not working the code succesfully run for first UID validation adn also for ee-mail but does not enter if else for firstname field please help me
 

 

 

DMCA.com