resultset

Problem with Sphinx resultset larger than 16 MB in MySQL

Hello All, I am accessing a large indexed text dataset using sphinxse via MySQL. The size of resultset is on the order of gigabytes. However, I have noticed that MySQL stops the query with following error whenever the dataset is larger than 16MB: 1430 (HY000): There was a problem processing the query on the foreign data source. Data so...

When accessing ResultSets in JDBC, is there an elegant way to distinguish between nulls and actual zero values?

When using JDBC and accessing primitive types via a result set, is there a more elegant way to deal with the null/0 than the following: int myInt = rs.getInt(columnNumber) if(rs.wasNull())? { // Treat as null } else { // Treat as 0 } I personally cringe whenever I see this sort of code. I fail to see why ResultSet was not defined to...

Save XML to Recordset

Hi All, I am working on android, and I am parsing a huge XML file. so all the time I need to get some data from that XML file, which is making the application very slow. Is there any way that I can create a data set/record set/result set of the XML file so that later I can get the data from the newly created set. and also how to read...

Can php query the results from a previous query?

In some languages (ColdFusion comes to mind), you can run a query on the result set from a previous query. Is it possible to do something like that in php (with MySQL as the database)? I sort of want to do: $rs1 = do_query( "SELECT * FROM animals WHERE type = 'fish'" ); $rs2 = do_query( "SELECT * FROM rs1 WHERE name = 'trout'" ); ...

Last results submitted in mysql db

How would i get the last 20 results submitted in a mysql db row. I need the 20 most recent user submitted results. Cheers. ...

Weird Excel Formatting

Recently a new co-op was hired at our company and has been tasked to run a report. The report queries the database and returns a resultset and from there procedes to create the spreadsheets. Depending on the number of days selected a different number of reports are generated but I do not believe that is relavent to the question. Basicall...

SSIS - How do I use a resultset as input in a SQL task and get data types right?

I am trying to merge records from an Oracle database table to my local SQL table. I have a variable for the package that is an Object, called OWell. I have a data flow task that gets the Oracle data as a SQL statment (select well_id, well_name from OWell order by Well_ID), and then a conversion task to convert well_id from a DT_STR o...

General purpose Table structure in Java (like ResultSet)

Does anyone know if there's a good general-purpose Table-based structure that I can use for manipulating data? ResultSet is an interface, so am I stuck having to fully implement something if I want similar functionality without a database? Apache Commons Collections does not seem to have anything immediately suitable. ...

NHibernate - Stream large result sets?

Hi, I have to read in a large record set, process it, then write it out to a flat file. The large result set comes from a Stored Proc in SQL 2000. I currently have: var results = session.CreateSQLQuery("exec usp_SalesExtract").List(); I would like to be able to read the result set row by row, to reduce the memory foot print Thanks ...

Why is this loop over mysql resultset slow? (1.4ms per cycle)

The $res contains around 488k rows the whole loop takes 61s! that's over 1.25ms per cycle! What is taking all that time? while($row = $res->fetch_assoc()) { $clist[$row['upload_id']][$row['dialcode_id']][$row['carrier_id']]['std'] = $row['cost_std']; $clist[$row['upload_id']][$row['dialcode_id']][$row['carrier_id']]['ecn'] = $...

Checking for a null int value from a Java ResultSet

In Java I'm trying to test for a null value, from a ResultSet, where the column is being cast to a primitive int type. int iVal; ResultSet rs = magicallyAppearingStmt.executeQuery(query); if (rs.next()) { if (rs.getObject("ID_PARENT") != null && !rs.wasNull()) { iVal = rs.getInt("ID_PARENT"); } } From the code fragment above,...

mysql_num_rows(): supplied argument is not a valid MySQL result resource

I am getting this error when I pass an invalid SQL string... I spent the last hour trying to find the problem assuming - It's not my SQL it must be the db handle... ANyway, I've now figured out that it was bad SQL... What I want to do is test the result of the mysql_query() for a valid resultset. I am simply using empty($result)... Is ...

How to find out if a Java ResultSet obtained is empty?

Class.forName("org.sqlite.JDBC"); Connection conn = DriverManager.getConnection("jdbc:sqlite:userdata.db"); Statement stat = conn.createStatement(); ResultSet rs = stat.executeQuery("SELECT * from table WHERE is_query_processed = 0;"); int rowcount = rs.getRow(); System.out.println("Row count = "+rowcount); // output 1 rs.first()...

how can i send resultset in JAX-WS

i am building a web service in java and my client is .net for example my table contains String "name",String "surname", and Integer "id" and i want to send all of them my question is, which type should the method return? ...

How can I identify columns when SELECTing from multiple tables with JDBC?

I have two tables that I join on the id-column, they look like: +-------+ | users | +----+--+---+ | id | name | +----+------+ +-------+ | posts | +-------+------+---------+ | id | user_id | message | +----+---------+---------+ And now I want to select all posts and include the username, with: SELECT * FROM posts, users WHERE user_id...

Loop through resultset and add create comma seprated string in ASP Classic

Here's my ASP Classic: set irs = recordset(sql,PageDB) if not irs.eof then dim new_list new_list = "" do while not irs.eof 'Add irs("name") to new_list and seperate by comma irs.movenext loop end if kill(irs) How would I add irs(name) to new_list ...

Is it best to make fewer calls to the database and output the results in an array?

I'm trying to create a more succinct way to make hundreds of db calls. Instead of writing the whole query out every time I wanted to output a single field, I tried to port the code into a class that did all the query work. This is the class I have so far: class Listing { /* Connect to the database */ private $mysql; function __constr...

Getting the count of rows in a Java resultset

Hello Does anyone know a better way of getting the number of rows in a Java resultset returned from a MySQL database? I'm currently using this: public static int getResultSetRowCount(ResultSet resultSet) { int size = 0; try { resultSet.last(); size = resultSet.getRow(); resultSet.beforeFirst(); } ...

Capture resultset from a stored procedure with varying columns

I am trying to capture the result set of a stored procedure where the number of columns and their data types vary each time. I know if I had a linked server (or had the permission to create one - which I don't) that would refer to its own server I could use openquery to do a select into statement but that is not being possible. Is ther...

wordpress sort search results by date .

Is there any special parameter that i can pass to search url to sort it by date . And is there any parameter to increase the number of search results returned ? Thanks ...