I'm faced with the following and I'm not sure what's best practice.
Consider the following table (which will get large):
id PK | giver_id FK | recipient_id FK | date
I'm using InnoDB and from what I understand, it creates indices automatically for the two foreign key columns. However, I'll also be doing lots of queries where I need to...
Hi all,
I am facing problem while i am inserting new record from GUI part to database table. I have created database table Patient with id, name, age etc....id is identity primary key. My problem is while i am inserting duplicate name in table the control should go to else part, and display the message like...This name is already exits, ...
I have rectified my previous problem and now able to insert data to the table.
Now while reading the data with Name, Age, Gender,City, TypeofDisease condition not getting the result..as a result always I'm getting "System.Data.SqlClient.SqlDataReader"
Here is my stored procedure:
CREATE PROCEDURE SearchPatient
(
@Name varchar(50),
@Age ...
Hi There,
I have the following tables, with these keys in my database:
bookings
session_id
sessions
session_id
course_id
courses
course_id
I want to create a query to delete all date relating to a single course (course_id). For example if I wanted delete course_id=10, I would want any sessions with course_id=10 to be deleted, in add...
Hi,
I'm using Linq to SQL and read in a blog post about closing database connections as soon as possible. As an example, they showed a variable being converted to a list (using .ToList()) instead of actually returning the Linq query. I have the below code:
public static bool HasPassword(string userId)
{
ProjDataContext db = new...
I'm really new to database object design so please forgive any weirdness in my question. Basically, I am use Google AppEngine (Python) and contructing an object to track user info. One of these pieces of data is 40 Achievement scores. Do I make a list of ints in the User object for this? Or do I make a separate entity with my user id...
Hello,
I want to use pooled connections with Java (because it is costly to create one connection per thread) so I'm using the MysqlConnectionPoolDataSource() object. I'm persisting my data source across threads. So, I'm only using one datasource throughout the application like this:
startRegistry(); // creates an RMI registry for...
Take tables: User, Comment, Snippet.
A User can have many Snippets.
A Snippet can have many Comments.
A User can leave many Comments.
In turn, when I diagram things, I end up with something like a triangle.
User 1-------------* Comment
\ /
\ /
*Snippet 1
...
Does anybody know of a gem that provides taps-like functionality, that is compatible with Passenger (mod_rails)?
When I try to use taps on a Ruby EE/Passenger setup, I receive the error:
`detect_rack_handler': Server handler (thin,mongrel,webrick) not found. (RuntimeError)
Although it's not specifically stated in the readme, I am ass...
Hi,
Say we have a database query that takes 20seconds to run (the user runs it by clicking a button on HTML page in a browser).
The user gets impatient and only after 10seconds he refreshes his browser, only to run a new query.
How do I stop the first running database query (or prevent the second one from running)?
Thanks
...
Hi,
Given a From Date, To Date, Fiscal Year system. I want to get all the split-up duration within the given duration based on the breakup asked for.
Breakups are:
1) Weekly: This should be followed from Monday through Sunday.
2) Monthly: This should be 1st of a month through end of the month.
3) Quarterly
Since the Fiscal ...
I have a database, which is a part of a Library Information system. It keeps track of the books borrowed by customers, keeping the due dates and automating the notification of accountability of customers, if a customer returned a book beyond their due date.
Now, I am using MySQL for the DBMS. What I know is that MySQL's time is depende...
Steps:
I want a registered user to be able to insert values into a table.
Those values would only be able to be seen or edited by the user. (a few rows)
I have a registration/login page and insert form page complete and they can add do their respective jobs.
Here's the problem and i realize it probably a super simple answer:
How d...
I am looking for a php web framework that supports multiple databases with the same schema/model. Every customer of us will become his own webserver with his own database. On top of this we want to develop a central administration app that works on all customer databases, which are all have the same schema/model. Is there a php framework...
I have three tables like this:
Person table:
person_id | name | dob
--------------------------------
1 | Naveed | 1988
2 | Ali | 1985
3 | Khan | 1987
4 | Rizwan | 1984
Address table:
address_id | street | city | state | country
-----------------------------...
How can I store a date-range in solr?
I need to store the start-date and the end-date.
Lets say it is a villa which is for rent during a period (start and end).
I must use two fields right?
In the search the user may chose start-date and end-date, so when querying solr I think I could use something like:
date:[$start TO $end]
...
I know that database locales on Postgres are responsible for proper order of national characters, proper lower/upper-casing etc.
But why there are two language-neutral locales: posix and c? Is there any difference between them or is it just one neutral locale with two different names?
UPDATE As Magnus Hagander states in his answer, POS...
I have a SQL table containing train schedules. The table looks something like this:
Schedule
TrainNumber
LegID
DepartureTime
DepartureStation
ArrivalTime
ArrivalStation
My real database contain several tables, but for this question only the one above is relevant. Different trainNumber can have different amount of legs. Based on a dep...
I have a huge database in production environment which I need to take a copy off, but the problem is that the data is over 100Gb's and downloading a backup off it is out of the question. I need to get a "skeleton" image of the database. What I mean by "skeleton" is, I need to get the database outline so that I can recreate the database...
Hi,
I need to retrieve the url of the image from the database, bind it to a business object, convert it into a bitmap image and map it into the resource dictionary. The resource dictionary is used as a library and I cannot change it.
The database consists of one table that has three columns: id, name, url. It is the SQL CE 3.5 local dat...