DataLoad命令集

DataLoad命令集  


Sending Keystrokes
By default, DataLoad Macros use copy and paste to enter data into the target application, and on most occasions this is the best approach. Occasionally, however, it is desirable to be able to send keystrokes to the application. DataLoad allows you to send the entire keyboard's printing and most non-printing (E.g. the function keys) characters to the active window as if they were typed at the keyboard. To specify that a cell should result in key presses the text should be preceded with a backslash. For example, the following would result in each of the specified keys, except for '\', to be sent as simulated key presses.

\Send this as keystrokes

To send a cell which must start with a backslash using copy and paste, precede the cell text with a second backslash. For example, the following will cause "\Send this as keystrokes" to be pasted into the target application:

\\Send this as keystrokes

One or more characters represent each key. To specify a single keyboard character, use the character itself. For example, to send the letter A, use \A. To send multiple characters, append each additional character to the one preceding it. To send the letters A, B, and C, use \ABC. When DataLoad presses a specified key it automatically takes account of any other key which may need to be pressed to send the exact character which was specified. For instance, if a form. field is populated by using the command \A an 'A' will appear in the field, that is the character's case is preserved. In the example of uppercase characters the shift key is automatically depressed with the character key to send an uppercase letter.

To use any combination of the Shift, Control, Alt and right Alt keys one of the following codes should be used: 

Key Code
SHIFT +
CTRL   ^
ALT %
Right Alt &

Each of these codes toggles the key in question. Each of these keys is initially in the "up" position and when one of those codes are used the desired key is depressed. When the code is used again the key is lifted, and so on. If any keys are left depressed when the DataLoad cell has been processed the key is lifted. The following are examples: 

Cell Contents Effect in Active Window
\%F% Alt-F
\%F Same as above

If you want to send the +, ^, % or & keys these characters must be enclosed in braces {}. For example, to send '2 +2=4' the following should be entered in the DataLoad cell:

\{2+2=4}

To send a key or a number of keys multiple times, use the following syntax:

\{key(s) number}

You must put a space between the key(s) and number. For example, {d 10} means press d 10 times, while {Data 5} sends the keys 'Data' 5 times. The non-printing characters described below can also be sent multiple times in this way.

To specify characters that aren't displayed when you press a key, such as ENTER or TAB, and keys that represent actions rather than characters, use the codes shown below. Note that these codes are also enclosed in braces.

Key Code
BACKSPACE {BACKSPACE}
DELETE {DELETE}  
UP ARROW {UP}
DOWN ARROW {DOWN}
LEFT ARROW {LEFT}
RIGHT ARROW {RIGHT}
END {END}
ENTER {ENTER}
TAB {TAB}
ESC {ESC}
HOME {HOME}
PAGE DOWN {PGDN}
PAGE UP {PGUP}
INSERT {INSERT}
F1 {F1}
F2 {F2}
F3 {F3}
F4 {F4}
F5 {F5}
F6 {F6}
F7 {F7}
F8 {F8}
F9 {F9}
F10 {F10}
F11 {F11}
F12 {F12}
F13 {F13}
F14 {F14}
F15 {F15}
F16 {F16}
 
DATALOAD的基本操作命令:
TAB:按键盘上tab键一下;
\{TAB 2}:按tab键 两下,如此类推;
*DN:按向下箭头;
ENT:按ENTER键一下;
\^:代表CTRL键,如要按组合键如CTRL+S:\^S,CTRL+F4:\^{F4}(其他如此类推);
\%:代表ALT键,如要;按组合键如ALT+F:\%F(其他如此类推);
\{}:代表按下键盘上功能键,要什么功能键就在{}中写,如要按F1键:\{F1},向下的箭头键:\{DOWN}(其他如此类推);
*ML(684,120):代表按下鼠标左键,括号中的数字代表鼠标在屏幕上的坐标;
(如:在ERP窗口把鼠标定位在需要点的位置,然后通过键盘上ALT+TAB键切换到DATALOAD的窗口输入“*ML”就会自动带出当前鼠标坐标。)
定位光标位置:

