database

How to print the Text data type in mysql

A Table has Field: data Type: text select data from t1 where id = 5 *************************** 1. row *************************** data: 1 row in set (0.00 sec) How to print the exact data from table ? NOTE: the Field data is not empty ...

Convert Postgis table to SQL Server 2008...

Is there a simple way to do that? ...

Need generic function(s) for connecting to DB and retrieve data

Hi guys. I'm making a DAL class which I can use to connect to DB and retrieve data. I'm using SQL Server 2005 Express (and Visual Web Developer 2008 Express Edition). I found several examples on the web for connecting an retrieving data. But none where made inn to a class object. This is kind of a pseudocode I've put together. Can any...

How do you document your database code to see dependencies between database objects?

I want to write documentation on my pet project. I have 30 tables and almost 50 views and about 30 functions (stored procedures) in my PostgreSQL database. I would like to see where tables ( which views and which functions ) are used. I would like to see where views ( which views and which functions ) are used. I would like to see if...

Serializing an object and storing it to a varbinary field in a DB

I can serialize an object to a file using: var writeStream = File.Open("l.osl", FileMode.Create); var bformatter = new BinaryFormatter(); bformatter.Serialize(writeStream, l); What I am trying to do is instead of writing it to a file, write it to a DB varbinary field. I assume that I have to change writeStream to something else, but w...

Recommendations for single user access Database

I am writing a desktop utility application to manage a small set of data. This application will be used by a singular person so I'd like to keep the database as simple as possible. I am considering XML or SQL Server Compact 3.5 (SQL CE). I am leaning towards SQL CE because it will probably be easier/quicker to develop than XML. Are there...

Getting a name error when seeding a database in ruby on rails. How do I include app context?

I have a seed script called load.rb in the db directory of an application. I just got this app from a client so not sure how to run this script. I get a name error on all of the Model.create(...) statements. I guess this is because the Rails environment is not loaded. There is no indication that this load script was run via a rake ta...

Syncing referential integrity tables and enums

I ponder this question from time to time, so I thought I'd ask you guys about it. Let's say I have a database table that looks like this: Table: Visibility Id Value -- ----- 0 Visible 1 Invisible 2 Collapsed This is just a table for ensuring referential integrity. It is basically an enum stored in the database for the pu...

Is it possible to automatically release a lock in PostgreSQL?

I am testing the fault tolerance of an ActiveMQ system configured as JDBC Master/Slave. In this setup there is one postgres database and two brokers--one is the master broker, the other is a slave broker. The way this mechanism works is the master takes out an exclusive lock on a table in the db. The slave tries to do this also and waits...

How do you map GUI labels to database fields?

For GUIs that display many database fields it's desirable to have a field:label map so that the GUI labels are not hard-coded but set dynamically. For example height:"Height (cm)" age:"Age in years" bloodAlcPct:"Blood Alcohol %" monthsIncarcerated:"Months in jail" Where do you store these strings and how are they mapped to the data...

How to go about catching database and software version mismatch on deployed application?

I'm developing a standalone application that accesses a common database on a server. It will be used by a few dozen people in my organization. I know that I will need to update the software and the design of the database. This creates the possibility that someone will perform a query on the database using old software. I already have...

Hibernate flush and JTAUnexpectedRollbackException

Hi All, I am using Spring and Hibernate. And Atomikos for transactions. I use annotation based transactions. I am having a DAO object and in one of the methods I call entityManager.persist() to save the object. Now whenever there is an ORA- error during update, for example a constraint is violated or one of the columns is having length...

MS Access - OLE Server Error....HELP!!

So I developed this access database application (just the back end), on a lap top, and now I have tried to move it onto a network drive. The purpose of this thing is to track data for metrics, so there is a lot of data (700k rows at 15 fields for main table), and it runs these top N queries that it builds charts with... so i put it all ...

Convert Access queries to SQL Server views when using DTS

I'm using DTS to import data from an Access database to SQL Server 2005. It seems that DTS imports Access queries as tables instead of views, which won't work for me. Is there any way around that? ...

Native vs ODBC database connections with R

I understand that some databases have native support in R (e.g. MySQL) but you can connect to other DBs like MS SQL Server using RODBC. How much speed improvement does one gain for reading/writing with the native drivers vs. RODBC? What other DBs have native drivers in R? Is reading faster or slower than writing generally? ...

Using DDD, How Does One Implement Batch Processing?

I have logic consisting of selecting a large number of records from one system, performing multiple transformations (based on business rules) and inserting them into another system. It seems like a high performance (and memory) hit to instantiate each of these records as an object, perform transformations on them and then insert all of ...

Database command runs glacially in my PHP script, quickly in phpMyAdmin

Hi, I have an extremely large MySQL database (about 1 million items) and am running a fairly complex query on that database. It takes about 2 seconds when I enter the SQL command into phpMyAdmin but it takes around 1-2 minutes to generate that same output using PHP code. Why would there be such a time difference? If it was a poorly ex...

Connection Leak in C# DataBase.ExecuteScalar

The following method in a static class gives me a time out exception because the connection pool is maxed out. While in debug mode I looked in sql Management studio and saw there were 150 sleeping processes. I expected the connections to be closed automatically...I also tried putting as a static member and still got the same Error. A...

Use unicode(255) for all column types in postgres?

I do not understand when to use the different lengths for calling unicode. I have been using types.Unicode(255) for all my columns in my postgres database such as address, name, description, etc. Is it unwise to do this? ...

is it possible to fetch data from multi dbs through one connection request

I need to work on this poorly designed db where a new group of data are established by adding a new db to the server. So I have to fetch data from multi dbs, I wonder is there a way to get all thoes group data through one connection? I am using c#. ...