Chapter -09 Creating Procedures 00

Objectives

After competing this lesson,you should be able to do the following:

  • Identify the benefits of modualarized and layered subprogram design.
  • Create and call procedures.
  • Use formal and actual parameters
  • Use positional,named ,or mixed notation for passing parameters.
  • Identify the available parameter-passing modes.
  • Handle exceptions in procedures.
  • Remove a procedure
  • Display the prcedures`s information.

Lesson Agenda

  • Using a modularized and layered subprogram desing and identifying the benefits of subprograms.
  • Working with procedures
    • -Creating and calling procedures
    • -Identifying the available parameter-passing modes
    • -Using formal and actual parameters
    • -Using positional,named,or mixed notation
  • Handing execptions in procedures,removing a procedure,and displaying the procedures`s information.

Creating a Modularized Subprogram Desgin

Modularize code into subprograms.

1、Locate code sequences repeated more than onec.

2、Create subprogram P containing the repeated code.

3、Modify original code to invoke the new subprogram.

Creating a Layered Sumprogram Desgin

Create subprogram layers for you application.

  • Data access subprogram layer with SQL logic.
  • Business logic subprogram layer,which may or may not use the data access layer.

Modularizing Development with PL/SQL Blocks

  • PL/SQL is a block-structed language.The PL/SQL code block helps modularize code by using:
    • -Anonymous blocks
    • -Procedures and Functions
    • -Packages
    • -Database triggers
  • The benefits of using modular program constructs are:
    • -Easy maintenance
    • -Improved data security and integrity
    • -Improved performance
    • -Improved code clarity

Anonymous Blocks:Overview

Anonymous blocks:

  • Form the basic PL/SQL block structure
  • Initiate PL/SQL processing tasks from applications
  • Can be nested within the executable section of any PL/SQL block.
[DECLARE        -- Declarationg Section (Optional)
        variable declarations;...]
BEGIN           --Executable Section(Mandatory)
        SQL or PL/SQL statements;
[EXCEPTION      --Exception Section (Optional)
        WHEN exception THEN statements;]
END;            --End of BLock(Mandatory)

PL/SQL Run-time Architecture

What Are PL/SQL Subprograms?

  • A PL/SQL subprogram is a named PL/SQL block that can be called with a set fo prameters.
  • You can declare and define a subprogram within either a PL/SQL block or another subprogram.
  • A subprogram consists of a specification and a body
  • A subprogram can be a procedure or a function.
  • Typically,you use a procedure to perform an action and a fuction to compute and return a value.
  • Subprograms can be grouped into PL/SQL packages.

The benefits of Using PL/SQL Subprograms

Differences Between Anonymous Blocks and Subprograms

Anonymous BlocksSubprograms
Unnamed PL/SQL blocksNamed PL/SQL blocks
Compiled every timeCompiled only once
Not stored in the databaseStored in the database
Cannot be invoked  by other applicatonsNames and,therefore,can be invoked by other applicaitons
Do not return valuesSubprograms called functions must return values.
Cannot take parametersCan take parameters

 

 

 

 

 

 

 

 

转载于:https://www.cnblogs.com/arcer/archive/2013/04/19/3029946.html

### 回答1: 《有限元程序-第二版》是一本关于有限元方法的教材。有限元方法是一种用于求解工程问题的数值方法,广泛应用于力学、结构、流体力学等领域。本书的第二版相比第一版做了一些更新和补充。 这本书首先介绍了有限元分析的基本原理和步骤。通过将连续问题离散化为有限个子域单元,然后构建节点间的连接关系,可以得到线性方程组。接着,介绍了单元的选取方法和常用的插值函数,这些是构建有限元模型的基础。 在模型建立完成后,本书介绍了求解线性方程组的方法,包括矩阵求逆、高斯消元、共轭梯度等。同时,也介绍了非线性方程组的求解方法,如牛顿法和弧长法。这些方法可以用于求解各种不同类型的工程问题。 在第二版中,也增加了对多物理场耦合问题的讨论。多物理场耦合是指不同物理量之间相互影响的情况,如结构与流体的耦合、热传导与机械变形的耦合等。通过有限元方法,可以模拟和分析这些复杂的耦合问题,并得到准确的结果。 此外,本书还介绍了有限元后处理的技术,包括结果的可视化和分析。通过绘制等值线图、云图等图形,可以更好地理解和解释有限元计算结果。 总之,《有限元程序-第二版》是一本全面介绍有限元方法的教材,从理论到实践都有详细的讲解。无论是学习有限元方法的初学者还是从事有限元分析工作的工程师,都可以从本书中获得帮助。 ### 回答2: 《有限元程序 - 第二版》是一本与有限元分析相关的重要参考书。有限元方法是一种数值分析技术,用于求解结构力学、流体力学、电磁场、热传导等领域中的物理问题。该书覆盖了有限元方法的基础理论、数值计算方法以及工程应用等方面的内容。 第二版相对于第一版进行了更新和改进。首先,书中对有限元理论进行了更加详细和系统的介绍,包括有限元的基本原理、离散化方法、形函数的选择以及误差估计等。此外,书中还介绍了不同类型的有限元、有限元网格划分技术以及常用的数值积分方法等。 《有限元程序 - 第二版》还提供了丰富的示例和案例,以帮助读者理解和掌握有限元方法的实际应用。书中给出了具体的算法和代码,并通过计算机仿真实验来验证有限元方法的有效性和准确性。 此外,该书还介绍了一些常用的有限元软件和工具,如ANSYS、ABAQUS等,以及如何使用这些软件进行结构分析和优化设计。 总的来说,《有限元程序 - 第二版》是一本非常有价值的专业书籍,对于从事结构力学、流体力学、电磁场、热传导等领域研究的工程师和学者来说是一本不可或缺的参考资料。无论是初学者还是有经验的专业人士都可以从中获得有关有限元分析的理论知识和实际应用方面的宝贵信息。 ### 回答3: 《有限元程序-第二版》是一本非常重要的书籍,它涵盖了有限元程序的基本原理和方法。有限元分析是一种广泛应用于工程领域的数值方法,用于解决结构力学、热力学和流体力学等问题。 本书首先介绍了有限元方法的基本概念,包括离散化、插值函数和加权残差方法等。其次,书中详细介绍了有限元分析的基本步骤,包括建立有限元模型、确定系统边界条件、选择适当的数学模型和求解技术等。这些步骤使读者能够了解如何从实际工程问题出发,建立相应的数学模型,并通过有限元分析得出准确的结果。 此外,本书还介绍了有限元方法的进阶内容,包括非线性和动态分析、优化设计和不确定性分析等。这些内容对于解决复杂的工程问题非常重要,能够帮助工程师们提高设计效率和准确性。 本书第二版在第一版的基础上进行了更新和完善。它包含了最新的研究成果和工程实践经验,丰富了实例和案例分析,使读者能够更好地理解和应用有限元程序。此外,第二版还对一些问题进行了补充和改进,使其更贴近实际工程应用。 总之,《有限元程序-第二版》是一本全面介绍有限元分析方法和技术的重要参考书,对于从事工程分析和设计的人员来说,具有很高的参考价值。它不仅能够帮助读者掌握有限元方法的基本原理和操作技巧,还能够提供解决复杂工程问题的思路和方法。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值