1 / 4

DB2

DB2. Connecting to DB2:. Connecting and keeping the shell prompt: Connecting and getting a db2 prompt: Executing a command from the command line after connecting Executing a file full of commands (separated by ;) ‏. > db2 “connect to <database_name> user <userID> using <password>”. > db2

lane-heath
Télécharger la présentation

DB2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DB2

  2. Connecting to DB2: • Connecting and keeping the shell prompt: • Connecting and getting a db2 prompt: • Executing a command from the command line after connecting • Executing a file full of commands (separated by ;)‏ > db2 “connect to <database_name> user <userID> using <password>” > db2 db2 => connect to ... > db2 “select * from book” > db2 -tf query.sql

  3. Connecting to DB2: • Executing a file full of commands (separated by @): • Suppress column headers and trailers of select statement. • Echo current command > db2 -td@ -f query.sql [pletcha@joyous temp]$ db2 -x "select * from book" 1-23 DB Ullman 01/01/1982 23.00 CSP 2-34 Netw T'baum 01/01/1981 37.00 PH 3-56 Queue K'rock 01/01/1978 25.00 Wiley 4-76 SysD J'son 01/01/1981 32.00 PH 1-52 DB Date 01/01/1984 28.00 AW 6-99 MMM Br'kes 01/01/1978 12.00 AW 7-45 Arch Baer 01/01/1981 35.00 CSP > db2 -v -tf query.sql

  4. Connecting to DB2: • Send all output to a file • Send output to file without headers and trailers • See other db2 command line options: > db2 “select * from book” -z outfile.db > db2 “select * from book” -vz outfile.db > db2 ? options

More Related