select

How to set minvalue of sequence to result of a select query?

Hello all, I am trying to create a sequence in oracle sql, using the "minvalue" as the result of a select query. The select query I'm trying to run is: SELECT MAX(customer_id) + 1 FROM customer I know it's easy with an anonymous pl/sql, but I'd like to find a way which doesn't use pl/sql. Some ideas I've had include the ...

Manipulate File Descriptors for select.select in Python

Hello everyone, I have an itching problem I know could be solved using many different ways, but I would still like to know if the following approach is possible in Python. Suppose I have some socket I am constantly waiting for input on, and there is some condition that eventually terminates the whole program. I want to do it in a BLOCK...

Replace a word in BLOB text by MySQL.

Hello! I've got a huge mysql table (called tcountriesnew) and a column (called slogen, blob type). In each of those slogen blobs I'd like to replace a word, for example: banana to apple. Unfortunately I tried to print all the rows with word banana, and it did not work. select * from tcountriesnew where slogen like '%banana%'; Please ...

<select> tag doesn't work in UIWebView on iOS4

Hello heroes, I'm new to iOS programming, so please allow me to ask stupid questions if it is :) I have a program, using UIWebView to load HTML page and display to the end users. The page is quite simple, <select> <option>A</option> <option>B</option> <option>C</option> <option>D</option> </select> WebView controlle...

select second largest from a table without limit

How we can select the second largest mark or whatever from a table without using the LIMIT ? I know it is possible using LIMIT, but is it possible without using that? suppose we have the columns id and marks. ...

How to detect all change/click events of HTML select that still has focus?

How can I reliably detect all events that cause the the value of an HTML select to change, while that element still has the focus? For regular mouse input, either the click or change event works fine. For keyboard input (and for mouse input using the scroll wheel), however, the change event doesn't fire until focus is lost. I get around...

Populate radiobutton group with data from squlite database

Hi! I am writing a game app for Android, where a question word with four different alternatives will show that the user can choose between. I have a database and i can insert from the app, but what would be the easiest way to use a select statement, and then parse the response and populate the five different positions in the radio group...

SQL Syntax Issues

I can't for the life of me figure out what's wrong with this sql statement select top(1) OrderNumber from (select top(5) OrderNumber from SomeTable where TreePath='tests' order by OrderNumber asc) Any Ideas? Regards, Byron Cobb. ...

SQL CASE statements on Informix - Can you set more than one field in the END section of a case block?

Using IBM Informix Dynamic Server Version 10.00.FC9 I'm looking to set multiple field values with one CASE block. Is this possible? Do I have to re-evaluate the same conditions for each field set? I was thinking of something along these lines: SELECT CASE WHEN p.id = 9238 THEN ('string',3) END (varchar_field, int_field); Where the...

How Do I read an Excel 2007 spreadsheet with more than 65535 rows?

Here's what my connection string looks like.. m_conn = new OleDbConnection(String.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=" + (char)34 + "Excel 12.0;HDR=YES" + (char)34, m_fileName)); When I do a select, I only get 65535 rows back but I know the excel spreadsheet has at least 100,000. How Do I re...

Problem retrieving id with html: select

Hello, I have in my jsp with a table on each line a combo, the problem is that I can not get the value selected in my combo during a submit I think the problem is the definition of property JSP: <logic:notEmpty name="gererUtilitaireForm" property="listUtilitaireBean"> <%int i=0; %> <logic:iterate...

select overlapping datetime events with SQL

Hi. I have a SQL table Events (ID int, Event int, StartTime datetime, Duration int). Event is event code (1=system running, 2=break) Duration is the amount of seconds that the event was active. I'd like to get the amount of seconds that event 1 was active, but subtract the duration of event 2. E.g. event 1 was from 1:00 to 6:00, even...

R: How to select not continous rows?

Hello How can I select several not continuous rows ? If I wanted to select rows 1 to 7 I'll write mydata[,1:7] But what if I need to select rows 1 to 5 and 10 to 15? ...

set item in select list to be selected

I have a select list like so: <select id="drpColours"> <option value="" selected="selected">Choose color</option> <option value="1">black</option> <option value="2">BLUE</option> </select> I can I set the selected item based on the text item and not the value. So if i pass "Blue" to a function, I want the function to set the 3rd item ...

sql server conditional select into temp table

I'm working in SQL Server 2008, and I'm trying to select into a temp table based on a certain condition...for a report, I need up to 18% of the records to be of a certain product type. if ((@totalRecords * .18) > @productTypeCount) select * into #tmpLP_REIT from myTable where productType = @productType else select top 18 per...

html select php processing question?

i have this select box that users can use to choose an option, but im stuck on how i can process it with php and insert the value in mysql: <select name="vote[]"> <option value="support">I support this</option> <option value="against">Im against this</option> <option value="dont">I want the audience to decide!</option> $insert...

Is there a way to get SQL Server to automatically do selects on hash values of nvarchar fields?

I'm not sure how to better phrase this question so it's possible I missed a previously asked question. Feel free to close this and point me to the correct one if it exists. I have a table with two important columns (that is to say it has much more but only two is pertinent to this question). First column is a GUID (an id) and the second...

MongoDB extract only the selected item in array

Suppose you have the following: // Document 1 { "shapes" : [ {"shape" : "square", "color" : "blue"}, {"shape" : "circle","color" : "red"} ] } // Document 2 { "shapes" : [ {"shape" : "square", "color" : "black"}, {"shape" : "circle", "color" : "green"} ] } do query: db.test.find({"shapes.color":"red"}, {"shapes.colo...

mark specific dataset in filtered grid

i'm just struggling through the following situation - there's a datasource added to a grid in axapta 2009, filtered by a querybuildrange. i want to mark a specific dataset by x++ via datasource_DS.findrecord( specificRecord ) this works as intended, removing the filter, but not having the filter active! a workaround to remove the fi...

UPDATE and SELECT in MySQL

Can anyone help me on how can I update one table having a selection to another table in WHERE clause.. My query is looks like this but it is an error.. UPDATE empinfo e SET e.tellno='32154' WHERE e.empno IN (SELECT ei.empno FROM empinfo ei WHERE ei.tellno <> '123456'); Your response is highly appreciated.. :) ...