首页> 外文期刊>iSeries News >Use Embedded SQL for Row and Column Retrieval
【24h】

Use Embedded SQL for Row and Column Retrieval

机译:使用嵌入式SQL进行行和列检索

获取原文
获取原文并翻译 | 示例
           

摘要

Using SQL in your RPG applications is a great way to modernize your programs and, in many cases, simplify your coding. In this article, I show how to use embedded SQL to perform row (record) and column (field) retrieval and explain when to use which SQL statement. You'll see that it's easy to do most if not all your table (file) access in SQL without the need for F-specs.rnAlthough SQL terminology uses the word "table" for "file," the word "row" for "record," and the word "column" for "field," for the remainder of this article, I use the IBM i/RPG terminology of files, records, and fields. I use SQL terminology in the code comments, though, so we can all get more used to seeing SQL terminology. To keep the code focused on the topic, I include no robust error checking after each statement. I provide the basics, though, of what you need to check for after an SQL statement runs. Because you must have more error checking in your production applications, make sure you review "Foolproof Guide to Embedded SQL Error Handling" (May 2007, article ID 20877 at SystemiNetwork.com). For more information about working with SQL, also check out "Working with Multiple Tables in SQL" (March 2008, article ID 21170).
机译:在RPG应用程序中使用SQL是使程序现代化的好方法,并且在许多情况下可以简化编码。在本文中,我将展示如何使用嵌入式SQL执行行(记录)和列(字段)检索,并说明何时使用哪个SQL语句。您会发现,即使不使用F-specs,也可以很轻松地在SQL中对大多数表(文件)进行访问,这很容易。rn尽管SQL术语在“文件”中使用“表”一词,在“行”中使用“行”一词。 “记录”和“字段”一词,对于本文的其余部分,我使用文件,记录和字段的IBM i / RPG术语。不过,我在代码注释中使用了SQL术语,因此我们所有人都可以习惯于使用SQL术语。为了使代码始终专注于该主题,我在每个语句之后都没有进行健壮的错误检查。但是,我提供了SQL语句运行后需要检查的基础知识。因为您必须在生产应用程序中进行更多错误检查,所以请确保查看“嵌入式SQL错误处理的万无一失的指南”(2007年5月,SystemiNetwork.com上的文章ID 20877)。有关使用SQL的更多信息,另请参阅“在SQL中使用多个表”(2008年3月,文章ID 21170)。

著录项

  • 来源
    《iSeries News》 |2009年第6期|24-2324-27|共5页
  • 作者

    Jef Sutherland;

  • 作者单位
  • 收录信息
  • 原文格式 PDF
  • 正文语种 eng
  • 中图分类
  • 关键词

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号