如果您是使用脚本和函数的新手,请记住以下说明。
对于已经存在于数据库中的对象,比如表、视图、存储过程和函数,可以查看用于创建这些对象的创建脚本或DDL。
For objects such as tables, views, procedures, and functions that already exist in the database, you can view the create script or DDL that was used to create the object.
将这些代码封装到一个函数中,便于理解和重用,并且使脚本更加易于阅读。
Encapsulating this code into a function makes it easier to understand and reuse, and also makes the script easier to read.
因此,若无密码键入,传递到该函数的是未初始化的变量和脚本错误结果。
Hence, with no password entered, the function is passed an uninitialized variable and a script error results.
您已经了解了如何将参数传递给函数或脚本以及如何识别选项,现在开始处理选项和参数。
So now you have looked at how parameters are passed into a function or script and how to identify options. Now to start processing the options and parameters.
到目前为止,您已经创建了一个脚本标头和一些简单变量,并且添加了一个函数,如清单14所示。
So far, you've created a script header and some simple variables and added a function, as shown in Listing 14.
还有一点也和其它语言一样,您可以将这些定制函数收集到库中,而这些库则可以被包含到您的php脚本中。
And, like other languages, you can collect these custom functions within libraries that you can include in your PHP scripts.
而其内置的字符串操纵函数(包括正则表达式),以及程序上的特性和方便性使它成为创建简单“脚本”程序的理想语言。
And its built-in string manipulation functions (including regular expressions), as well as procedural and convenience features make it the ideal language for creating simple "scripting" programs.
CLR向导一旦编译了CLR项目,您就可以生成所需的DB 2ddl脚本,以定义一个或多个CLR存储过程和函数。
CLR WizardOnce your CLR project is compiled, you can then generate the required DB2 DDL script to define the one or more CLR stored procedures and functions.
我们开始使用上述的选项分析和参数分析函数来构建一个脚本。
Let's start off by building a script from the option analysis and parameter analysis functions that you saw above.
对于现有函数,能够执行、查看和删除脚本。
For an existing function, ability to execute, view script, and delete is provided.
因此,要使用用户名db2inst1和密码ibmdb2连接到样本数据库SAMPLE ,可以在我们的脚本中使用下面这个函数
So, to connect to our sample database SAMPLE with user name db2inst1 and password ibmdb2, we can use the following function in our scripts
函数和shell脚本的妙处之一是,通过向单个函数或脚本传递参数能够使它们表现出不同的行为。
Part of the beauty of functions and shell scripts is the ability to make a single function or script behave differently by passing parameters to it.
许多脚本引擎在eval()调用之间维持全局变量和函数的状态。
Many script engines maintain state of global variables and functions between calls to eval().
它会把我们的foo . bar函数公开给脚本和ZClass,并且还有一个作为“可添加的”对象的小接口,这就是全部内容。
It will expose our foo.bar function to scripts and ZClasses, and it will also have a little interface as an "addable" object, and that's about all.
在这个脚本标签中,我们还要通过覆盖response和displayjsonobj函数来向用户显示查询结果。
Within this script tag, we also override response and displayJSONobj functions to display query result to users.
如果用户需要跟踪某个用户函数中的malloc和free调用,那么可以按以下方式修改malloc . d脚本。
If the user needs to track malloc and free calls in a particular user function, the malloc.d script can be modified as shown below.
表2列出了用来从perl脚本中调用系统命令的Perl核心函数和操作符。
Table 2 lists Perl core functions and operators leveraged to call system commands from within a Perl script.
简而言之,都是关于识别在含有特定Solaris系统命令的脚本中使用的Perl核心函数和操作符。
In short, it's all about identifying Perl core functions and operators leveraged in the script that carries Solaris-specific system commands.
所有矩形都设置为响应onclick、onmouseover和onmouseout事件,它们为此调用的是同一个脚本函数。
All the rectangles are set to respond to onclick, onmouseover, and onmouseout events, and all call the same scripted functions to do this.
只需使用exit_msg这样的简单函数和几个逻辑操作符,这个脚本就可以简化成更漂亮更容易理解的程序,见清单14。
By using a simple function like exit_msg and a few logical operators, the script could be condensed into the better-looking and easier-to-understand program shown in Listing 14.
可以通过编写脚本来使用DB 2WorkloadManager (WLM),从而调用表函数、存储过程和事件监视器,收集关于工作负载的信息。
You can use DB2 workload Manager (WLM) by writing your own scripts to call the table functions, stored procedures, and event monitors to gather information about the workload.
函数被重命名,因为“get”和“put”在多用途名称空间中不算好名字,就像旧的simple_go . pl脚本那样。
The functions were renamed because "get" and "put" are not good names in a namespace that does not serve a single purpose, as the old simple_go.pl script did.
如果您运行设置变量或包含函数的脚本,以及在同一个上下文中执行的后续脚本,那么可以使用前一个脚本的变量和函数。
If you run a script that sets variables or contains functions, subsequent scripts executed within the same context can use the variables and functions of the previous scripts.
您可以通过启动合适的脚本编制向导,直接从这些文件夹创建新的SQL过程和函数。
You can create new SQL procedures and functions directly from these folders by launching the appropriate scripting wizard.
大多数外壳都支持函数,这些函数本质上是微型脚本,您可以在其中放置命令和其他外壳脚本元素以执行特定的任务。
Most shells support functions, which are basically mini scripts into which you can place commands and other shell-scripted elements to perform a specific task.
运行所有的变更脚本将视图、存储过程和函数添回到数据库中去。
The tool will run all of the scripts needed to add the views, stored procedures, and functions back into the database.
指定pre-run和post-run脚本,这些脚本分别在执行存储过程或函数之前或之后运行。
Specify pre-run and post-run scripts that will be run before and after the procedure or function is executed, respectively.
如果更改了元数据和消息(例如服务器端类或变量)的组织方法,您将会为更改使用这些元数据和消息的客户机脚本验证函数感到十分头痛。
If you change the way you organize metadata and messages (such as the server-side classes or variables), you end up changing client script validation functions that use them.
要调用脚本设计程序,在Serverexplorer树中使用表、视图、存储过程和函数节点中的Show Script上下文菜单选项。
To invoke it, use the Show Script context menu option that is available on the table, view, stored procedure, and function nodes in the Server Explorer tree.
应用推荐