database

PHP prepared postgres query fails with:"could not determine data type of parameter $1"

Hello everyone. I currently have to implement a query on a postgres database using a prepared statement. My current code looks like this: $arrFilter = array("", ""); $result = $db->prepare("select_music", "SELECT * FROM tblmusik WHERE lm_titel LIKE '%" . "$1" . "%' AND lm_text LIKE '%" . "$2" . "%'); ( db->prepare() just executes p...

ASP.NET Automated & Manual ETL Process

Here's an interesting problem. I have an ETL script written in c# that I have been running manually on a somewhat regular basis. It is used to update my web app's database. I want to automate the ETL process AND create an interface for the web app admins to manually start the ETL process. I could have sql server kick off the ETL proce...

Adding column contents in a SQL UNION query

So far I have this query SELECT COUNT(f.code_id) as item_count, f.code_desc FROM foo f INNER JOIN foohistory fh ON f.history_id = fh.history_id WHERE MONTH(fh.create_dt) = 6 AND YEAR(fh.create_dr) = 2010 GROUP BY f.code_desc UNION ALL SELECT COUNT(b.code_id) as item_count, b.code_desc FROM ...

how to use sql connection in PHP to execute a query on two databases

how can i run a query that joins two tables from TWO different Databases in mssql_query or mysql_query in php for example $conn=mssql_connect($ip,$username,$password); mssql_select_db("DB1",$conn); $q="select A.name,B.ID from DB1.dbo.T1 A, DB2.dbo.T2 B where A.ID=B.ID"; $res=mssql_query($q); how to run such query?? ...

How to add #temp tables

I have formed few temp tables in my query (TSQL) like - #temphold1, #temphold2, #temphold3..... #temphold10. Each temp table has different schema (different columns) each derived by grouping data from different tables with specific conditions. I need to determine a way to carry all these temp tables to the User Interface and display each...

MySQL implementation with CUDA

Hi, I am a senior undergrad majoring in CS. At the moment I am taking a Computer Architecture class. We need to do a project. I want to do something related to CUDA, where the performance of the computation will have a moderate increase compred to a serial implementation. I am really interested in databases so I decided to do something...

What are the Options for Storing Hierarchical Data in a Relational Database?

Good Overviews One more Nested Intervals vs. Adjacency List comparison: the best comparison of Adjacency List, Materialized Path, Nested Set and Nested Interval I've found. Models for hierarchical data: slides with good explanations of tradeoffs and example usage Representing hierarchies in MySQL: very good overview of Nested Set in p...

C Shared memory database

So this is a homework assignment, and it's kind of a doozy so i'll try to TL;DR it. Basically Im making a Shared memory database with 5 files (load,query,clean,print,change) Load loads the database from a file. (students have a first name/last name/address/telephone number) Query lets someone "search" for a specific student print....well...

MongoDB + PHP Item wont remove()?

I'm not sure what I'm doing wrong, but with MongoDB and PHP i'm trying to do this: $db->textures->remove(array("_id"=>$_GET['texture_id']),array("safe" => true)) But nothing happens. I did a print_r and it says: Array ( [err] => [n] => 0 [ok] => 1 ) ...

How to automatically move specific MySQL tables from one machine to another?

I have a MySQL database with tables in the form of "shard_0", "shard_1", "shard_2", etc. These are virtual shards. Now I want to add another DB server and move the even-numbered shards ("shard_0", "shard_2", "shard_4", ...) to the new machine. What is the best way to do that? There are many tables so ideally I wouldn't have to type out...

SQLite3: Batch Insert?

Hi everyone. I've got some old code on a project I'm taking over. One of my first tasks is to reduce the final size of the app binary. Since the contents include a lot of text files (around 10.000 of them), my first thought was to create a database containing them all. I'm not really used to SQLite and Core Data, so I've got basically ...

Design pattern for object-relational mapping.

I have several related database tables and I would like to treat their rows as objects and their tables as something like lists. What are the considerations that I have to keep in mind (for instance, ensuring that the objects stay consistent with one another and with the database, lazy loading)? And what is a good design pattern for im...

Alternatives to Entity-Attribute-Value (EAV)?

Hi, Our database is designed based on EAV (Entity-Attribute-Value) model. Those who have worked with EAV models know all the crap that comes with for the purpose of flexibility. I asked my client about the reasons why using EAV model (flexibility), and their response was: Their entities change over time. So, today they may have a tabl...

No direct access to data row in clustered table - why?

[11] tells: "In a nonclustered index, the leaf level does not contain all the data. In addition to the key values, each index row in the leaf level (the lowest level of the tree) contains a bookmark that tells SQL Server where to find the data row corresponding to the key in the index. A bookmark can take one of two forms. If the...

Dynamic array instead of static when creating ListView icons and text Android

Hi, I am using this following code which creates a ListView with text and an icon but the problem that I have which the following I want the array to be dynamic instead of static so my list gets created dynamically not statistically. My ultimate goal is to retrieve specific strings from my Db and to display it then on the Listview where...

What do I miss in understanding the clustered index?

In absence of any index the table rows are accessed through IAM ((Index Allocation Map). Can I directly access a row programmatically using IAM? Does absence of index mean that the only way to read specific row is full table scan reading all table? Why IAM cannot be engaged for more specific direct access? "If the table is a hea...

Tool to generate DB architecture view?

I need to get a UML (or alike) DB architecture view out of a database (in this case Oracle) by simply providing needed credentials (or otherwise). Please, advice any tools that you use/have used to accomplish the same purpose. ...

Is a TEXT.IX file familiar to anyone?

Just curious which legacy DOS based system is responsible for a 'TEXT.IX' data file. If anyone has come across it before please tell :-) Thanks. ...

How come when I push "up" on MongoDB's console, it doesn't cycle through my previous command?

Instead, it displays this: ^[[A^[[A ...

How come a document in MongoDB sometimes gets inserted , but most often don't?

con = pymongo.Connection('localhost',27017) db = con.MouseDB post = { ...some stuff } datasets = db.datasets datasets.insert(post) So far, there are only 3 records, and it's supposed to have about 100... ...