Page 1 of 1

Net Error 0

Posted: Tue 15 Jun 2010 08:50
by parksj
odac 5.8 version was working correctly at the source
odac 6.90.0.51/ 6.90.0.58 version does not work.
I'm using update query 'net error 0' message occurs.

Sources are listed below.

--------------------------------------------------

SQL.Text: =
'UPDATE TR_REPOSITORY SET' +
'REP_NAME =: REP_NAME,' +
'CREATE_USER =: CREATE_USER,' +
'LAST_MIG_USER =: LAST_MIG_USER,' +
'IS_DELETE =: IS_DELETE' +
'WHERE REP_ID =: REP_ID';

ParamByName ('REP_ID'). AsInteger: = REP_ID;
ParamByName ('REP_NAME'). AsString: = REP_NAME;
ParamByName ('CREATE_USER'). AsString: = CREATE_USER;
ParamByName ('LAST_MIG_USER'). AsString: = LAST_MIG_USER;
ParamByName ('IS_DELETE'). AsString: = IS_DELETE;

ExecSQL;


--------------------------------------------------

Posted: Tue 15 Jun 2010 15:26
by bork
Hello

Please provide us the DDL script for creating the TR_REPOSITORY table.

Also we need the following information:
- Connection mode: Direct or OCI
- Oracle server and client versions
- Do you use Unicode mode or not

Posted: Wed 16 Jun 2010 01:53
by parksj
The following table srcipt like.

CREATE TABLE TR_REPOSITORY
(
REP_ID NUMBER,
REP_NAME VARCHAR2 (300 BYTE),
CREATE_DATE DATE DEFAULT SYSDATE,
CREATE_USER VARCHAR2 (100 BYTE),
LAST_MIG_DATE DATE,
LAST_MIG_USER VARCHAR2 (100 BYTE),
IS_DELETE CHAR (1 BYTE) DEFAULT 'N' NOT NULL,
RES_CNT NUMBER DEFAULT 0,
RES_SIZE NUMBER DEFAULT 0
)

- Connection mode uses the Direct
- Oracle server Version of Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 64bi is
- Unicode mode does not use.

thank you!

Posted: Wed 16 Jun 2010 15:02
by bork
Hello

I executed the following code:

Code: Select all

var
  OraSession: TOraSession;
  OraQuery: TOraQuery;
  TableName: string;
begin
  TableName := 'TR_REPOSITORY_TEMP';

  OraSession := TOraSession.Create(self);
  OraQuery := TOraQuery.Create(self);

  try
    OraSession.Options.Direct := True;
    OraSession.Server := 'DB:1525:ORCL1020';
    OraSession.Username := 'scott';
    OraSession.Password := 'tiger';
    OraSession.Open;

    OraQuery.Session := OraSession;

    //--- Prepare table ---
    try
      OraQuery.SQL.Text := 'drop table ' + TableName;
      OraQuery.ExecSQL;
    except
    end;

    OraQuery.SQL.Text :=
      'CREATE TABLE ' + TableName + ' ' +
      '( ' +
      'REP_ID NUMBER, ' +
      'REP_NAME VARCHAR2 (300 BYTE), ' +
      'CREATE_DATE DATE DEFAULT SYSDATE, ' +
      'CREATE_USER VARCHAR2 (100 BYTE), ' +
      'LAST_MIG_DATE DATE, ' +
      'LAST_MIG_USER VARCHAR2 (100 BYTE), ' +
      'IS_DELETE CHAR (1 BYTE) DEFAULT ''N'' NOT NULL, ' +
      'RES_CNT NUMBER DEFAULT 0, ' +
      'RES_SIZE NUMBER DEFAULT 0 ' +
      ')';
    OraQuery.ExecSQL;

    OraQuery.SQL.Text :=
      'insert into ' + TableName + '(REP_ID, IS_DELETE) values(1, ''N'')';
    OraQuery.ExecSQL;

    //--- Update table ---
    OraQuery.SQL.Text :=
      'UPDATE ' + TableName + ' SET ' +
      'REP_NAME = :REP_NAME, ' +
      'CREATE_USER = :CREATE_USER, ' +
      'LAST_MIG_USER = :LAST_MIG_USER, ' +
      'IS_DELETE = :IS_DELETE ' +
      'WHERE REP_ID = :REP_ID';

    OraQuery.ParamByName('REP_ID').AsInteger := 1;
    OraQuery.ParamByName('REP_NAME').AsString := '1';
    OraQuery.ParamByName('CREATE_USER').AsString := '1';
    OraQuery.ParamByName('LAST_MIG_USER').AsString := '1';
    OraQuery.ParamByName('IS_DELETE').AsString := 'd';

    OraQuery.ExecSQL;
  finally
    OraQuery.Destroy;
    OraSession.Destroy;
  end;
end;
This code was executed and table was updated without any errors.

I cannot reproduce this issue. Please modify the code that I posted before so it will reproduce your issue.

The problem is resolved.

Posted: Mon 21 Jun 2010 09:05
by parksj
The problem is resolved.

oracle server automatically set the charset values have not been.

Was resolved by setting the value on the design.

Posted: Mon 21 Jun 2010 09:31
by bork
It is good to see that this problem has been solved. If any other questions come up, please contact me.