#1 2015-03-21 23:16:51

cloudcon
Member
From: Vitória - Brasil
Registered: 2014-05-12
Posts: 9
Website

TSQLDBOracleLib error: OCI-21560: argument 10 is null, invalid, or out

Good evening again,
I am starting my http server but found a following problem.
I created the class, called the method "aServer.CreateMissingTables (0);" the framework created everything perfectly.
But when I try to make the call by the browser "http://localhost:8081/root/WmsEmpresa" it returns me the following error
"OCI-21560: 10 argument is null, invalid, or out of range"

Where my code

Class

unit SQLWMS_EMPRESA;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, SynLog,
  mORMot, mORMotSQLite3, SynSQLite3Static, mORMotHttpServer, SynCommons;

type
  /// WMS_EMPRESA Table
  // - type definition auto-generated by SynDBExplorer 1.18.1094 at 2015-03-21 18:37:45
  // from CLOUDCON.WMS_EMPRESA
  // - note that the ORM will add one missing ID field via:
  // $ ALTER TABLE CLOUDCON.WMS_EMPRESA ADD ID NUMBER(22,0) NOT NULL PRIMARY KEY
  TSQLWmsEmpresa = class(TSQLRecord)
  protected
    fEMP_CODIGO: Int64;
    fEMP_RAZAO: RawUTF8;
    fEMP_FANTASIA: RawUTF8;
    fEMP_CNPJ: RawUTF8;
    fEMP_IESTADUAL: RawUTF8;
    fEMP_IMUNICIPAL: RawUTF8;
    fEMP_ENDERECO: RawUTF8;
    fEMP_BAIRRO: RawUTF8;
    fEMP_CIDADE: RawUTF8;
    fEMP_UF: RawUTF8;
    fEMP_CEP: RawUTF8;
    fEMP_COMPLEMENTO: RawUTF8;
    fEMP_EMAIL: RawUTF8;
    fEMP_FAX: RawUTF8;
    fEMP_TELEFONE: RawUTF8;
    fEMP_OBS: RawUTF8;
  published
    /// match WMS_EMPRESA.EMP_CODIGO [NUMBER 22 0 0] *
    property EMP_CODIGO: Int64 read fEMP_CODIGO write fEMP_CODIGO;
    /// match WMS_EMPRESA.EMP_RAZAO [VARCHAR2 100 0 0] *
    property EMP_RAZAO: RawUTF8 index 100 read fEMP_RAZAO write fEMP_RAZAO;
    /// match WMS_EMPRESA.EMP_FANTASIA [VARCHAR2 120 0 0] *
    property EMP_FANTASIA: RawUTF8 index 120 read fEMP_FANTASIA write fEMP_FANTASIA;
    /// match WMS_EMPRESA.EMP_CNPJ [VARCHAR2 18 0 0] *
    property EMP_CNPJ: RawUTF8 index 18 read fEMP_CNPJ write fEMP_CNPJ;
    /// match WMS_EMPRESA.EMP_IESTADUAL [VARCHAR2 20 0 0] *
    property EMP_IESTADUAL: RawUTF8 index 20 read fEMP_IESTADUAL write fEMP_IESTADUAL;
    /// match WMS_EMPRESA.EMP_IMUNICIPAL [VARCHAR2 20 0 0] *
    property EMP_IMUNICIPAL: RawUTF8 index 20 read fEMP_IMUNICIPAL write fEMP_IMUNICIPAL;
    /// match WMS_EMPRESA.EMP_ENDERECO [VARCHAR2 200 0 0] *
    property EMP_ENDERECO: RawUTF8 index 200 read fEMP_ENDERECO write fEMP_ENDERECO;
    /// match WMS_EMPRESA.EMP_BAIRRO [VARCHAR2 100 0 0] *
    property EMP_BAIRRO: RawUTF8 index 100 read fEMP_BAIRRO write fEMP_BAIRRO;
    /// match WMS_EMPRESA.EMP_CIDADE [VARCHAR2 100 0 0] *
    property EMP_CIDADE: RawUTF8 index 100 read fEMP_CIDADE write fEMP_CIDADE;
    /// match WMS_EMPRESA.EMP_UF [VARCHAR2 2 0 0] *
    property EMP_UF: RawUTF8 index 2 read fEMP_UF write fEMP_UF;
    /// match WMS_EMPRESA.EMP_CEP [VARCHAR2 15 0 0] *
    property EMP_CEP: RawUTF8 index 15 read fEMP_CEP write fEMP_CEP;
    /// match WMS_EMPRESA.EMP_COMPLEMENTO [VARCHAR2 200 0 0] *
    property EMP_COMPLEMENTO: RawUTF8 index 200 read fEMP_COMPLEMENTO write fEMP_COMPLEMENTO;
    /// match WMS_EMPRESA.EMP_EMAIL [VARCHAR2 60 0 0] *
    property EMP_EMAIL: RawUTF8 index 60 read fEMP_EMAIL write fEMP_EMAIL;
    /// match WMS_EMPRESA.EMP_FAX [VARCHAR2 20 0 0] *
    property EMP_FAX: RawUTF8 index 20 read fEMP_FAX write fEMP_FAX;
    /// match WMS_EMPRESA.EMP_TELEFONE [VARCHAR2 20 0 0] *
    property EMP_TELEFONE: RawUTF8 index 20 read fEMP_TELEFONE write fEMP_TELEFONE;
    /// match WMS_EMPRESA.EMP_OBS [VARCHAR2 500 0 0] *
    property EMP_OBS: RawUTF8 index 500 read fEMP_OBS write fEMP_OBS;
  end;


implementation

uses
  SynCrtSock;

end.
unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, SynDBOracle,mORMotDB;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses
  mORMot, mORMotSQLite3, mORMotHttpServer, SQLWMS_EMPRESA;

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
  aProps: TSQLDBOracleConnectionProperties;
  aModel: TSQLModel;
  aServer: TSQLRestServerDB;
  aHTTPServer: TSQLHttpServer;
begin
  aProps := TSQLDBOracleConnectionProperties.Create('xe', 'cloudcon', 'cloudcon', 'cloud123');
  aModel := TSQLModel.Create([TSQLWmsEmpresa], 'root');
  VirtualTableExternalRegisterAll(aModel, aProps, false);

  aServer := TSQLRestServerDB.Create(aModel, false);
  aServer.CreateMissingTables(0);
  aServer.NoAJAXJSON := False;

  aHTTPServer := TSQLHttpServer.Create('8081', [aServer], '+', useHttpApiRegisteringURI);
  aHTTPServer.OnlyJSONRequests := False;
  aHTTPServer.AccessControlAllowOrigin := '*'; // for AJAX requests to work
end;

end.

I need help

Offline

#2 2015-03-22 08:30:22

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: TSQLDBOracleLib error: OCI-21560: argument 10 is null, invalid, or out

What is the failing SQL statement?

Offline

Board footer

Powered by FluxBB