1

I am trying to search some text in a Blob sub_type 1 field. When the search text is from 1 to 28 characters, the search works fine. When the search text is over 28 characters, I am getting a "-303 arithmetic exception, numeric overflow, or string truncation" exception.

When I run the sql from the DB, it works fine, the issue occurs only when using the .NET driver.

I tried changing the parameter.FbDbType to FbDbType.Text, but I then got a "-303 internal error".

I am running out of ideas here. Can someone help me please?

Thanks in advance

K

UPDATE:

Here is a sample application with the same result:

        try
        {
            FbConnectionStringBuilder csFB = new FbConnectionStringBuilder();
            csFB.Database = @"C:\MyDatabase\ITEMS.FDB";
            csFB.UserID = "SYSDBA";
            csFB.Password = "masterkey";
            csFB.Pooling = true;
            csFB.ServerType = FbServerType.Embedded;

            using (var connection = new FbConnection(csFB.ToString()))
            {
                connection.Open();

                using (var command = connection.CreateCommand())
                {
                    var param = command.CreateParameter();
                    param.FbDbType = FbDbType.VarChar;
                    param.Value = "TESTTESTTESTTESTTESTTESTTESTTESTTESTTEST@TEST.COM";
                    //param.Value = "TEST@TEST.COM";
                    param.ParameterName = "@parm0";

                    command.Parameters.Add(param);

                    command.CommandText = "SELECT * FROM itemprops WHERE UPPER(SUBSTRING(itemdisplaysrcaddr FROM 1))  CONTAINING @parm0";

                    using (var reader = command.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            Console.WriteLine(Convert.ToString(reader["itemdisplaysrcaddr"]));
                        }
                    }
                }

                connection.Close();
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.ToString());
        }

        Console.ReadLine();

0 Answers0