background preloader

Sql

Facebook Twitter

Mysql

Db. Sqlite. Rdbms. Query. Rails: Generate SQL from Migrations. Unfortunately, my new client will not allow migrations to be run in production. This isn't a surprise since they have a DB group that maintains their databases. And, the DB group requires application developers to submit SQL scripts when database modifications are necessary. At first this may sound like a pain, but it's actually quite easy to capture the SQL that migrations generate. There may be easier ways; however, it seemed simple enough to temporarily change the behavior of the execute method. require 'find' class SqlWriter def self.write(path, string) File.open(path, 'w') { |file| file << string } end end class MigrationSql class << self def execute connection = ActiveRecord::Base.connection old_method = connection.class.instance_method(:execute) define_execute(connection) { |*args| SqlWriter.write(@sql_write_path, args.first) } root = RAILS_ROOT + "/db/migrate" output_dir = root + "/.. define_execute(connection) { |*args| old_method.bind(self).call(*args) } end.

Splunk for SQL Users. Neo4j open source nosql graph database » SchemaCrawler - SchemaCrawler. Orac: Database Tool. Four ways to work with hierarchical data. Easy migration between Databases - Too-biased. SQLAlchemy - The Database Toolkit for Python. Retrieving Values from Result Sets (The Java™ Tutorials &gt; JDBC(TM) Database Access &gt; JDBC Basics) The following method, CoffeesTable.viewTable outputs the contents of the COFFEES tables, and demonstrates the use of ResultSet objects and cursors: public static void viewTable(Connection con, String dbName) throws SQLException { Statement stmt = null; String query = "select COF_NAME, SUP_ID, PRICE, " + "SALES, TOTAL " + "from " + dbName + ".COFFEES"; try { stmt = con.createStatement(); ResultSet rs = stmt.executeQuery(query); while (rs.next()) { String coffeeName = rs.getString("COF_NAME"); int supplierID = rs.getInt("SUP_ID"); float price = rs.getFloat("PRICE"); int sales = rs.getInt("SALES"); int total = rs.getInt("TOTAL"); System.out.println(coffeeName + "\t" + supplierID + "\t" + price + "\t" + sales + "\t" + total); } } catch (SQLException e ) { JDBCTutorialUtilities.printSQLException(e); } finally { if (stmt !

Retrieving Values from Result Sets (The Java™ Tutorials &gt; JDBC(TM) Database Access &gt; JDBC Basics)

= null) { stmt.close(); } } } You access the data in a ResultSet object through a cursor. Note that this cursor is not a database cursor. ResultSet Interface ResultSet Types. CloverETL - commercial open source data integration tool. 10thDoor. Databrid. TOra. HSQLDB. Jim. PostgreSQL for Mac. Reverse Snowflake Joins. Explore your database with Talend Open Profiler. Open Profiler offers functions for both technical and business users.

Explore your database with Talend Open Profiler

It can quickly build statistics that reflects the usability of the information within a database table. As it finds corrupt or inconsistent data, it can scrub bad information from database structures. Additionally, Open Profiler simplifies the repetitive nature of statistical analysis while reducing labor costs and errors. Getting familiar with Open Profiler I found it easy to use Open Profiler to find the information needed to perform an analysis of columns. Hypertable: An Open Source, High Performance, Scalable Database. SQLGrinder - Database Developer IDE for Mac OS X. ThinkUI SQL Client - SQL Query and Code Generation Tool for Java Developers.

General SQL Database Resources - SQL Database Reference Material - Learn sql, read an sql manual, follow an sql tutorial, or learn how to structure an SQL query! Database Journal: Daily Database News, Information and Tutorials for the Database Professional.