English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2007-01-04 23:16:17 · 5 answers · asked by nasreen a 1 in Computers & Internet Programming & Design

5 answers

commit;

2007-01-04 23:20:43 · answer #1 · answered by oohhbother 7 · 0 0

Use the save command to store the current contents of the buffer in a file. For example lets call your query my_script.
Just type this :-

SAVE my_script.

You can now use this script in the future by means of the START command. So:-

START my_script

2007-01-04 23:23:25 · answer #2 · answered by Moose 2 · 0 0

Running and saving SQL scripts generated by the replication administration tools

To create replication and publishing objects, you run SQL scripts that are generated by the ASNCLP command-line program or Replication Center. You can modify the scripts, use the tools to run the scripts, or run the scripts from a DB2® command line.

About this task

When editing the generated SQL scripts, be careful not to change the termination characters. Also, do not change the script separators if there are multiple scripts saved to a file.
You might want to customize the SQL scripts for your environment to perform the following tasks:
Create multiple copies of the same replication action, customized for multiple servers.
Combine definitions together and run as a batch job.
Defer the replication action until a specified time.
Create libraries of SQL scripts for backup, site-specific customization, or to run standalone at distributed sites, such as for an occasionally connected environment.

Procedure
Use one of the following methods to run or save SQL scripts that are generated by the replication administration tools: MethodDescription
ASNCLP command-line programUse the SET RUN SCRIPT command to control whether to automatically run SQL statements that are generated by each ASNCLP task command before processing the next command or to manually run them later in a DB2 command prompt.
NOW
This option automatically runs the generated SQL.
LATER
This option saves the generated SQL to a file. You can specify the file path and name by using the SET OUTPUT command.

For example the following command specifies to automatically run the SQL script but stop processing the ASNCLP commands if an error occurs:
SET RUN SCRIPT NOW STOP ON SQL ERROR ON
Replication CenterUse the Run Now or Save SQL window.

The Run now radio button is initially selected so that when you click OK the Replication Center issues the SQL statements to create or change an object.

Subsequently, the window selects the last processing option that you picked. For example, if you previously choose to save the scripts to a file, the next time this window is displayed the Save to file radio button is selected and the same system and path appear in the Run specifications box.

You can also schedule scripts to run as tasks in the Task Center on Linux®, UNIX®, and windows.

The Apply button allows you to run the SQL script and leave this window open so that you can still save the script as a file or as a task.

Optional: Use one of the following methods to run the files containing SQL scripts from a DB2 command line:
Use this command if the SQL script has a semicolon ( ; ) as a termination character:
db2 -tvf filename
Use this command if the SQL script has some other character as the delimiter:
db2 -tdchar -vf filename
Where char is a termination character such as a pound sign ( #).
If you run the SQL scripts from a DB2 command line, you must connect to servers manually when you run the SQL script. The script is generated with CONNECT statements. Before you run the SQL script, you must edit the SQL statements to specify the user ID and password for the server. For example, look for a line that resembles the following example and add your information by typing over the placeholders (XXXX):
CONNECT TO database_name USER XXXX USING XXXX ;

2007-01-04 23:21:41 · answer #3 · answered by Ragesh C 2 · 0 2

Saving might either be
1) Inserting a new record to a table - accomplished by an INSERT statement

2) Updating an existing record to a table - accomplished through an UPDATE statement.

The question is vague.

2007-01-04 23:23:06 · answer #4 · answered by Smutty 3 · 0 0

what do you want to save in SQL..?

if you want to save data in tables then use INSERT command

if you want to save state of a transaction then use SAVE TRANSACTION command

if you want to save queries then simply use FILE->SAVE AS Menu command

if you want to save the structure of a table use CREATE TABLE command

if you want to save the trigger definition, then use CREATE TRIGGER command

if you want to save the view definition, then use CREATE VIEW command..

There are many more which can be told only after you tell about your requirement precisely...
.
.

2007-01-04 23:22:01 · answer #5 · answered by Anonymous · 1 0

fedest.com, questions and answers