sql 2 « Operation « Java Database Q&A





1. Validate SQL Queries    coderanch.com

2. URGENT --Help needed --- Delay in executing SQL Query..    coderanch.com

Hi, I have a SQL query with 300 lines. When I execute it at SQL PLUS prompt, it takes only 4 seconds. The query is not fetching any row as of now. The same query when I run from java program using Oracle thin driver, it is taking more than half an hour. It is a simple java program just executing ...

3. Something is wrong in my SQL update    coderanch.com

Hello, I have DB : AlunisDB - table_noms(id_nom(AUTO-INCREMENT), nom(CHAR(20))) my connection to the DB : /********************************************/ try { Class.forName("com.mysql.jdbc.Driver") ; connect= DriverManager.getConnection("jdbc:mysql:///AlunisDB?user=root&password="); stmt = connect.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); } catch(SQLException e) { System.out.println(e) ; return ; } catch(ClassNotFoundException e) { System.out.println(e) ; return ; } /*****************************************/ If I do a SELECT there is no probleme but if I do a INSERT INTO ...

4. Help with a sql query....    coderanch.com

For Oracle (no boolean, but substituting 1): INSERT INTO new_table SELECT old_table.*, 1 FROM old_table; This works if old_table isn't to large (huge transaction). If you really are Oracle then the SQLPLUS "COPY" command will do the trick for very large tables. If not Oracle, then you'll have to break up the insert with a WHERE clause on the SELECT.

5. Syntax error in SQL query    coderanch.com

6. Dynamic SQL Query Doubt    coderanch.com

Hi friends Please give me a solution for my doubt. I am Creating a dynamic SQL query such that if the user selects any value from the picklist then that I set the value in PreparedStatement using the following statement. For simplification, I write the simple query but the actual query is big. I am using Prepared Statement to set the ...

7. Urgent : Help needed in writing a SQL query    coderanch.com

Hi , I have a table TEMP which has three columns say COL1,COL2,COL3 The data in that table is like : COL1 COL2 COL3 -------------------------- 1 65536 1 1 65536 2 1 65537 1 1 65537 1 1 65538 2 I need to write a query which displays results; 65536 1 65537 1 65538 2 i,e, For each distinct COL2 get ...

8. handling quotes in sql queries    coderanch.com

This leaves me with another question from a design point of view. I have sql queries spread out in my application where I need to handle this escaping quote EVERYWHERE. So I wrote a helper method which would modify my string. And I call this method everywhere for all the strings before I insert something into the database. Now I am ...

9. Converting sql queries while porting    coderanch.com





10. Some quick SQL help on hard query    coderanch.com

Hi guys, I am trying to write a query that in one of the where columns there is a default value and it's giving me trouble. Basically, I narrow a table of records down by a few different fields. One of the fields is a "unittype" field. There's a know set of values in the table, so I set a value ...

11. Complicated SQL query help    coderanch.com

Say I have the following data model: Table A -0..m-> Table B -0..m-> Table C Doing the sql for this is not hard, just joining tbls A->B and B->C. The problem is, that there are a lot of different Table Bs and Table Cs, and the size of the data returned grows exponentially. The last query of this kind that I ...

12. Is there a way to perform SQL queries on local data?    coderanch.com

I am trying to find a way to be able to query local data objects with SQL commands to avoid constantly hitting the database. I have an app that creates temporary tables in the database from some SELECT statements and I use those temp tables as the datasource for many more queries and temp table creations. If I could load local ...

13. Help on SQL Query    coderanch.com

I need to create a query to find the top 20 vendors and then the top 10 items for each vendor in the first group. I can create the correlated sub query to find ALL the items for each of the top 20 vendors, but I can not figure out a way to only get the top 10 items for each ...

14. SQL query for top ten students    coderanch.com

15. SQL insert query    coderanch.com

