I'm confused as to the difference. Being fairly new to .Net, I know I can query IEnumarables using the Linq extensions. So what is this IQueryable and how does it differ?
I have a perl script, which takes a query string parameter, connects to a database and displays data.
I'd like to include that script in a PHP file like so:
include('perlscript.pl?item=302');
Such that the perl script's response is displayed on the PHP/HTML page.
How can I do this?
i have a query
OleDbCommand com = new OleDbCommand("select * from techs where actd0v between '" + TextBox1.Text + "' and '" + TextBox2.Text + "'" , con);
where textbox 1 and 2 are the specified dates in which i want to retreive some date related to those dates.but when i m trying to find the data between the given dates it gives me some dates which are not included in between them.is there any pattern i need to specify to get all the dates which occur in between the specified dates.
i m using ms access database for my project.
Hi.
I'm using sql plus to execute a query (a select) and dump the result into a file, using spool option.
I have about 14 millions lines, and it takes about 12 minutes to do the dump.
I was wondering if there is something to make the dump faster?
Here below my sql plus options:
whenever sqlerror exit sql.sqlcode
set pagesize 0
set linesize 410
SET trimspool ON
set heading on
set feedback off
set echo off
set termout off
spool file_to_dump_into.txt
select * from mytable;
Thanks.
How do you specify the the row terminator when outputting query results using sqlcmd?
bcp is not an option.
sqlcmd -E -s" " -Q "Select * From SomeTable" -o C:\Output.txt -W
What is the default row terminator?
After processing form from POST I should redirect, to prevent user from hitting back. However, I am using form to determine search query on a database, so I need to either pass params to the redirected site or the result of a search. Or maybe there is some other good practice, how to solve this problem? Maybe in this situation I am allowed not to redirect (nothing happens, if user performs search again).
Hey all-
I'd like to add an index to a table that already contains data. I know that there a few records currently in the table that are not unique with this new index. Clearly, MySQL won't let me add the index until all of them are.
I need a query to identify the rows which currently have the same index. I can then delete or modify these rows as necessary. The new index contains 6 fields.
Thanks-
Jonathan
I have this query:
SELECT mt.*, fordon.*, boende.*, elektronik.*, business.*, hem_inredning.*, hobby.*
FROM classified mt
LEFT JOIN fordon ON fordon.classified_id = mt.classified_id
LEFT JOIN boende ON boende.classified_id = mt.classified_id
LEFT JOIN elektronik ON elektronik.classified_id = mt.classified_id
LEFT JOIN business ON business.classified_id = mt.classified_id
LEFT JOIN hem_inredning ON hem_inredning.classified_id = mt.classified_id
LEFT JOIN hobby ON hobby.classified_id = mt.classified_id
ORDER BY modify_date DESC
I need to implement a count here, to just count all rows in combination with the JOINS you see.
How should I do this?
SELECT COUNT(mt.*, fordon.* etc) FROM ? // This method wont work
Thanks
i have a pgsql table with fields id, identifier, name.
id serial NOT NULL,
identifier character varying(16),
name character varying(128)
I want to fetchAll values from the table orderby identifier.
but identifier is having values
12, 100, 200, 50
and after $table->fetchAll(null, 'identifier');
is giving the result
100, 12, 200, 50
but I want the result as
12, 50, 100, 200
or using a direct query?
I have a simple SQL query (using SqlCommand, SqlTransaction) in .NET 2.0 that returns a table of integer-string pairs (ID, Name). I want to get this data into a dictionary like Dictionary.
I can get the result into a DataTable, but even iterating over it, I'm not sure how to do the typing and all that stuff. I feel like this must be a common problem but I haven't found any good solutions.
Thanks in advance.
Hi guys,
In the Apple docs it says that
JavaScript execution time is limited to 10 seconds for each top-level entry point.
If your script executes for more than 10 seconds, Safari on iPhone OS stops executing the script at a random place
I plan to have some Javascript run every 10 seconds or so that will do an AJAX query to the server and rewrite just the section of the page necessary. Will this be possible with these restrictions on the device?
I have a need to query an existing Sybase ASE database and would like to use Linq syntax for my data retrival.
I don't need write access, nor do I need the full set of Linq operators, just Select(),
SelectMany(), Where(), and GroupJoin()
What are options are available?
In particular, I'm wondering about nHibernate and building a new Linq2Sybase provider based on the IQ toolkit.
I'm using the "join_table" function with Kohana's ORM to build a query. The following works:
$category = ORM::factory('category')->join_table('product');
But this doesn't:
$category = ORM::factory('category');
$category->join_table('product');
The documentation uses the second as an example, but it returns 0 while the first example returns "categories_products" which is correct. Any ideas?
Hi,
Not really a coding question more a little help with my idea of a Relational database.
If I have 3 tables in a SQL database. In my php script I basically query the companies which are in industry "a" and then insert a row into a separate table with their details such as companyId , companyName etc is that a type of Relational database ?
I have explained it in a simple way so we don't get confused what I am trying to say.
I want to write a query like this:
SELECT o.OrderId, MAX(o.NegotiatedPrice, o.SuggestedPrice)
FROM Order o
But this isn't how the MAX function works, right? It is an aggregate function so it expects a single parameter and then returns the MAX of all rows. Does anyone know how to do it my way?
I have two tables from two different Data Contexts. Although both tables are from the same database, two separate datacontexts exist.
Error msg: "The query contains references to items defined on a different data context."
How can I get around this? Any help is appreciated. Thanks.
Hi,
Not really a coding question more a little help with my idea of a Relational database.
If I have 3 tables in a SQL database. In my php script I basically query the companies which are in industry "a" and then insert a row into a seperate table with their details such as companyId , companyName etc is that a type of Relational database ?
I have explained it in a simple way so we don't get confused what I am trying to say.
does anyone tried doing cache for spring-ntlm NtlmProcessingFilter.java file so that every request no need to query from microsoft active directory to authenticate user ? how to implement such cache using ehcache
Is this a correct way for id generation in MySQL ?
INSERT INTO Picture
(PictureId,First_pick,Title,Description,File_Name,Is_Vertical)VALUES
((SELECT max(pictureid)+1 FROM Picture),0,?,?,?,?)
I mean if it is guaranted that PictureId will be unique when this query is run by many threads ?
I can't modify table structure. Should I use any specific locks, index or transaction isolation level ?
Regards, Michal
In Socket Programming, how will a Unix thread receive a Socket CLOSE event from a client if connection is closed?
Are there any API's which will notify the unix thread about the CLOSE event received?
As in Windows we have WSAEnumNetworkEvents API which gets the event notification for a specified socket descriptor. What will be the equivalent API used in the Unix socket programing?
Please provide the help for the query.
I have a polymorphic association (Class Table Inheritance) and I need use DQL to query entities of a specific child class wich can be done using "x INSTANCE OF Entity" in WHERE clause. Now I need to put conditions specific for that child class but I get this error:
"Class Person has no association named student_field_1"
Person = Parent Class
Employee = Child class
Student = Child class
is there any way yo cast of somehow tell Doctrine that the Person is actually a Student and to allow me to put Student fields in the WHERE?
Hi ,
Suppose I have a page abc.aspx in it I have a user control ucx123.ascx. I am fragment caching the user control and the cache is vary by param. The parameter is some id in the querystring.
I want to add a sql cache dependency with respect to sql query.
The scenario is I added the dependency but the cache is not invalidating
In the following model:
class header(models.Model):
title = models.CharField(max_length = 255)
created_by = models.CharField(max_length = 255)
def __unicode__(self):
return self.id()
class criteria(models.Model):
details = models.CharField(max_length = 255)
headerid = models.ForeignKey(header)
def __unicode__(self):
return self.id()
class options(models.Model):
opt_details = models.CharField(max_length = 255)
headerid = models.ForeignKey(header)
def __unicode__(self):
return self.id()
If there is a row in the database for table header as
Id=1, title=value-mart , createdby=CEO
How do i query criteria and options tables to get all the values related to header table
id=1
Also can some one please suggest a good link for queries examples,
Thanks..
Is there a way to determine what kind of data plan a device has so an app provides a less rich experience if a data plan is not available? I imagine the connector factory would still be able to return me an HTTPConnection but it would cost the user serious money for lots of data, and I'd like to be nice and prevent that.
I thought there would be a way to query device capabilities in the MIDP API, but maybe it's in CLDC?
DECLARE @mycur CURSOR
DECLARE @id int
DECLARE @ParentNodeName varchar(max)
DECLARE @NodeName varchar(max)
DECLARE @NodeText varchar(max)
SET @mycur = CURSOR
FOR
SELECT * FROM @temp
OPEN @mycur
FETCH NEXT FROM @mycur INTO @id,@ParentNodeName,@NodeName,@NodeText
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT @id -- sample statements
PRINT @ParentNodeName
PRINT @NodeName
SET @x.modify
('
insert attribute status {sql:variable("@status")}
as first
into (/@ParentNodeName/@NodeName/child::*[position()=sql:variable("@status")])[1]
')
FETCH NEXT FROM @mycur INTO @id,@ParentNodeName,@NodeName,@NodeText
END
DEALLOCATE @mycur
Any idea why I am getting this error as query works fine if I manually insert path