select

SQL Server - how to set (nolock) hint as a default?

is there some way to tell sql server to use the (nolock) hint or every select in a stored procedure? is pretty tiresome to add it to each an every select.... ...

mysql select into outfile /tmp no output

Hello, I cannot get the following code to generate any output. The MySQL user has "all" grant level, /tmp is writable, the query returns a results set. mysql> SELECT field FROM test_table WHERE condition='test' -> INTO OUTFILE '/tmp/test.csv' -> FIELDS TERMINATED BY ',' -> ENCLOSED BY '"' -> LINES TERMINATED BY '\n'; ...

SQL conditional SELECT

Hi I would like to create a stored procedure with parameters that indicate which fields should be selected. E.g. I would like to pass two parameters "selectField1" and "selectField2" each as bools. Then I want something like SELECT if (selectField1 = true) Field1 ELSE do not select Field1 if (selectField2 = true) Field2 ELSE do no...

Speeding up non-blocking Unix Sockets (C++)

I've implemented a simple socket wrapper class. It includes a non-blocking function: void Socket::set_non_blocking(const bool b) { mNonBlocking = b; // class member for reference elsewhere int opts = fcntl(m_sock, F_GETFL); if(opts < 0) return; if(b) opts |= O_NONBLOCK; else opts &= ~O_NONBLOCK; ...

how to show/hide divs by select.(jquery)

my code: <select id="select"> <option id="1" value="thai language">option one</option> <option id="2" value="eng language">option two</option> <option id="3" value="other language">option three</option> </select> <div id="form1">content here</div> <div id="form2">content here</div> <div id="form3">content here</div> what i want is to...

Total with select query

Hi, Consider the following data: Insurance_Comp | 1To30DaysAgeing | 31To60DaysAgeing | 61To90DaysAgeing | TotalVehicles ============================================================================= ABC | 30 | 5 | 20 | 55 XYZ | 10 | 35 | 5 | 50 I am calculating the number of vehicles aged for particular group after a stock# is assi...

Searching for object in IList or IQueryable

Hi There I need to find a match of an item in a IQueryable list. I have a list as follows: IQueryable<EventItem> eventItems = new Queryable<EventItem>(); EventItem eventItem1 = new EventItem("Event 1"); EventItem eventItem2 = new EventItem("Event 2"); eventItems.Add(eventItem1); eventItems.Add(eventItem2); I now want to find the eve...

Select Max in Linq to Entities / Entity SQL with type conversion

Hey everyone, I'm trying to create some CRUD functionality for a legacy database and using the Entity Framework as an ORM tool. One table, 'Sites', has a Guid type 'Id' column which is never seen by the users and an integer type 'SiteId' which the users use to identitfy a Site. For god knows what reason the numeric SiteId column is of ...

jQuery moving MultiSelect values to another MultiSelect

So I have a MultiSelect box with x values which I need the ability to move to another MultiSelect box and vise versa. <select class="boxa" multiple="multiple"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select> <select c...

sql update from select statement

Sorry for the length of this, I'm trying to give a lot of info to avoid non-relevant solutions. My goal is to embed at least 1 UPDATE statement into a SELECT statement so that I have a chance to update some computed values at the instant before the select statement runs (think of it like a TRIGGER on SELECT). VIEW is not in immediate s...

How do you tell ASP .Net dynamic data to use stored procedures for select?

I see you can specify Insert, Update and Delete stored procs, but no straightforward way for SELECT stored procs. ...

Form problems with php. dynamically selected options and check box

Hi, I'm pulling a list of client names out of one MySQL table to serve as a drop down selection. The data is to be stored on a separate table. I would like the option to come up as selected if there already is a client assigned to the field in the second table. Also, my radio buttons are inputting their data into the wrong fields, an...

MYSQL select statement - 5 results from each user

I'm trying to do a select statement and it works except that it's not limiting the number of results for each user (U.id) to 5. SELECT F.id,F.created,U.username,U.fullname,U.id,I.id,I.cached_image FROM favorites AS F INNER JOIN users AS U ON F.faver_profile_id = U.id INNER JOIN items AS I ON F.notice_id = I.id WHERE faver_profile_...

sending multiple records to MySQL from multiple select box

Hi, I'm trying to insert multiple rows into a MySQL table depending on the number of options selected from a multiple select box. currently it is inserting one row (regardless of how many options are selected) but the 'strategyname' column is empty each time. Any ideas on how to insert multiple rows and why the values of the options ar...

Emulating accept() for UDP (timing-issue in setting up demultiplexed UDP sockets).

For an UDP server architecture that will have long-lived connections, one architecture is to have one socket that listens to all incoming UDP traffic, and then create separate sockets for each connection using connect() to set the remote address. My question is whether it is possible to do this atomically similar to what accept() does f...

how to control which option to be selected in SELECT control?

What I tried is by adding selected,but not working: <select> <option value="-1" selected>--</option> <option value="0">femail</option> <option value="1">male</option> </select> ...

SELECT item types not provided by an entity

So I've got some data. There are entities. Entities have an arbitrary number of items. Items can be one of a defined set of types. An entity can have more than one item of a given type. I can get a list of items that an entity has. What I want is to get a list of types that an entity doesn't have an item for. Here's my schema: entitie...

SQL select statement that shows non-existant column?

Hi, If I have a application that accepts a query that returns 4 columns, 1 of which is an extra info column that can be empty, and the column doesn't exist in the database I am using how could I 'create' it so that the data retrieved using the query always has 4 columns, 1 nbeing empty? ...

Combine Multiple child rows into one row MYSQL

Thanks in advance, I just can't seem to get it! I have two tables Ordered_Item ID | Item_Name 1 | Pizza 2 | Stromboli Ordered_Options Ordered_Item_ID | Option_Number | Value 1 43 Pepperoni 1 44 Extra Cheese 2 44 Extra Cheese What I am looking to o...

How to show which form elements are already selected in PHP

How can I get this code to show which option is already selected? This is basically an edit page and it is pulling info from the database and populating the relative fields I have a drop-down menu, multiple select box, and radio buttons on a page along with some elements. The info is getting displayed in the elements fine, but I can'...