将数据插入SQL Server返回错误代码00q [英] Inserting data into SQL Server returns error code 00q

查看:103
本文介绍了将数据插入SQL Server返回错误代码00q的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先:我的代码最大一部分是在几周前工作的。同时,我们已经从MySQL服务器转换为SQL服务器,并对模式设计进行了一些更改。

First of all: the biggest part of my code was working a few weeks ago. In the mean time, we've swapped from a MySQL server to a SQL server and we've changed the schema design a little.

我使用Percobol,它利用了据我所读,OpenCobol编译器。

I use Percobol, which utilizes the OpenCobol compiler as far as I've read.

PERFORM 2010-GEBRUIKER-INSERT
PERFORM 2020-GEBRUIKER-JOINTABLE

2010-GEBRUIKER-INSERT.
MOVE "GEBRUIKER" TO GEBR_TYPE
EXEC SQL INSERT INTO Gebruikers
   VALUES ( TRIM( :LOGIN ), TRIM( :ACHTERNAAM ),
            TRIM( :EMAIL ), TRIM( :PROJECTCODE ),
            TRIM( :GEBR_TYPE ), TRIM( :VOORNAAM ),
            SHA1( TRIM( :WACHTWOORD ) ) )   
END-EXEC
.

2020-GEBRUIKER-JOINTABLE.
EXEC SQL INSERT INTO LeertrajectenGebruikersJoin
   VALUES (TRIM( :PROJECTCODE ), TRIM( :LOGIN))
END-EXEC
.

这些表的数据库设计如下:

Whereas the database design of these tables looks like this:

当我在 2010 INSERT 语句之前显示值,所有内容都会正确显示。当我尝试在 INSERT 之后显示它们时,不会显示它们。

When I display the values before the INSERT statement in 2010, everything is shown correctly. When I try to display them after the INSERT, they aren't shown.

抛出的错误(即被记录器捕获)告诉我错误代码 00q 。我一直在进行搜索,但似乎找不到它的意思。就我所见,以 00 开头的代码应该表明一切都很好。

The error thrown (which is getting caught in my logger) tells me of errorcode 00q. I've been doing some searching but can't seem to find what it means. Even more so, as far as I've seen a code starting with 00 should indicate everything is fine.

所使用的字段这样声明并从CSV文件填充:

The fields used are declared like this and populated from a CSV file:

01 WS-INPUT.
        05 ACHTERNAAM PIC X(25) VALUE SPACES.
        05 VOORNAAM PIC X(15) VALUE SPACES.
        05 EMAIL PIC X(50) VALUE SPACES.
        05 LOGIN PIC X(15) VALUE SPACES.
        05 WACHTWOORD PIC X(11) VALUE SPACES.
        05 GEBR_TYPE PIC X(20) VALUE SPACES.
        05 PROJECTCODE PIC X(10) VALUE SPACES.

我忽略了什么会返回此错误?
也很重要:当我更改JDBC字符串或inputfile字符串时,记录器会通知我有关连接错误的信息。因此,我假设连接和数据读取均按预期工作。

What have I overlooked that could return this error? Also important: When I change my JDBC string or inputfile string, I get notified by my logger about a faulty connection. Therefore I'm assuming both the connection and the reading of data are working as intended.

推荐答案

确定,因为这就是您要执行的操作根据另一个问题,这里已经做完了,这是从评论到回答:-)

OK, since this is what you have done, according to another question, here it is from comment to answer :-)

定义PIC-(4)9字段。将您的sql错误代码移至该代码,然后打印/显示该代码。我想您会发现q是一个负数,希望您可以在sql文档中进行跟踪。

Define a PIC -(4)9 field. Move your sql error-code to that, and print/DISPLAY that. I think you'll find the q is a negative number, which you can hopefully track in your sql documentation.

这篇关于将数据插入SQL Server返回错误代码00q的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