在DATALOAD程序的DATA位置,在Mainload单元格中输入:*ml(   后,就会提示

DataLoad命令集

意思:自动记录点击确定按键后的第一次点击鼠标的光标位置。

 


*SL2:代表停留,后面的数字是停下的秒数;(在适当的位置停下一定的时间,可以使DATALOAD更加流畅,而且不容易出错。)
*SB:代表按下 空格键
这里只是将比较常用的命令列出来,大家可以举一反三,并在使用中不断熟悉。
在写DATALOAD的过程中,要注意根据窗口切换时的时间,插入一些时间的停留命令,使其有适当的停顿将会避免出错。
对于以下的设置,对时间的控制也是非常重要的:
DataLoad命令集
使用导入工具,一定要熟悉ORACLE ERP的操作,特别是快捷键的操作(每个界面按扭文字说明后一般都会有带一个字母,就是快捷键,如登记销售订单,快捷键就是ALT+B,在Dataload工具里就是\%B)。在不是必要的情况下不要用鼠标操作,容易定位错位置,且不同的电脑上定位可能不同。
其实:在很多情况下,程序自身的帮助文件提供了详细的操作说明,包括各种按键、命令的应用。
<think>我们正在处理一个关于Dataload命令行工具使用指南及命令列表的查询。根据提供的引用内容,我们可以看到一些与数据加载相关的命令片段,如引用[1]中提到的`SET UNIQUE_CHECKS=0;`和`load data infile`命令,以及引用[3]中关于设置SQL模式的说明。这些信息可以帮助我们构建答案。 由于用户要求的是Dataload命令行工具的使用指南和命令列表,我们主要关注MySQL中用于数据加载的命令,因为引用中提到了`load data infile`,这是MySQL中常用的数据导入命令。 我们将围绕MySQL的`LOAD DATA INFILE`命令展开,提供其基本语法、常用选项以及一些使用示例。同时,我们也会参考引用中提到的其他相关设置(如`UNIQUE_CHECKS`和SQL模式)对数据加载性能的影响。 ### 回答结构 1. **介绍**:简要介绍`LOAD DATA INFILE`命令的作用。 2. **基本语法**:给出命令的基本语法格式。 3. **常用选项说明**:解释常用选项的含义和用法。 4. **性能优化建议**:结合引用内容,提供优化数据加载速度的建议。 5. **示例**:给出几个实际示例。 6. **注意事项**:包括权限、文件位置等注意事项。 ### 生成回答 由于引用[1]中提到了`SET UNIQUE_CHECKS=0`和`1`的设置,引用[2]提到了flush策略和文件系统调优,引用[3]提到了SQL模式的设置,这些都可以作为优化数据加载的参考。 因此,在回答中,除了基本命令指南,我们还会包括一些性能优化技巧,这些技巧来源于提供的引用。 ### 相关问题 根据用户的问题,我们生成以下相关问题: 1. 如何解决`LOAD DATA INFILE`命令中的权限问题? 2. 如何优化大数据量导入MySQL的速度? 3. `LOAD DATA INFILE`和`mysqlimport`有什么区别? ### 最终回答 注意:由于我们是在模拟环境,且没有外部搜索能力,我们主要基于提供的引用和已知的MySQL知识来回答。</think>### MySQL数据加载命令指南 MySQL中用于高效数据加载的核心命令是`LOAD DATA INFILE`,以下是详细使用指南: #### 1. 基本语法 ```sql LOAD DATA [LOW_PRIORITY | CONCURRENT] INFILE 'file_name' INTO TABLE tbl_name [CHARACTER SET charset] [FIELDS [TERMINATED BY 'string'] [[OPTIONALLY] ENCLOSED BY 'char'] [ESCAPED BY 'char'] ] [LINES [STARTING BY 'string'] [TERMINATED BY 'string'] ] [IGNORE number LINES] [(col_name_or_user_var,...)] [SET col_name = expr,...] ``` #### 2. 关键参数说明 - **LOW_PRIORITY**:延迟执行直到无其他客户端读取表 - **CONCURRENT**:允许并发插入(MyISAM引擎) - **FIELDS TERMINATED BY**:指定列分隔符,如`TERMINATED BY ','` - **ENCLOSED BY**:指定字段包裹符,如`ENCLOSED BY '"'` - **ESCAPED BY**:指定转义字符,默认`\` - **IGNORE n LINES**:跳过文件前n行(如CSV表头) #### 3. 性能优化技巧 ```sql -- 禁用唯一性检查(大数据量时提速) SET UNIQUE_CHECKS = 0; -- 禁用外键约束 SET FOREIGN_KEY_CHECKS = 0; -- 禁用事务自动提交 SET autocommit = 0; -- 执行数据加载 LOAD DATA INFILE '/path/data.csv' INTO TABLE my_table; -- 恢复设置 SET UNIQUE_CHECKS = 1; SET FOREIGN_KEY_CHECKS = 1; COMMIT; ``` > 优化原理:减少磁盘I/O和约束验证开销[^1] #### 4. 文件系统级优化 ```bash # 调整文件系统刷新策略(Ext4示例) mount -o remount,commit=60,data=writeback /path ``` > 通过延迟写入降低I/O负载,但可能增加数据丢失风险[^2] #### 5. SQL模式设置 ```ini # my.cnf配置示例 [mysqld] sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" ``` > 特殊字符处理需调整SQL模式[^3] #### 6. 安全配置 ```sql -- 启用本地文件加载 SET GLOBAL local_infile = 1; -- 文件需位于MySQL安全目录 SHOW VARIABLES LIKE 'secure_file_priv'; ``` ### 典型应用场景 1. **CSV/TXT数据导入** ```sql LOAD DATA INFILE '/data/employees.csv' INTO TABLE employees FIELDS TERMINATED BY ',' ENCLOSED BY '"' IGNORE 1 LINES; ``` 2. **管道数据传输** ```bash cat data.txt | mysql -e "LOAD DATA LOCAL INFILE '/dev/stdin' INTO TABLE log" ``` 3. **动态列映射** ```sql LOAD DATA INFILE 'data.txt' INTO TABLE inventory (sku, @discount_price) SET price = @discount_price * 1.2; ``` ### 注意事项 1. 文件需位于服务器端或具有`LOCAL`权限 2. 批量加载时建议使用`InnoDB`引擎并调整`innodb_buffer_pool_size` 3. Windows系统注意路径分隔符`/var/lib/mysql/data.csv` 4. 字符集不一致时使用`CHARACTER SET utf8mb4`
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值