Hello people! I'm experiencing difficulty in executing an INSERT query from a JSP page. The problem is with the WHERE part of the clause (because it works when I've taken it out) , I've tried two different versions - here they are: String insertQuery = "UPDATE CUSTOMER SET(PaymentType, CardNumber, ExpiryDate, IssueNumber) = (['"+ newPayType +"', '"+ newCardNo +"','"+ expiryDate +"','"+ newIssueNo ...

16. SQL queries for testing myself    coderanch.com





17. insertRow or SQl query    coderanch.com

18. Radiobuttons & comboxes in an SQL query    coderanch.com

Hey all, I have 3 radio buttons and i'm trying to insert the values of the radio buttons. I also have 3 combo boxes for date,month,year. In my database i have my radio buttons set to varchar and my combo boxes date,month,year are varchar also..but i dont know if this is the right way. I also don't know if my SQL ...

19. Difference between rowid and rownum in sql query??    coderanch.com

Hi, In sql query what is the difference between rowid and rownum ? As I know that : rowid is the unique index number of every row of table maintaining by database automatically. rownum is the sequential number of rows in the resultset object. But my confusion is if I write query like below for extracting 1st row select * from ...

20. sql query    coderanch.com

hi, I need help for a sql query, i have 2 tables. table a: studentid sname table b: studentid, studentNumber. sometimes same studentid has 1 or more studentnumbers. I need to display studentid,studentnumber,sname when I join I always get multiple rows of same student because the student has more than 1 student number. I want to get only one studentnumber if ...

21. sql query question    coderanch.com

Hello, im a MS-SQL user, i need to rewrite a sql to allow it run in oracle 9i: select top 100 * from pOrder where ...... order by createDate i rewrite it as: select * from pOrder where .... and rownum <=100 order by createDate i find that it doestnt work because the database will first from a result table with ...

22. retrieve nth salary thru optimized sql query    coderanch.com

Well in Oracle you could do something like this: SELECT * FROM ( SELECT salary, ROWNUM RN FROM emp WHERE ROWNUM < 4 ORDER BY salary DESC) WHERE RN = 3; Of course ROWNUM is Oracle specific. I suppose you could rewrite the query for other platforms as required. But an easier way is to just query for everything and use ...

23. SQL Query - "in" clause vs "="    coderanch.com

Hi: I was wondering whether "IN" clause is faster or "EQUAL" is faster. For ex: Query #1 SELECT * FROM dept WHERE dept_name = 'SALES' Query #2 SELECT * FROM dept WHERE dept_name in ('SALES') In some scneario, I need to pass multiple dept_name, in that case I need to use "IN" clause. I was wondering if there is any performance ...

24. Help on SQL Query    coderanch.com

Assume that there is a table TABLE1 containing the following data MEMBER_NO NUM_OF_POSTS NAME 290 11000 Jim Yingst 970 13000 Thomas Paul 16595 4000 Ilja Preuss 27533 600 Mani Ram There is another table TABLE2 containing the MEMBER_NO in it. Now I want a query to get the records from TABLE1 such that, The records from TABLE1 should be sorted based ...

25. SQL query takes too long to execute?    coderanch.com

