How can I write Join statements on dataset..
I have data in xml format..I can load that data into a dataset..
but how do i fetch data from two datatables using a join query
I'm developing an app that requires the storage of Portuguese characters. I was wondering if I need to do any configuration to prepare my SQLite db to store those considered special characters. When I query a db table that contains those characters I get a '?' (without quotes) in their place.
best regards,
mp
How can I replace CHAR with VARCHAR2 in all tables in a schema?
Note: I'm content with a query that returns the ALTER TABLE statements so I can save the script and run it again.
Anyone have a good reference guide for GQL (query language for google appengine datastore)?
I find the reference guide on the google appengine site very limited with examples
I am having an issue here i have a list
this.Ddown having 3 properties
i want to write a Linq Query to return one of the property lets say i have property a,b,c
i want to retutn list(c)
how do i do that in linq
Hi,
Anyone know how to do an update with a join (i.e. update on two tables in one query) in Doctrine 1.2?
I spotted something obscure on a forum that hinted that this is not supported in 1.x but it was about as vague as it comes.
Thank you.
Hi friends,
I want to insert 3 rows at a time in a table based on select statement..
consider the query
insert into tblTemp
(
a,b
)
select a, b from tblTemp2
This lets me insert one row in tblTemp..
my requirement is to add 3 rows with iterative values a,a+1,a+2 for each b inserted.
I have a Location that can have Events. I want to have an upcoming_events method but want it to round down such that if someone looks at 10pm at night, it will show todays events. I have this:
def upcoming_events
d=Time.new
d.strftime("%m-%d-%Y")
l=Event.where('location_id=? and start_datetime>?',self.id, d)
end
I gets converted down correctly but in d.strftime but the query is:
SELECT `events`.* FROM `events` WHERE (location_id=301 and start_datetime>'2012-06-20 02:49:23')
Any idea how to just get it to do '2012-06-20'?
Is there any way I can find the rank of a set of values in Microsoft Reports?
For instance, in order to produce a table like the one below, what function/formula do I enter in the Rank column?
+------+-----+
|Value | Rank|
+------+-----+
| 12 | 3 |
| 30 | 5 |
| 5 | 1 |
| 10 | 2 |
| 24 | 4 |
+------+-----+
Update
Values in the value column are produced from calculations on the report-side so I cannot find the rank using a query.
I am learning rails and am toying with a simple web-app that integrates with flickr to search photos based on user given criteria and store the query in a search history table.
I am seeking the best or 'rails' way of handling this. Should I setup a controller and non-resource routes that handle the search and store the data in a custom table; or should I create a resource for queries with a resource route and an additional path for search?
Hello,
In a Java method, I'd like to use a Jersey client object to do a POST operation on a RESTful web service (also written using Jersey) but am not sure how to use the client to send the values that will be used as FormParam's on the server. I'm able to send query params just fine.
Thanks in advance.
When using this SQL query:
"Select * from table_name"
what happens if the name of the table contains blankspaces? Is there an special SQL sintax for selecting a table with a name such as "Author Code"?
I have 3 database tables:
article
article_has_tag (2 FK's to the other tables)
tag
I currently show a list of articles with the article's tags shown underneath but the number of queries grows as the list gets longer.
I want to loop over all the articles and get the tag objects from each one in turn.
Can it be done in 1 propel query?
I want to get and pass the HTML element(a textbox) value as a query string to the Ajax.ActionLink(), is this possible? If yes, then please tell me how? Thanks in advance
Hi
All i need is a simple explanation on how does this function work
I also attached a piece of php which I think is the one that retrieves the data from the database. Please correct me if I'm wrong
Cheers.
function loadDatabaseRecords ()
{
// Mozilla/Safari
if (window.XMLHttpRequest)
{
xmlHttpReq = new XMLHttpRequest();
}
// IE
else if (window.ActiveXObject)
{
xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
alert ("To Server (Load Records):\n\najax-open-DB.php");
xmlHttpReq.open('GET', "ajax-open-DB.php", true);
xmlHttpReq.onreadystatechange = loadDatabaseRecordsCallback;
xmlHttpReq.send(null);
}
<?php
$link = mysql_connect ("ipaddress", "localhost", "password");
mysql_select_db ("database1");
$query = "SELECT * from addressbook";
$result = mysql_query ($query);
print "<table>";
print "<tr>";
print "<th>Firstname</th><th>Lastname</th><th>Address</th><th>Telephone</th>";
print "</tr>";
for ($i = 0; $i < mysql_num_rows ($result); $i ++)
{
$row = mysql_fetch_object ($result);
print "<tr>";
print "<td>$row->firstname</td>";
print "<td>$row->lastname</td>";
print "<td>$row->address</td>";
print "<td>$row->telephone</td>";
print "</tr>";
}
print "</table>";
mysql_close ($link);
?>
How to specify blob type in MS Access? I have office 2007 installed. I am using jdbc, but this should not matter for the SQL query I am passing. Tried to pass a length to it, or FILE type, did not help.
CREATE TABLE mytable (
[integer] INTEGER not null,
[string] VARCHAR (255),
[datetime] DATETIME,
[boolean] BIT,
[char] CHAR,
[short] SHORT,
[double] DOUBLE,
[float] FLOAT,
[long] LONG,
[blob] BLOB, // does not work
Primary Key ([integer])
)
My intention here is to select all entries (Bookings) between "begin" (begin_prefix) and "end" (end_prefix)
BUT! The important thing is:
If I have a booking at 07:25-10:00 - you query for 09:00-10:00 it should still show the booking because it reserves the room until 10 no matter what ..
So ..
07.25-10.00 booking means query for 09:00-10.00 still returns a list of bookings within 09:00-10.00 (which means 07.25-10.00 is included)
public static List<booking> Today(DateTime begin, DateTime end)
{
try
{
IFormatProvider Culturez = new CultureInfo(ConfigurationManager.AppSettings["locale"].ToString(), true);
DateTime begin_prefix = DateTime.ParseExact(begin.ToString(), "dd-MM-yyyy HH:mm:ss", Culturez);
DateTime end_prefix = DateTime.ParseExact(end.ToString(), "dd-MM-yyyy HH:mm:ss", Culturez);
dbDataContext db = new dbDataContext();
// gives bookings BEFORE begin_prefix (why?)
IQueryable<booking> bQ = from b in db.bookings
where begin_prefix >= b.Starts &&
b.Ends <= end_prefix &&
b.Ends > b.Starts &&
b.pointsbookings.Count > 0
select b;
// ^gives bookings BEFORE begin_prefix (why?)
List<booking> bL = bQ.ToList();
return bL;
}
catch (Exception)
{
throw;
}
}
I've tried getting this right for some time now .. Seems everytime I correct it to something new, a new overlap or selection outside the two begin/end dates seem to appear :(
UPDATE CRITERIA and SOURCE: Bookings has to be WITHIN "begin_prefix" and "end_prefix" or on the exact same time ..
.. currently the above code gives me bookings BEFORE begin_prefix date, which is not intentioned! We're in 2011, I got bookings from 2010 as well! **
NEW!! UPDATED:
This is what I have:
SEARCH.START = BOOKING.START
BOOKING.END <= SEARCH.END
... the problem comes up when ..
BOOKING entry: 10:00(Start)-14:00(End)
This means according to above:
08.59 = 10.00
(SEARCH.START = BOOKING.START)
It will never include it. But it should, since this is the same room and the seats are booked individually!
I have following two tables
LandParcels Table
Blockid ParcelNo storPri
======= ======== =======
52000105 3 State
52000105 4 Private
52000105 5 State
Actions Table
Blockid ParcelNo ActionTaken
======= ======== ===========
52000105 3 Received
52000105 3 Send to Computer
52000105 4 Received
52000105 5 Received
I want to find the records Received but not Send to Computer
Here is my query
select
l.blockid, l.parcelno
from
landparcels l
left join
actions ac on l.blockid = ac.blockid and l.parcelno = ac.parcelno
where
ac.actiontaken = 'Received'
and ac.actiontaken <> 'Send to Computer'
and ac.blockid = 52000105
The result is
Blockid ParcelNo
======= ========
52000105 3
52000105 4
52000105 5
I want ParcelNo 4 and 5
Our system is written completely in PHP.
For various business reasons (which are a given) I need to build the reports of the system using JasperReports.
What architecture should I use? Should I put the Jasper as a stand alone server (if possible) and let the php query against it, should I have it generate the reports with a cron, and then let the PHP scoop up the files and send them to the web client/browser...
What is the recommended way of setting GET query parameters on a Restlet Request object?
I think I can see how to get them out of the request using getQueryAsForm(), but how do they get set in the first place?
At the moment, I am adding them manually to the URL using a StringBuilder and java.net.URLEncoder, but it seems like there should be a better way.
I frequently upload CSV files to a MySQL db.
It is very convenient to use LOAD DATA LOCAL INFILE to upload the data, but I can't use this to create the table itself. As of now, the best method I have is to use PHP to get the field titles from the first row of the file and then put together a CREATE table query. Is there a more convenient way to do this?
Let's say I have a table with millions of rows. Using JPA, what's the proper way to iterate over a query against that table, such that I don't have all an in-memory List with millions of objects?
I suspect that the following will blow up if the table is large:
List<Model> models = entityManager().createQuery("from Model m", Model.class).getResultList();
for (Model model : models)
{
// do something with model
}
Is pagination (looping and manually updating setFirstResult()/setMaxResult()) really the best solution?
Is it possible to implement the following query using Criteria API?
select order from ORDER as order,ITEM as item
where item.itemID like 'ITM_01' and item in elements(order.items)