sqlcmd a better dbaccess l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
SQLCMD – A Better DBACCESS? PowerPoint Presentation
Download Presentation
SQLCMD – A Better DBACCESS?

Loading in 2 Seconds...

play fullscreen
1 / 14

SQLCMD – A Better DBACCESS? - PowerPoint PPT Presentation


  • 134 Views
  • Uploaded on

SQLCMD – A Better DBACCESS?. Utility by Jonathan Leffler Presented by Joe Kennedy (joekenn@us.ibm.com) (301-803-1974). Sqlcmd as a SQL Command Interpreter. DDL DML Select, Execute Procedure. What is it?.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'SQLCMD – A Better DBACCESS?' - gefen


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
sqlcmd a better dbaccess
SQLCMD – A Better DBACCESS?

Utility by Jonathan Leffler

Presented by Joe Kennedy

(joekenn@us.ibm.com)

(301-803-1974)

sqlcmd as a sql command interpreter
Sqlcmd as a SQL Command Interpreter
  • DDL
  • DML
  • Select, Execute Procedure
what is it
What is it?

SQLCMD is an SQL Command Interpreter for Informix databases. It is analogous to the Query-Language option of DB-Access or ISQL, but it is designed to work better in shell scripts.

SQLCMD is written in ESQL/C. It works with any version of ESQL/C from 5.00 (circa 1990) upwards.

SQLCMD has a history mechanism that allows you to review, edit and rerun commands you ran previously.

alternative output formats
Alternative Output Formats
  • Quote
  • CSV
  • XML
  • Fixed
  • Unload (default)

-F from the command line!

load unload statements
Load & Unload Statements
  • Same Syntax as in DBACCESS or ISQL
  • No transaction management in load (add your own begin work/commit statements)
reload statement
Reload Statement
  • Syntactically similar to load statement

automatically initiates transactions, groups the inserts, groups the inserts into smaller transactions if there are many rows to be loaded

info system
Info system

INFO DATABASES;

stores_demo@ids_joe

sysmaster@ids_joe

sysuser@ids_joe

sysutils@ids_joe

INFO CONNECTIONS;

...

INFO TABLES;

...

sqlunload
SQLunload
  • Extract data from the database and produces ASCII output suitable for dbload or LOAD command.
  • The database (-d) and table (-t) are always specified on the command line.
sqlreload
Sqlreload
  • The inverse of Sqlunload
  • “Passing resemblance” to the Informix dbload utlity.
  • Database (-d) and Table (-t) are always designated at the command line using flags.
i o redirection
I/O Redirection

Unix/Linux redirection applies

echo “select * from customer” | sqlcmd -d stores_demo -F XML

contexts
Contexts
  • Level: 1 Input: /dev/stdin
  • Output: /dev/stdout Error: /dev/stderr
  • Date: mm/dd/yyyy Delimiter: '|'
  • Escape: '\\' Quote: '\"'
  • EOR: '\n' History size: 50
  • Query limit: 0 Transaction size: 1024
  • Input Base: 0 BlobDir: /tmp
  • XML Record Tag: RECORD Format: <TOS> select <BOS>
  • Heading: <TOS> off <BOS> History: <TOS> off <BOS>
  • Continue: <TOS> off <BOS> Silence: <TOS> off <BOS>
  • Trace: <TOS> off <BOS> Types: <TOS> off <BOS>
  • Verbosity: <TOS> off <BOS> Benchmark: <TOS> off <BOS>
command line options
Command line options

Try “sqlcmd -help”

Basic flags:

-d database

-f FILE

-e 'SQL Statements'

how do i get the source code
How do I get the Source Code?

The International Informix User Group!

www.iiug.org – check the software repository...

distributed as a gzipped tar file with the extension ".tgz"

compilation
Compilation....

SQLCMD is written in ESQL/C, you must have ESQL/C or ClientSDK on your machine before installing SQLCMD.

On Unix systems (including Linux), the normal sequence of events is:

./configure LD_LIBRARY_PATH

make

make install