Delphi 6 - Data type conversion error, please help

From: Alan (Zoplax_at_gmail.com)
Date: 07/20/04


Date: 20 Jul 2004 09:08:14 -0700

I have a stored procedure object on a form I've created with Delphi 6.

The stored procedure object uses SOAP to connect to a Microsoft SQL
2000 server.

One of the parameters required by the stored procedure is an Integer
ID variable (let's called it record_ID).

The record_ID numbers appear to have gotten larger than a standard
Integer variable; for example, passing 918888847 as the record_ID
works fine, but passing 7111111297 (one digit longer than the first
one) gives "Error converting data type numeric to int".

What's the best way to fix this?

I've enabled the SQL stored procedure to work by declaring the
record_ID input variable as "bigint" instead of "integer". In Delphi,
the variable there is still a plain "integer", I'm guessing I need to
change the variable type:

 myvariable : Cardinal;

...or whatever type is big enough, then pass this to the stored
procedure in Delphi like this:

sp_MySQL_stored_proc.Params.FindParam('record_ID').AsCardinal :=
my_field_value;

Please help, thanks!



Relevant Pages

  • Delphi 2005, ADO, XML
    ... Could someone plz post a working example of retrieving XML data ... Delphi 2005, Microsoft SQL Server 2000. ... I have a stored procedure called myStoredProc which returns ... Comprehensive help on ADO w/ Delphi is almost non-existent! ...
    (borland.public.delphi.database.ado)
  • Re: storedproc.edit: "select permission denied" when assigning to a field
    ... Delphi isn't doing anything inside the stored procedure, ... your loop that you do "updatebatch" to actually apply the changes to the ... That would probably go much faster since the database engine will update the ...
    (borland.public.delphi.database.ado)
  • Re: Hidden error kills my transaction. Help!
    ... Try SET NOCOUNT ON at the beginning of your stored procedure. ... SQL Server MVP ... > - the procedure is called from Delphi using ADO ...
    (microsoft.public.sqlserver.programming)
  • Hidden error kills my transaction. Help!
    ... I have a stored procedure with parameter ... @ID_DOC CharOUTPUT, --for uniqueidentifier ... the procedure is called from Delphi using ADO ... The transaction is rollbacked ...
    (microsoft.public.sqlserver.programming)
  • Re: Identity error?? Please help
    ... table and a stored procedure to increment/return the next available number. ... > strange how Delphi behaves though. ... > each table has an identity column. ... what is the best way to create a master record and retrieve it's ...
    (borland.public.delphi.database.ado)