MrGadgets Almanac of Techie Wizardry & Travel Compendium
A rambling mix of things that interest me (In no particuar order): Technology,Science,Art,Commerce (Much more than just the interchange of money. What exactly is money anyway?) Politics,Weight-Loss - Specifically Low-Carb, Spiritual Paths as Oppossed Organized Religion,Music,Celtic Music,Bluegrass,Cowboy Music,The latest book I am reading. (Usually Sci-Fi/Fantasy) The lastest book I am writing. (Same) Grail Lore,My latest travels & tips,WiFI access,Coffee,&Everything else...
Friday, January 29, 2010
DB2 Survival Guide - http://www.michael-thomas.com/tech/db2/db2_survival_guide.htm
DB2 Survival Guide
DB2 Environment Basics
Creating a Database and Tables (v6.0 & v7.0)
Topic | Description |
Create a Database |
|
Create a Table in a Database |
|
Using: DB2 Command Center
Launch: Start, Programs, IBM DB2, Command Center.
Topic | Description |
Importing external Scripts | Import and run an external Script
Notes:
|
Connect to a DB | SQL: (Connect to a Database).
|
View a tables structure | SQL:
|
Interactive Tab vs Script Tab | Interactive Tab - only allows one SQL command. Script Tab - You can place many SQL commands and highlight the ones you want to run. I like to use the Script Tab. |
Using: DB2 Control Center
Launch: Start, Programs, IBM DB2, Command Center.
Topic | Description |
Privileges, Authorities and Access Rights | Grant Access to a Database
Grant access to a Table
|
View Sample Data from a Table | Steps:
|
View and Modify a Table Structure | Steps:
|
Copy a Database | Steps:
|
Using: Command Line Processor
Launch: Start, Programs, IBM DB2, Command Center.
Topic | Description |
Command help | Command Help
|
Backup and Restore or Copy a DB. | Backup and Restore (also Copy a DB).
|
Application Heap Size | If you're getting Heap Size errors, the double the size of the heap. db2 =>
|
Run SQL Commands | db2=> (examples)
|
Help | Help db2 => ? - this will give a list of commands. |
Using: Command Window
Topic | Description |
Command Window | Initializes the DB2 Command Line environment and then takes you to the directory: C:\PROGRAM~1\SQLLIB\BIN Uses:
|
Using: DB2 Scripts & DOS
Topic | Description |
Running External Scripts | Running External Scripts
|
Basic SQL for DB2 (examples)
Topic | Description |
General Notes |
|
Connect/Use a Database (Also Disconnect) | Connect to a Database. (Warning: If you don't specify a username & password you will connect to the DB as your current Windows login. Check the "Schema" via the Control Center to see what user you need to log in as.)
|
List structure of a Table | List Structure of a Table
|
Tables | SQL commands
|
SQL commands |
|
AutoNumber for ID's Sequence Numbers. | Example of having DB2 create an ID number
|
Special Functions | Special Functions
|
Lower/Upper Case | Lower/Upper Case: On CHARACTER or VARCHAR
|
Date Time | Date/Time
|
Comparators | Compare IN
|
Left Join | Left Join Example #1: Joins the MYADDRESS & MYSTATE tables together using the STATE field as the common value so that the STATENAME can be retrieved. select MYADDRESS.STATE AS STATE, MYSTATE.STATENAME AS STATENAME \ |
Left Join Examples using the "SAMPLE" DB | -- List Employee and the name of his work department. select EMPLOYEE.EMPNO as EMPNO, FIRSTNME, MIDINIT, LASTNAME, WORKDEPT, DEPARTMENT.DEPTNAME as WORKDEPT_NAME from db2admin.EMPLOYEE as EMPLOYEE \ left join db2admin.DEPARTMENT as DEPARTMENT on DEPARTMENT.DEPTNO = EMPLOYEE.WORKDEPT \ where EMPLOYEE.EMPNO = '000010'-- List Departments and it's Administrative Department select DEPARTMENT.DEPTNO, DEPARTMENT.DEPTNAME, DEPARTMENT.ADMRDEPT, ADMINDEPT.DEPTNAME as ADMIN_DEPTNAME from db2admin.DEPARTMENT as DEPARTMENT \ left join db2admin.DEPARTMENT as ADMINDEPT on ADMINDEPT.DEPTNO = DEPARTMENT.ADMRDEPT-- List of Employees and the projects that they have worked on. select EMPLOYEE.EMPNO as EMPNO, FIRSTNME, MIDINIT, LASTNAME, PROJNO from db2admin.EMPLOYEE as EMPLOYEE \ left join db2admin.EMP_ACT as EMP_ACT on EMP_ACT.EMPNO = EMPLOYEE.EMPNO \ where EMPLOYEE.EMPNO = '000010'-- List of Employees and the projects that they have worked on and the Project's name. select EMPLOYEE.EMPNO as EMPNO, FIRSTNME, MIDINIT, LASTNAME, PROJNO from db2admin.EMPLOYEE as EMPLOYEE \ left join db2admin.EMP_ACT as EMP_ACT on EMP_ACT.EMPNO = EMPLOYEE.EMPNO \ where EMPLOYEE.EMPNO = '000010' -- List of Employees and the projects that they have worked on and the Project's name with the Major Project name. |
Date example using the "Sample" DB | -- Select records less than equal to a date ( <= ) select EMPNO, EMSTDATE from db2admin.EMP_ACT \ where EMSTDATE <= '01/01/1982'-- Select records for a date ( = ) select EMPNO, EMSTDATE from db2admin.EMP_ACT \ where EMSTDATE = '06/01/1982'-- Select records bases on a range. select EMPNO, EMSTDATE from db2admin.EMP_ACT \ where EMSTDATE >= '06/01/1982' and EMSTDATE <= '07/01/1982'-- Select records based on a year. select EMPNO, EMSTDATE from db2admin.EMP_ACT \ where year(EMSTDATE) > 1982 |
Command Window (DOS)
- Access by: Start, Program Files, DB2 for Win NT, Command Window. This will normally open up a DOS window in the directory "\SQLLIB\BIN"
- Now add "db2" infront of SQL commands. (ex: db2 connect to <database name>)
Data Types
Documentation: DB2 Information Center, then "Books" tab, then click on "SQL Getting Started", then look for "Data Types" in the left navigation window.
Datatype | Notes |
INTEGER | range is -2147483648 to 2147483647 |
SMALLINT | range is -32768 to 32767 |
BIGINT | range is -9223372036854775808 to 9223372036854775807 |
CHAR(x) | Maximum length of 254 Ex: 'Some info ' |
VARCHAR(x) | Maximum length of 32672 Ex: 'Some info ' |
LONG VARCHAR | |
DATE | 3 Parts: 1991-10-27 |
TIMESTAMP | 7 Parts: 1991-10-27-13.30.05.000000 |
TIME | 3 Parts: 13.30.05 |
DOUBLE | range is -1.79769E+308 to -2.225E-307 or 2.225E-307 to 1.79769E+308 or zero |
CLOB | Length in Bytes |
BLOB | Length in Bytes |
DECIMAL(x,x) | Precision & Scale range is -10**31+1 to 10**31-1 |
REAL | range is -3.402E+38 to -1.175E-37 or 1.175E-37 to -3.402E+38 or zero |
GRAPHIC(x) | x must be between 1 and 127, inclusive. A graphic string is a sequence of double-byte character data. |
Posted via email from mrgadgets's posterous
Find more from me @ http://mrgadgets.posterous.com
Identifying iPod models - http://support.apple.com/kb/HT1353
Summary
This document will help you determine the model of iPod you have. To ensure that your Mac or PC is compatible, check the system requirements for your particular iPod.
You can always download the latest iTunes software at http://www.apple.com/itunes/download/. When you have the latest version, use the iTunes menus to check for updates. On the Mac choose iTunes > Check for Updates. On Windows choose Help > Check for Updates.
Products Affected
iPod nano, iPod shuffle, iPod mini, iPod, iPod touch
You can tell which iPod model you have by checking:
- Whether it navigates using a Multi-Touch display, Control Pad, Click Wheel, Touch wheel, Scroll wheel, or Apple Earphones with Remote.
- The amount of storage capacity.
- If it has a color or monochrome screen.
- If it has a dock connector.
Posted via email from mrgadgets's posterous
Find more from me @ http://mrgadgets.posterous.com
Monday, January 18, 2010
Saturday, January 09, 2010
Friday, January 08, 2010
Thursday, January 07, 2010
Tuesday, January 05, 2010
Eye-Fi Pro X2 8GB Wireless SDHC Card - simply the most powerful memory card yet | Eye-Fi
Pro X2 $14999
Includes wireless RAW file uploads, Endless Memory Mode,
Class 6, Ad Hoc connection and more. PRE ORDERS at this time.
Posted via email from mrgadgets's posterous
Find more from me @ http://mrgadgets.posterous.com