Download DB-Access User Manual

Transcript
Using SQL Statements
SQL statements or Informix extensions to SQL let you load and unload
database tables into ASCII text files, change databases, and change the names
of tables and columns. Additional Informix extensions increase the functionality of standard SQL statements. The uses of SQL and statement syntax
conventions are described in Chapter 1 of the Informix Guide to SQL: Syntax.
Using SQL with DB-Access
Use SQL with DB-Access to enter one or more SQL statements. A statement is
simply an instruction that tells DB-Access what to do. For example, to create
a table, use the CREATE TABLE statement; to query a database, use the SELECT
statement.
Select the Query-language option on the DB-Access main menu. From this
menu you can go to the SQL menu, shown in Figure 2-3, to enter and run SQL
statements. The various menu options and screens used for this purpose are
described in detail in Chapter 3, “The Query-language Menu Option.”
SQL: New Run Modify Use-editor Output Choose
Enter new SQL statements using the SQL editor.
Save
Info
Drop
Exit
------------------mydata@mynewdb---------------------Press CTRL-W for Help -----
Figure 2-3
The SQL menu for
entering SQL
statements
DB-Access remembers the last sequence of statements, if any, that you used.
These statements are called the current statements. Through the SQL menu,
you can run these statements, save them to a file for later use, send their
results to a printer or file, or modify them with an editor.
You can check your SQL statements for ANSI compatibility in the following
ways:
2-12
■
When the DBANSIWARN environment variable is set, DB-Access
generates a warning whenever it encounters an Informix extension
to ANSI standard syntax.
■
You can use the -ansi flag to check SQL statements for ANSI
compatibility when you invoke DB-Access on the command line.
DB-Access User Manual