database

What is better: sql string or stored procedures?

I have a data access layer which uses the Enterprise Library. Now I was wondering, which is better: Using stored procedures to create my SQL, or writing SQL strings within the data access classes? ...

Do you know a free test data generator for mysql database?

Do you know a free test data generator for mysql database? Maybe native tools allow you to generate test data? ...

Datamapper, defining your own object methods, how?

So lets say I have a class like below class List include DataMapper::Resource property :id, Serial property :username, String def self.my_username return self[:username] end end list=List.create(:username=>,'jim') list.my_username When I run this it tells me that the method cannot be found, and on more investigation ...

C# database file directory

I'm using the windows forms aplication with an ms access database. And i would like to know if there is a way to show the directory of the database file (to save data in it)excpet like this: string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=save.mdb"; OleDbConnection empConnection = new OleDbConnection(con...

Oracle join query

There are three tables in my db ITEM_MASTER, PRICE_MASTER, COMP_MASTER ITEM_MASTER STORE_CODE ITEM_CODE ITEM_DESC 011 914004 desccc PRICE_MASTER STORE_CODE ITEM_CODE COMP_CODE 011 914004 01 011 914004 02 011 914004 03 011 914004 04 COMP_MASTER COMP_CODE CO...

C# dataset and DbNull values.

Hi All. I've a general question - Lets say I've an SQL Server 2008 DB , and it has some nullable columns. Some of these are null and some are not. Next, I query the DB for a DataRow in C#. What value would these null fields have in the DataRow object? I'm seeing that they have C# "null" values, but someone here said that DbNull != C#...

Connect to a MySQL database and count the number of rows.

Hi there! I need to connect to a MySQL database and then show the number of rows. This is what I've got so far; <?php include "connect.php"; db_connect(); $result = mysql_query("SELECT * FROM hacker"); $num_rows = mysql_num_rows($result); echo $num_rows; ?> When I use that code I end up with this error; Warning: mysq...

Movies recommendation engine conceptual database design

I am working at an movie recommendations engine and i'm facing a DB design issue. My actual database looks like this: MOVIES [ID,TITLE] KEYWORDS_TABLE [ID,KEY_ID] where ID is Foreign Key for MOVIES.id and KEY_ID is a key for a text keywords table This is not the entire DB, but i showed here what's important for my problem. I have...

Adding views to a vendor-delivered database and performance

We have a vendor delivered database that to this point I have been able to avoid making any database structure changes to. We will be soon directly querying the tables directly for a related project. In order to pull all of the data we need, we will need to create a big SQL statement with multiple unions. select ... from table1 union s...

Integration transport choice (Oracle + SQL Server)

We have several systems with Oracle (A) and SQL Server (B) databases on backend. I have to consolidate data from those systems into the new SQL Server database. Something like that: (A) =>|---------------| | some software | => SQL Server (B) =>|---------------| where some software is: transport (A and B systems located in th...

How do i save a form to the database without knowing the field type or its id in flex and coldfusion?

Hi - I am working on a function to generate a form at runtime in Flex based on a call to the DB. The call to the DB returns the field types, id, tooltips etc as an arraycollection, the arraycollection is then parsed in order to ascertain what control to display based on the type field in the array - this bit works fine. However, i am st...

PHP or C# script to parse CSV table values to fill in one-to-many table

I'm looking for an example of how to split-out comma-delimited data in a field of one table, and fill in a second table with those individual elements, in order to make a one-to-many relational database schema. This is probably really simple, but let me give an example: I'll start with everything in one table, Widgets, which has a "stat...

Scalability comparison between different DBMSs

By what factor does the performance (read queries/sec) increase when a machine is added to a cluster of machines running either: a Bigtable-like database MySQL? Google's research paper on Bigtable suggests that "near-linear" scaling is achieved can be achieved with Bigtable. This page here featuring MySQL's marketing jargon suggest...

Oracle grant concession and side effects

Working every day on a large Oracle production database (10g), we noticed that operations like granting an user read privileges on a table creating a trigger on a table lock that table, and invalidate all the cursors insisting on it. This has tremendous consequences if the table is big (> 20 million rows) and many users are working ...

Where Do I Place Data Generation Scripts in VS2010 Database Project?

I am working on a database project within VS2010. I have created a few INSERT INTO scripts so I can populate the database with data which I can then test against. However, I am unsure of where to put these scripts so that they are automatically run on deployment. (For example, if I put items under the Schemas/Tables folder of the VS20...

How can I execute a SQL query in emacs lisp?

I want to execute an SQL query and get its result in elisp: (let ((results (do-sql-query "SELECT * FROM a_table"))) (do-something-with results)) I'm using Postgres, and I already know all of my connection information (host, username, password, db et al) I just want to execute the query and get the result back, synchronously. ...

Can't Show image in gridview using templates

i am trying to load images from the northwind database (categories table, images that are stored in the database) into grid view control. But it dosenot seems to work. Plz! have a look... Default.aspx <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataKeyNa...

get n records at a time from a temporary table

I have a temporary table with about 1 million entries. The temporary table stores the result of a larger query. I want to process these records 1000 at a time, for example. What's the best way to set up queries such that I get the first 1000 rows, then the next 1000, etc.? They are not inherently ordered, but the temporary table just has...

How to represent a Many-To-Many relationship in XML or other simple file format?

I have a list management appliaction that stores its data in a many-to-many relationship database. I.E. A note can be in any number of lists, and a list can have any number of notes. I also can export this data to and XML file and import it in another instance of my app for sharing lists between users. However, this is based on a lega...

Database tables - how many database?

How many databases are needed for a social website? I have my tech team working on developing a social site but all their tables are in 1 database. I wanted to create separate table sets for user data, temporary tables, etc and thinking maybe have one separate database only for critical data, etc but I am not a tech person and now sure h...