Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The INTO or TO clauses specify output options that determine the location for storing or sending the final query results from a SQL SELECT statement.
For more information, see SELECT - SQL Command.
The detailed syntax for the INTO or TO clause is as follows:
[INTO StorageDestination | TO DisplayDestination ]
[INTO StorageDestination]
Stores the query results in an array, cursor, or table.
Note
If you do not include the INTO clause, query results are displayed in a Browse window by default. To direct the query results to the printer or a file, use the TO clause.
The following table describes locations in which you can store the query results using the INTO clause.
StorageDestination |
Description |
||||||||
---|---|---|---|---|---|---|---|---|---|
ARRAY ArrayName |
Stores query results in a memory variable array. Note If the query selects zero records, the array is not created. |
||||||||
CURSOR CursorName [NOFILTER | READWRITE] |
Stores query results in a temporary cursor.
RemarksThe following code shows a summary of the main clauses of the SELECT - SQL Command:
For more information about a particular clause of the SQL SELECT command, see the following topics: ExampleThe following example stores the contents of a query into a table using INTO TABLE TableName clause. The example stores the contents of the Company, Order_Date, and Shipped_On fields from the Customer and Order tables, which are joined on the Cust_ID field, in a third table called CustShip. The example then opens a Browse window for the new table. The SELECT statement specifies local aliases for the tables to distinguish the same field name, Cust_ID, in both tables.
See AlsoReferenceOther Resources |
Please sign in to use this experience.
Sign in