I am trying to select data from a table that has 4,630 records. Now, when I select this data from UNIX shell it takes less than a second, from JDBC it take good 3-4 seconds. Is such difference in execution time normal? public static String doSelect2(String conName, String sql){ Statement stmt = null; ResultSet rs = null; Connection con = null; ...

26. Sql query    coderanch.com

27. Sql query    coderanch.com

According to the scenerio there should be two tables one for Questions and te other is for Answers. Tables ------ Question Answer there should be one to many relationship between Question and Answer. Assuming tables, Question -------- ID(pk) QUESTION ------ -------- ANSWER -------- ID(pk) QUES_ID(fk) ANSWER ------ -------- ------ query looks like this. ----------------- select ANSWER from ANSWER where QUES_ID = ...

28. sql update    coderanch.com

29. sql query    coderanch.com

HI, i have just downloaded sql database and trying to configure it. I am following the instructions that comes within the whole package .when i try to start the server i get system 3 error has occured. and path is not specified . can anybody tell me what exactly is the problem, and how to solve that. thankx

30. SQL Query    coderanch.com

I am a newbie is sql. I have two tables called test_master and test_detail. Both tables contains pos_id as common field. In test_detail got sub_id and to get the people under a given pos_id, I join with pos_id of test_master. In the where condition, when I give the pos_id, it's returning only the first level. How can I get the second ...

31. Sql Query Need Help    coderanch.com

I try to avoid storing strings like that in the table. I prefer to use a "type table" and use referential integrity. For example, I would have a table called t_Priority that would look like this: PriorityId Priority ========== ======== 1 LOW 2 MEDIUM 3 HIGH then in your table in question, have a PriorityId field foreign keyed to t_Priority. Then ...

32. SQL query optimisation    coderanch.com

Hey all, I have written down some SQL queries and also seen some SQL queries which are used in my current project. The question is they are not optimised ones and thats why my performance is degreading.So i just wanted to know that are there any toold which are free and check the Queries for optimization. I can see manually its ...

33. sql query regarding    coderanch.com

34. how to display a SQL query ?    coderanch.com

Hi, I am using JDBC to insert data into a table. A bit like this: Can someone tell me what is wrong with this insert statement. String sql = "INSERT INTO IT_REQUEST (REQUESTID, EMPLOYEEID REQUESTDATE, PRIORITY, TYPE, DESCRIPTION, STARTDATE, COMPLETED, STATUS, MISEMPLOYEE, ACTIVE, CREATEDDATE, CREATEDBY, MODIFIEDDATE, MODIFIEDBY, DELETEINDICATOR, MODIFIEDINDICATOR, EMPNAME, EMPEMAIL) VALUES ( '"+ requestIdInt +"', '"+ zero +"', '"+ reqDate ...

36. tracing sql queries    coderanch.com

Hallo, everybody. Does anobody know a way to trace sql queries that application sends to database (Oracle 8). I tried already OracleLog but it seems he write only driver's method's invocations . Like this: 0000000144 Wed Sep 14 14:26:36 GMT 2005 DRVR 1 OPER main Enabled logging (moduleMask 0x0fffffff, categoryMask 0x0fffffff) 0000000145 Wed Sep 14 14:26:36 GMT 2005 DRVR 0 DBG1 ...

37. Aborting sql query    coderanch.com

hello all my prob is tht i want to abort sql query running in a thread through different thread my program looks like this public class test { public static void main(String args[]) throws Exception { String driverName = "oracle.jdbc.driver.OracleDriver"; String url = "jdbc racle:thin:@192.168.103.46:1521:test"; Class.forName(driverName); // load the driver Connection connection = DriverManager.getConnection(url, "scott", "tiger"); ConnThread connThread = new ConnThread(); ...

38. sql query    coderanch.com

39. Sql query problem    coderanch.com

Hi, I have a table with 4 fields say PK1, A, B, C and D. i want to combine the values of A,B,C and D and store it back to column A for each row with respect to the Primary key. I am using MySQL as my DB. I tried with inner quiries but not getting the correct query. Your help ...

40. help on sql query    coderanch.com

hi, first write the query to check whether the value is already in the table or not using select * from table where value=yourValue, if resultset brings any record, means the value is already there and if not then you can insert one. Otherwise apply a unique constraint on the column if you don't want the column to contain 2 or ...

41. sql query    coderanch.com

42. how to trace sql query    coderanch.com

43. SQL Query Problem    coderanch.com

Hai friends, I need some help. I know the name of database.How can I query to get the details of tables , stored procedures and views corresponding to this database. I just know the name of stored procedures is stored in the sysobjects system table and the text is stored in the syscomments system table in the current database. But I ...

44. Complex SQL Query    coderanch.com

I have two tables, columns of first table contains Table name and column name of another table. I want to retrieve one field from first table and one field from second table (but name of second table is not known until runtime as it is stored in first table) Can anyone suggest how this can be done in one query if ...

45. sql query taking more time from java code    coderanch.com

I have written a nested query. when i run this query using prepared statement, type 4 driver it takes alomst 15 minutes to run from java code whereas it takes only a second when run directly on sqlserver query analyzer. it is just this query in java code that is taking so much time. No problem at all with any other ...

46. sql query --on the fly    coderanch.com

lets say that your query gets a bunch of employee objects (select * from employees) loop through the resultset, construct a collection of employee objects and put it in the request attribute ie., Set employeeSet = someMethodthatGetsEmployeeSetFromRecordSet(rs); request.setAttribute("employeeSet",employeeSet); And in your jsp. get this attribute out of the request: <% Set employeeSet = request.getAttribute("employeeSet"); %> and use the JSTL tags to ...

47. sql query problem    coderanch.com

Hi Guys , I m strucked with sql query and i m nt getting correct output.. The table script,sample sql query and desired output as follows: CREATE TABLE OPS_MASTER ( SLNO NUMBER, COMP_CIRCLE VARCHAR2(10), COMP_STATUS VARCHAR2(10), ENTERED_DATE DATE, CLOSED_DATE DATE) The Testdata: ---------------- INSERT INTO OPS_MASTER ( SLNO, COMP_CIRCLE, COMP_STATUS, ENTERED_DATE, CLOSED_DATE ) VALUES ( 1, 'A', 'CLOSED', TO_Date( '07/11/2006 05:20:50 ...

48. SQL queries    coderanch.com

49. Help with SQL Query    coderanch.com

Please if somebody can help me with a query. I've the following tables mysql> select * from menu; +----+---------------+----------------------------+-----------+ | id | title | description | published | +----+---------------+----------------------------+-----------+ | 39 | Vrienden | Hier zullen blaa van alles | 1 | | 40 | Gekke Sites | Ik weet het niet man!!! | 1 | | 41 | Online Stores ...

50. Help with SQL Query    coderanch.com

Please if somebody can help me with a query. I've the following tables mysql> select * from menu; +----+---------------+----------------------------+-----------+ | id | title | description | published | +----+---------------+----------------------------+-----------+ | 39 | Vrienden | Hier zullen blaa van alles | 1 | | 40 | Gekke Sites | Ik weet het niet man!!! | 1 | | 41 | Online Stores ...

51. Count(*) and SQL Query    coderanch.com

I'm having a problem executing this QUERY from my web. The Query works inside DB2, but for whatever reason, inside the javabean or within JSP, it comes back as a Failed SQL statement. I tried to play around and I think it has something to do with the COUNT(*). When I test each and every select, it works. When I test ...

52. SQL query    coderanch.com

Hi I am developing a WEB PhoneBook Catalogue for a comany intranet in JSP & MSACCESS.In this we can add employee information by following attributes:-empl Id,first Name,lastName,department,site,designation,extension,mob no,email Id.So there will be a USER database in which all these fileds will be present & employeeId will be the primary key. We can search the employee info as follows- These are the ...

53. SQL update to reverse parent-child relationship    coderanch.com

I have two tables, T_A and T_B, which primary keys ID_A and ID_B Currently T_A contains the FK to T_B (ie it contains the reference to ID_B) but I would like to reverse this by adding the FK and constraint to T_B, running an update script to copy the (ID_A, ID_B) from T_A to (ID_B, ID_A) in T_B then drop the ...

54. SQL Queries: Some errors    coderanch.com

"UPDATE Stocks " + "SET stockID = "+ st.getID() + ", " + "'Stock Symbol' = '" + st.getSymbol()+ "', " + "Shares = " + st.getShares() + ", " + "Price = " + st.getPrice() + ", " + "'Buy Date' = '" + st.getBuyDate() + "' " + "WHERE stockID = " + id;

55. Optimizing Queries by Looking @ SQL Plans    coderanch.com

So Im trying to optimize this Sybase SQL query to perform faster. I did a show plan and looked for all "Table Scans" in the Plan. One by one I eliminated them all by providing index hints in the SQL itself ((index xyz_idx1). This eliminated all the Table Scans but the perfoemance is the same. Now all of them are forward ...

56. Sql query    coderanch.com

Note that SQL has no notion of an implicit ordering of records, so there is no designated "first record". The "LIMIT 1" technique will ensure that you'll get back exactly one record, but it could be a different one every time you call it. To make sure you get the desired record, sort the results so that the record you're looking ...

57. please help on a sql query    coderanch.com

58. a SQL query question    coderanch.com

Hi, I have a Sql question: I need to get data from order(call Or), and orHeader(orHd) tables. Or contains the order info while OrHd contains the contact, location info for that order. some orders have more than one locations in the orHd. I need to get the orders with only one location. this is my query: select * from oritems, orheader ...

59. SQL Query formation problem.    coderanch.com

I am supposed to write a query to extract information from a table. The table has 30 million records. Now, the requirements are: 1. The entire table has to be ordered first based on the id. 2. Once the table is ordered, I have to write a query as below: Select id,xml from xm_hash table where id > startId and rownum ...

60. sql query trouble    coderanch.com

Hello friends, I am working on a project with sqlserver in the backend. Recently i have made the following query : insert dmtrans (dmid,itemcode,batchcode,qty,freeqty,pcode,amount) select dmmaster.dmid from dmmaster where dmmaster.dmno = 'latest3', itemmaster.itemcode from itemmaster where itemmaster.itemname='Pacimol', batchmaster.batchcode from batchmaster where batchmaster.itemcode in (select itemmaster.itemcode from itemmaster where itemmaster.itemname='Pacimol'),100, 500,1000,supplier.pcode from supplier where supplier.name='Subhash Medicals',2000 but it gives the following error ...

61. Head First SQL - A Couple of Queries    coderanch.com

I checked out the TOC in O'reilly site for this new book in Head First series and it really looks good. My questions are: 1. Why aren't PL/SQL Procedures covered in the book? I mean it sure would have helped a little bit of programming, IMHO. 2. Is there no support materials for download? Like code downloads or additional utilities to ...

63. To Lynn Beighley - Does HF SQL cover multi-dimensional queries ?    coderanch.com

Hi Lynn, A few years ago I was required to model a database structure which could provide fast performance report queries for managers and decision makers in the company where I've worked for. At that time, I decided to create a non transactional database containing a lot of bi-dimensional tables and stored procedures with business rules for performing queries. Nowadays, due ...

64. Head First SQL - Query Optimization    coderanch.com

65. Head First SQL - Queries    coderanch.com

Hello Lynn, I have a couple of queries regarding the HFSQL. Happened to read the review about it in the Head First Newsletter. It was great and amazing as usual. Pretty much the same standard of HF series!! (*) Is it just for plain SQL queries alone? or any other advanced concepts like procedures, triggers etc., are covered to a certain ...

66. Head First SQL query optimizer    coderanch.com

67. Export into file, sql query to insert data    coderanch.com

In MySQL, you would use: SELECT * INTO OUTFILE '/tmp/mycsv.txt' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM mytable; In Oracle, you would do something like this with pl/sql: create or replace function dump_csv( p_query in varchar2, p_separator in varchar2 default ',', p_dir in varchar2 , p_filename in varchar2 ) return number AUTHID CURRENT_USER is l_output ...

68. sql query is not working in jboss...    coderanch.com

hai i have one problem in jsp with sql tag in but this tag is working in weblogic but it wont work in jsp when i change into datasource=${ds}. give any help on this. hear i post my tag declare @start datetime set @start = ? select g.table_id, count (bet_id) 'bet_count', sum (amount) as 'stake', sum (payoff) as ...

69. Error in parameterised query in Netbeans 6.0 with SQL 2005    coderanch.com

Hi, I am using Netbeans 6.0 with Microsoft SQL 2005 and having trouble executing parameterised queries. I tried both Microsofts JDBC and JTDS and both of them behave the same. I design the query in query editor and when I run the query in the query editor, it runs OK if I do not give any parameters. But If I specify ...

70. SQL Query    coderanch.com

If you are stuck, try starting with a smaller query. Can you figure out how to write a query to get the highest salary of an individual employee? How about the average salary for a single department? All the departments? etc When you get stuck, post the last query you were able to write (that solves a smaller problem) and let ...

71. SQL query    coderanch.com

In one table one coloumn name is "Name". This name coloumn has 20 records. First ten records contain the value as "surender". Next ten records contain the value as "govind". I want the query to display the 1st record as "surender" and 2nd record as "govind" and 3rd record as "surender" 4th record as "govind" . like that means alternatively display ...

72. sql query    coderanch.com

73. SQL query to retrieve all nodes from X up until the root node in a tree structure    coderanch.com

In my SQL-database 'exampledb' I've got a table called 'node' created using: (MySQL specific data included) CREATE TABLE `exampledb`.`node` ( `id` int(11) NOT NULL auto_increment, `parent_id` int(11) default NULL, PRIMARY KEY (`id`), KEY `FK6D20BC9B57485125` (`parent_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci; This table holds id's of nodes as well as the id of their parent node. For example this tree (nodes represented ...

74. java sql query    coderanch.com

75. problem with SQL query....    coderanch.com

One thing I dont understand is how can Java throw a NullPointerException because a foreign key is null in the SQL query? The database can throw an error when NULL is inserted in a NOT NULL column. Can't you not insert the row into the table where the foreign key comes from and then fetch it so that you have the ...

76. Expert knowledge needed: loops in sql queries    coderanch.com

hello everybody, I have a problem concerning "loops in sql queries" and would like to explain it on a short simplified example. there is one table containing website clicks with the following columns (Microsoft SQL): - UserID for every user - Kind of ressource (information, ...) - Click-Time (Exact timestamp concerning the click, in seconds) e.g.: UserId: Kind of r.: C-Time: ...

77. SQL query help    coderanch.com

78. sql query returning duplicates    coderanch.com

79. Tool for generating structured XML data from SQL queries    coderanch.com

Hi, I have been given the task of generating XML documents by extracting data from a database and then structuring it as needed and then outputing XML. The XML produced is completely determined by a configuration file. I didn't find much information on the web about this, but it seems to me that the best approach is to use DOM to ...

80. sql query in web.xml or property file    coderanch.com

81. unreadable code due to externalization of SQL queries    coderanch.com

Hi, We have a java legacy code which is using direct JDBC calls with loads of SQL queries embedded in code and is working fine for database X. This code needs to support a new database Y and for that we have externalized the queries. The approach is to use hierarchy of resource bundles where common queries are in base file ...

82. where to put SQL queries ?    coderanch.com

Hi, I am currently working on a Project in which all the PL/SQL queries has been hard coded inside the java code, My PM asked me to provide some solution to avoid this..He also suggested me to put these queries into one database table whereas I suggested him to put all these queries into one properties file and fetch them from ...

83. Java won't send SQL query    coderanch.com

I'm trying to have Java read some basic information from a MySQL database and echo it. I've searched online and as far as I can tell my code matches what I've found. However, the result is a null returnSet. A couple of classes here: import java.sql.*; public class mySQLHandler { String action, mySQLQuery, username, pass; String[] result; String url; Connection con; ...

84. Handling errors when running SQL query    coderanch.com

Hi Guys I have the following method in my sql bean: public boolean exUpdate(String Query) { PreparedStatement pstmt; try { pstmt = conn.prepareStatement(Query); pstmt.executeUpdate(Query); pstmt.close(); conn.close(); return true; } catch (Exception e) { System.out.println("Exception : "+ e.getMessage()); return false; } }I am alittle inexperienced when it comes to handling errors. I am using a try/catch which will log errors, I also ...

85. How to find IP address by SQL Query    coderanch.com

So you have a table, and one of its attributes is an IP address. What are the other attributes that you can use to find any particular record? Is this a server application, and you're trying to find the record for the client IP? You really haven't provided enough information to help you.

86. SQL queries    coderanch.com

87. Help in SQL Query    coderanch.com

88. SQL Query Suggestions    coderanch.com

I have 3 tables as shown below. i want to retrieve all the 'Rest' that has 'Ant_id = 1 and 2 and 3 and 4 so on'... i tried the below queries...din work suggestions please! Table Rest ---------- Rest_id Rest Table Ant --------- Ant_id Ant_name Table RestAnt ------------- Rest_id Ant_id 1.select rest from rest where rest_id in ( select rest_id from ...

89. sql query error    coderanch.com

If you think of dynamically composing your query you can do this. But you should not. Working with parameters and setting these parameters enables the database to parse the select statement only once and then use the parsed statement with different parameters. I'm not sure if this is an answer to your question...

90. Query regarding Order by clause in an SQL    coderanch.com

Hi, when we give an order by clause, SELECT columns FROM tables WHERE predicates ORDER BY column ASC/DESC . and the records will be returned , sorted based on column value. Consider one scenario like the column value is same for more than one records. So in what order will those records be returned, is there any particular way those records ...

91. A question on SQL query    coderanch.com

Is it possible to write a query for the following? Say I have a table "Account" as below ACCTNO -- FUNDID -- UNITS 64746-------200----------6 64746-------200----------7 64746-------201----------4 64746-------201----------6 Now I want to select such that it returns the following rows ACCTNO -- FUNDID -- UNITS 64746-------200----------7 64746-------201----------6 In other words the funds with maximum units. Thanks in advance. Sanat

92. Query Works in SQL, but Not in Java? [SOLVED]    coderanch.com

Hi, I'm not sure why I can't get this to work... The code is: rs = statement.executeQuery("SELECT TOP 1 CPA_Offer.AdvertiserID, CPA_Advertiser.subConcat " + "FROM CPA_Offer" + "INNER JOIN CPA_Advertiser" + "ON CPA_Offer.AdvertiserID = CPA_Advertiser.AdvertiserID " + "WHERE OfferID = " + offerID); If I copy and past this into SQL Query Manager, it works fine: SELECT TOP 1 CPA_Offer.AdvertiserID, CPA_Advertiser.subConcat FROM ...

93. SQL Query    coderanch.com

Hello everyone.. I am poor in writing sql queries so i need help... in my table i have two columns like: team and result_code team is simple name of different teams, whereas in result_code i have repetation of four types of values like rpc, tpc,npc and sis Now i need to display team and its relative count of 'rpc' that each ...

95. App that allows users w/no SQL experience to build SQL queries    coderanch.com

I'm taking a small SQL server database and building a GUI that allows end users with no/SQL experiences to build their own queries. The end-user just interacts with a form composed of checkboxes and drop down boxes. I want to take that input and programmaticly form a select statements, join conditions, etc in the background. Problem is - I've never done ...

96. JDBC SQL QUERY PROBLEM    coderanch.com

97. sql query    coderanch.com

"SELECT QC_CHRG_RATE, QC_LKP_SA FROM QC_CHRG_RATE WHERE QC_RATE_TBL = " + rateTableID + " AND QC_RATE_TBL_EFF_DT = '" + effDate.getDBFormattedDate() + "' AND QC_LKP_KEY = '" + lookupKey + "' AND QC_LKP_AGE2 >= " + lookupAge + " AND QC_LKP_CLMN_NUM >= " + lookupColumn + " ORDER BY QC_LKP_AGE2 ASC, QC_LKP_CLMN_NUM ASC"; how this SQL will run

98. SQL Query returning null    coderanch.com

99. SQL query    coderanch.com