Inserir NULL por parâmetro - DELPHI

SQL

Delphi

25/10/2019

Olá.

Estou tentando passar um valor NULL por parâmetro, buscando as informações de um arquivo Excel, mas ocorre o erro "objeto parameter definido incorretamente. as informações são inconsistentes ou incompletas". Estou fazendo da seguinte forma:

if StringGrid1.Cells[3,x] = '' then
          Parameters.ParamByName('inicio_validade').Value := NULL
        else
        Parameters.ParamByName('inicio_validade').Value   := FormatDateTime('mm''/''yyyy', StrToDate(StringGrid1.Cells[3,x]));


Alguem sabe o que pode estar ocorrendo?
Nomad

Nomad

Curtidas 1

Melhor post

Nomad

Nomad

27/10/2019

Olá.

Estou tentando passar um valor NULL por parâmetro, buscando as informações de um arquivo Excel, mas ocorre o erro "objeto parameter definido incorretamente. as informações são inconsistentes ou incompletas". Estou fazendo da seguinte forma:

if StringGrid1.Cells[3,x] = '' then
          Parameters.ParamByName('inicio_validade').Value := NULL
        else
        Parameters.ParamByName('inicio_validade').Value   := FormatDateTime('mm''/''yyyy', StrToDate(StringGrid1.Cells[3,x]));


Alguem sabe o que pode estar ocorrendo?


Ninguém?

Obrigado pela ajuda ;)
GOSTEI 1

Mais Respostas

Nomad

Nomad

25/10/2019

Olá.

Estou tentando passar um valor NULL por parâmetro, buscando as informações de um arquivo Excel, mas ocorre o erro "objeto parameter definido incorretamente. as informações são inconsistentes ou incompletas". Estou fazendo da seguinte forma:

if StringGrid1.Cells[3,x] = '' then
          Parameters.ParamByName('inicio_validade').Value := NULL
        else
        Parameters.ParamByName('inicio_validade').Value   := FormatDateTime('mm''/''yyyy', StrToDate(StringGrid1.Cells[3,x]));


Alguem sabe o que pode estar ocorrendo?


Ninguém?
GOSTEI 0
Emerson Nascimento

Emerson Nascimento

25/10/2019


tem certeza que é no NULL que está apresentando o erro?

coloque Variants na cláusula uses e atribua NULL.
GOSTEI 1
POSTAR