We've got a table of places. The same place may occur multiple times in our table (bad design, not our choice). We had someone go through and find addresses for each of these places. They only updated one of the many instances of each place.
Here is a query that does NOT work, but I think shows what I am trying to do.
update places ...
As soon as my code gets to my while(rs.next()) loop it produces the ResultSet is closed exception. What causes this exception and how can I correct for it?
EDIT: I notice in my code that I am nesting while(rs.next()) loop with another (rs2.next()), both result sets coming from the same DB, is this an issue?
...
Is it possible to do mysqldump by single SQL query?
I mean tu dump the whole database, like phpmyadmin does when you do export to SQL
...
Hi,
I'd like to start a discussion about the implementation of a database system.
I'm working for a company having a database system grown over ca. the last 10 years.
Let me try to describe what it's doing and how it's implemented:
The system is divided into 3 main parts handled by 3 different teams.
Entry:
The Entry Team is respons...
Hello,
I need some help with CASE statements in linq (c#):
osc_products.products_quantity =
CASE
WHEN itempromoflag <> 'N' THEN 100000
WHEN itemcat1 IN ('1','2','31') AND itemsalestatus = 'S' THEN 100000
WHEN itemsalestatus = 'O' THEN 0
ELSE cds_oeinvitem.itemqtyonhand - cds_oeinvitem.itemqtyc...
What exactly happens when I create an index in my SQL Server 2008 DB on a VarChar column. This is obviously a text column.
Will it be automatically fulltext indexed or does it create a different kind of index?
...
In an ActiveRecord (CakePHP flavored) setup I have a HasAndBelongsToMany association setup on Videos and Bins: A Bin can store n references to Videos, and Videos can belong to n Bins.
I need to be able to manually set and store the display order of the Videos within a particular Bin (so the client can have his Videos in a particular ord...
Possible Duplicates:
What is the best way to avoid SQL injection attacks?
XKCD sql injection - please explain
SQL injection on INSERT
What is SQL injection?
I have been reading about SQL injection, but I am not able to understand it. Can anyone tell me the real issues about SQL injection?
...
I'm using a view ("UsersActive") against my table ("Users"). The view has only one filter, it checks if DateTime Users.DeletedOn is NULL; it basically contains all Users that are not deleted.
If I now execute Linq queries against the view instead of the table, will they still use the table indexes or do I need to create special indexes ...
Here is the code I've written to create a scenario:
USE tempdb
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.Emp') AND type in (N'U'))
DROP TABLE Emp
GO
CREATE TABLE Emp(
EmpID Int Identity(10,1) Primary Key,
EmpGroupID Int)
GO
INSERT INTO Emp(EmpGroupID) VALUES(1000)
INSERT INTO Emp(EmpGroupID) VALUES(1000)...
I have this query:
select distinct id,name from table1
For a given ID, the name will always be the same. Both fields are indexed. There's no separate table that maps the id to the name. The table is very large (10 of millions of rows), so the query could take some time.
This query is very fast, since it's indexed:
select distinct...
I'm using a RepositoryBase<T> base class as the foundation for my individual repositories (e.g. UserRepository).
It simplifies things like adding new entities etc. for example:
public IQueryable<T> SelectAll()
{
return db.GetTable<T>().AsQueryable<T>();
}
Now I've added a view "UserActive" in my database. Is there any way to...
I have the following data in my "Street_Address_1" column:
123 Main Street
Using Postgresql, how would I write a query to update the "Street_Name" column in my Address table? In other words, "Street_Name" is blank and I'd like to populate it with the street name value contained in the "Street_Address_1" column.
From what I can ...
How could I extend my data context objects (generated by Linq To Sql) so I can attach another interface to them, add other properties etc.? I don't want this to get overwritten the next time I'm rebuilding the classes from the database.
...
Hi,
I would like to have an entity named "GROUP" in my JPA setup. Now I get problems when I try to perform JPA queries, like "select count(group_.id) from Group group_".
JPA thinks this is a misplaced GROUP BY attempt and complains. Is there a way I can escape "Group", or do I have to rename my table?
Thx!
...
My database table has a column that contains SQL timestamps (eg. 2009-05-30 19:43:41). I need the Unix timestamp equivalent (an integer) in my php program.
$posts = mysql_query("SELECT * FROM Posts ORDER BY Created DESC");
$array = mysql_fetch_array($posts);
echo $array[Created];
Where it now echoes the SQL timestamp, I want a Unix ti...
I am having comment reply (only till one level) functionality. All comments can have as many as replies but no replies can have their further replies.
So my database table structure is like below
Id ParentId Comment
1 0 this is come sample comment text
2 0 this is come sample comment text
3 0 ...
I am trying to implement a feature similar to the "Related Questions" on Stackoverflow.
How do I go about writing the SQL statement that will search the Title and Summary field of my database for similar questions?
If my questions is: "What is the SQL used to do a search similar to "Related Questions" on Stackoverflow".
Steps that I c...
I have a property in my XML mapping file like
<property name="CreatedByLogin" formula="(select x.fst_name || ' ' || x.last_name from sebl_dev.S_CONTACT x where x.ROW_ID=CREATED_BY)" type="String" />
and I want to use a projection on this particular name like
.Add(Projections.Property("CreatedByLogin"), "CreatedByLogin")
and I do g...
Is there a .Net project/dll, that supports escaping of user supplied input to database queries for various database systems?
I would like our entire team to standardize and use one module to perform escaping of user supplied input that will then be used in parameterized SQL queries.
Ideally, I would like to specify the database system ...