0

我目前正在 cobol2 中创建我的项目 .. 我正在使用 microfocus 的可视化 cobol 并为我的数据库使用 Ado.net .. 在 openesql 助手的界面上,我可以在我的数据库表中插入值.. 但在表单上我的项目在按钮 1 上单击时出现错误提示“未设置 SQL 指令”

(这是我的代码

method-id button1_Click final private.
   procedure division using by value sender as object e as type System.EventArgs.

   EXEC SQL
    INSERT INTO NayreInventory  
    (ItemCode
    ,ItemDescription
    ,Quantity
    ,Price
     ) VALUES (
     :NayreInventory-ItemCode:NayreInventory-ItemCode-0001
    ,:NayreInventory-ItemDescription:Col-2-MEDICOL
    ,:NayreInventory-Quantity:NayreInventory-Quantity-5
    ,:NayreInventory-Price:NayreInventory-Price-150
     )
   END-EXEC. 

   invoke type MessageBox::Show("1 RECORD HAS BEEN SUCCESSFULLY ADDED", "RESULT")
   end method.

)如何摆脱错误..请帮助我..我真的不需要你的帮助..

4

2 回答 2

1

有多种方法可以指定 Micro Focus COBOL 编译器指令。指定SQL/NOSQL 指令的一种方法是将指令嵌入到 COBOL 源中,$在第 7 列中,如下所示:

      $SET SQL

或者,根据您的需要:

      $SET NOSQL

您也可以使用命令行

cob -C SQL ...source file name and other arguments

点击链接了解更多详情。

于 2013-03-06T16:09:58.553 回答
1

你也有这样的留言号码吗?

“0149 没有设置 SQL 指令”

该消息的描述是:

“遇到了 EXEC SQL 语句,但未指定 SQL 指令。语句的处理取决于是否设置了指令 SQL;必须显式指定 SQL 或 NOSQL。

另请参阅:Server Express 用户指南中编译器指令一章中的 SQL 编译器指令。”

所以看起来你的编译脚本中缺少一个“编译器选项”。

这来自: http: //supportline.microfocus.com/documentation/books/sx20books/emsynt.htm

为了获取信息,我刚刚搜索了您的错误消息。

于 2013-03-05T18:12:16.277 回答