Меню

Invalid data conversion ошибка

    msm.ru

    Нравится ресурс?

    Помоги проекту!

    !
    информация о разделе

    user posted image Данный раздел предназначается исключительно для обсуждения вопросов использования языка запросов SQL. Обсуждение общих вопросов, связанных с тематикой баз данных — обсуждаем в разделе «Базы данных: общие вопросы». Убедительная просьба — соблюдать «Правила форума» и не пренебрегать «Правильным оформлением своих тем». Прежде, чем создавать тему, имеет смысл заглянуть в раздел «Базы данных: FAQ», возможно там уже есть ответ.

    >
    Invalid data conversion
    , непонятна причина

    • Подписаться на тему
    • Сообщить другу
    • Скачать/распечатать тему



    Сообщ.
    #1

    ,
    04.09.06, 11:26

      Full Member

      ***

      Рейтинг (т): 11

      Привет всем!
      FireBird 1.5/Delphi_7

      Собственно сабж. (IBClientError Invalid data conversion) Ошибка возникает именно при выполнении процедуры в дельфе. В IBExpert сама ХР проходит без проблем. Передаю в процедуру только один параметр строкового типа, ошибаться просто негде! Может у кого есть мысли из-за чего может быть? Текст хранимой процедуры:

      ExpandedWrap disabled

        CREATE PROCEDURE ADD_URL (

            AURL VARCHAR(250))

        RETURNS (

            OID BIGINT)

        AS

        DECLARE VARIABLE COUN INTEGER;

        DECLARE VARIABLE CURID BIGINT;

        begin

          /* Procedure Text */

          for select count(id) from urls where url = :aurl into :coun do

          if (coun = 0) then

          begin

            curid = GEN_ID (gen_urls_id,1);

            insert into urls (id, url, hsip) values (:curid, :aurl, »);

            oid = curid;

          end

          else begin

            oid = 0;

          end

          suspend;

        end^

      Сам вызов из дельфи:

      ExpandedWrap disabled

        FSP.Close;

        FSP.StoredProcName:= ‘ADD_URL’;

        if FTR.InTransaction = false then

          FTR.StartTransaction;

        FSP.Params.Clear;

        FSP.ParamByName(‘AURL’).AsString:= ‘333’; //URL;

        FSP.ExecProc;

        ID:= FSP.ParamByName(‘OID’).AsInteger;

      где FSP — IBStoredProcedure, FTR — IBTransaction.
      На строке FSP.ExecProc; и появляется ошибка. :wall:
      Ума не приложу где еще ошибку искать!


      Modest Wizard



      Сообщ.
      #2

      ,
      05.09.06, 08:04

        FSP — IBStoredProcedure — динамически если создаешь, то например в TADOStoredProc нужно перед присваением значения параметра , его создать:

        ExpandedWrap disabled

          SP.Parameters.CreateParameter(‘AURL’,ftString,pdInput,255,»);

        , в твоем случае мб что-нибудь подобное.

        Сообщение отредактировано: Modest Wizard — 05.09.06, 08:04


        SilverShield



        Сообщ.
        #3

        ,
        05.09.06, 10:02

          Full Member

          ***

          Рейтинг (т): 11

          Modest Wizard, по крайней мере для MS SQL в TADOStoredProc не требовалось создавать параметры отдельно. В моем случае, есть целая куча других процедур, в которые параметры передаются точно также, но которые работают. Проблема в чем то другом…


          SilverShield



          Сообщ.
          #4

          ,
          07.09.06, 08:22

            Full Member

            ***

            Рейтинг (т): 11

            Кажется разобрался: GEN_ID возвращает integer, а не BIGINT и поэтому при присвоении выходному параметру (типа BIGINT) значения генератора и возникала ошибка. Этот IB не перестает меня удивлять!

            0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)

            0 пользователей:

            • Предыдущая тема
            • Базы данных: SQL
            • Следующая тема

            Рейтинг@Mail.ru

            [ Script execution time: 0,0345 ]   [ 15 queries used ]   [ Generated: 28.01.23, 21:07 GMT ]  

            String expression = CHEMICAL_REORDERPOINT + "*" + searchRequest.getReorderPercentage() + "/100)";
            

            Before :

            String expression = CHEMICAL_REORDERPOINT + "*" + searchRequest.getReorderPercentage() + "/100)";
            

            searchRequest.getReorderPercentage() comes dynamically from browser after submit value.
            Lets take value for searchRequest.getReorderPercentage() = 50

            so String expression = CHEMICAL_REORDERPOINT*50/100; 
            

            This is getting populated in a prepared statement of JDBC in my application, so to maintain the prepare statement rule i have used in below way:

            After :

            String expression = CHEMICAL_REORDERPOINT + "*?)"
            String str = searchRequest.getReorderPercentage() + "/100";
            params.add(str)
            

            here params is a list from which the parameters will be iterated and will be placed in postion parameters of prepare statement while executing it.

            But now i m getting exception like
            Invalid data conversion: Parameter instance 50.0/100 is invalid for the requested conversion. ERRORCODE=-4461, SQLSTATE=42815

            Pls can any one help me out. Thanks

            Problem

            Case Foundation Case Analyzer generates Invalid data conversion errors when it is started after adding custom Process Engine data fields to its configuration

            Symptom

            The calog.txt file, located in the Case Analyzer installation folder (for example: Program Files (x86)ibmFileNetCase Analyzer Enginejpa) has exceptions similar to the following:

              … [filenet.pa.datacollector.PEEventDispatcher — 2] SEVERE datacollector Event dispatcher thread 2 work on view VWVL1_DEFALTEVENTLOG: Database error:
              com.ibm.db2.jcc.am.SqlException: [jcc][1093][10420][3.57.82] Invalid data conversion: Parameter instance is invalid for the requested conversion to integer. ERRORCODE=-4220, SQLSTATE=null

            Cause

            The Process Engine data field was added to the Case Analyzer configuration with an incorrect type.

            Environment

            Case Foundation PE 5.1, Case Foundation CA 5.1

            Diagnosing The Problem

            Compare the field type of the custom data fields in the Case Analyzer database and the Process Engine database.

            To check the field types in the Case Analyzer database, check the records in the X_DataFields table. For example, run the SELECT * FROM X_DataFields query:

            To check the field types in the Process Engine database, run the logconfig [PE event log name] command in vwtool on the Process Engine. Use the name of the Process Engine event log where the fields were added to Case Analyzer from. For example:

            In the example above, the ApplicationID field will make Case Analyzer generate the Invalid data conversion errors, because it was added as an integer (Int) field to the Case Analyzer configuration, but it is a String field in the Process Engine database.

            Resolving The Problem

            Drop the custom data field with a type mismatch from the Case Analyzer configuration, and add it back with the correct type. You can do this in the Case Analyzer Process Task Manager.

            [{«Product»:{«code»:»SSTHRT»,»label»:»IBM Case Foundation»},»Business Unit»:{«code»:»BU053″,»label»:»Cloud & Data Platform»},»Component»:»Process Analyzer»,»Platform»:[{«code»:»PF033″,»label»:»Windows»}],»Version»:»5.0;5.1.0″,»Edition»:»All Editions»,»Line of Business»:{«code»:»LOB45″,»label»:»Automation»}}]

            Moderators: Max, TerryRogers

            User avatar

            Nomade

            Guru
            Posts: 135
            Joined: Sat Jun 27, 2009 3:41 am
            Location: Quebec, Canada

            Invalid Data Conversion

            Hi Max,
            I took a chance and installed 3.2 RC2. When I asked to open my database, got a message saying «invalid data conversion». Any module I try to go, I get the same error message. I also get a «Access violation at address 00877E83 in module «EssentialPIM.exe» read of address FFFFFFFC». Good thing I made a backup of my database in another folder. Uninstalled 3.2 RC2 and no problem reopening my database with 3.12.

            Reagards

            User avatar

            Nomade

            Guru
            Posts: 135
            Joined: Sat Jun 27, 2009 3:41 am
            Location: Quebec, Canada

            Re: Invalid Data Conversion

            Post

            by Nomade » Fri Nov 27, 2009 6:32 pm

            UPDATE:

            Hi Max,
            Tried a bunch of things to see where could be the problem and here is what I found. If I install 3.2 RC2 and open my database, it will work perfectly as long as I don’t open the «Options» window. As soon as I open the options window to make one change, then the error message will appear and then there is nothing I can do. So opening this «options» window creates the «Invalid Data Conversion» error.

            User avatar

            Nomade

            Guru
            Posts: 135
            Joined: Sat Jun 27, 2009 3:41 am
            Location: Quebec, Canada

            Re: Invalid Data Conversion

            Post

            by Nomade » Fri Nov 27, 2009 6:45 pm

            Hi Max,

            Haven’t tried a new database but better than that, I just found the problem. As soon as I uncheck the «Show private items» thats the cause. Everything else I change in the options doesn’t create any problem but as soon as I uncheck this one, thats when it happens. If I put the check back, the program returns to working fine.

            Regards

            Max

            Site Admin
            Posts: 21714
            Joined: Wed Dec 08, 2004 11:39 pm
            Has thanked: 819 times
            Been thanked: 364 times
            Contact:

            Re: Invalid Data Conversion

            Post

            by Max » Fri Nov 27, 2009 6:57 pm

            Thank you, but please try on a new database. I can not reproduce it and need to know whether that’s database specific or not.

            Maxim,
            EPIM Team

            User avatar

            Nomade

            Guru
            Posts: 135
            Joined: Sat Jun 27, 2009 3:41 am
            Location: Quebec, Canada

            Re: Invalid Data Conversion

            Post

            by Nomade » Fri Nov 27, 2009 7:09 pm

            Max wrote:Thank you, but please try on a new database. I can not reproduce it and need to know whether that’s database specific or not.

            Just created a new database and same problem occur. Uncheck this option, error message. Put back the check, programs work fine.

            Max

            Site Admin
            Posts: 21714
            Joined: Wed Dec 08, 2004 11:39 pm
            Has thanked: 819 times
            Been thanked: 364 times
            Contact:

            Re: Invalid Data Conversion

            Post

            by Max » Fri Nov 27, 2009 8:48 pm

            Hm…maybe depends on what Task or ToDo you create?
            I made a new database, create one private TODo and one private Task. Then unchecked «Show Private items» in Options and tried all modules- works without errors…

            Maxim,
            EPIM Team

            User avatar

            Nomade

            Guru
            Posts: 135
            Joined: Sat Jun 27, 2009 3:41 am
            Location: Quebec, Canada

            Re: Invalid Data Conversion

            Post

            by Nomade » Fri Nov 27, 2009 9:21 pm

            Ok, i tried again with another new database. made it simple. One Todo, one task, one note. The problem is definatly there for me. As soon as I change the «show — hide private items» in options, it goes bazerk. Tried it on my laptop and pc. Two different installations. Uninstalled 3.12 and database file to make sure of having everything installed from scratch. As soon as I uncheck that option, Invalid data Conversion comes back again. Mind you Max, I wont go crazy with that. All I have to do is leave it alone. But I only wished the program would work right. :wink:

            Even tried just installing the new version after uninstalling 3.12 and the directory containing the database. Just using the test database. As soon as I uncheck the private option, same thing. I tried installing both in English and after that, in french. I tought that maybe the french version had a bug. Also, the CTRL-L shortcut does not work. It doesn’t hide the private items.

            • Remove From My Forums
            • Question

            • Hi,

              While trying to enter the data «Dëshmorët» in Sql Server Column of datatype varchar(40). I’m receiving the following error:
              Error Description: System.Data.SqlClient.SqlException (0x80131904): Bulk load data conversion error (truncation) for row 4, column 378 (PAX_EO).
              Bulk load data conversion error (truncation) for row 7569, column 378 (PAX_EO).

              When I change the value to «Deshmoret» i.e. english ‘e’, it works perfectly fine. How to resolve it?

              Thanks.


              Kunal G

              • Moved by

                Friday, March 29, 2013 6:21 PM
                Better answer can be here

            Answers

            • You have not come back with information I asked for. I the mean I tried this. This is my data file:

              129Balansakt     999a
              42 Dëshmorët     777b
              769Raggarbrudar 12v

              This is my format file:

              10.0
              4
              1             SQLCHAR        0             3            ""         1         a            ""
              2             SQLCHAR        0            12            ""         2         b            SQL_Latin1_General_CP1_CI_AS
              3             SQLCHAR        0             3            ""         3         c            ""
              4             SQLCHAR        0             1            "rn" 4         d            SQL_Latin1_General_CP1_CI_AS

              And this is my test script:

              CREATE TABLE #test (a int                                              NOT NULL,
                                  b varchar(12) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
                                  c int                                              NOT NULL,
                                  d char(1)     COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL)

              BULK INSERT #test FROM ‘C:tempslask.txt’
              WITH (FORMATFILE = ‘C:tempslask.fmt’)
              go
              SELECT * FROM #test
              go
              DROP TABLE #test

              This works without problem.

              Sandip makes an excellent point about UTF-8. If the file is UTF-8, you will not be able to import it correctly. And it could also explain the eror you are seeing. If the file is UTF-8, «Dëshmorët» is not 9 characters, but 11. And since
              your file is fixed width, this means that everything goes out of sync with two bytes from this point. No error will be reported for PA6_LOT_2, because the string, while incorrect, is still legal. It could be that the first field that really causes an error
              is PAX_EO, or it could be that the error is reported for the last column rather than the first.

              And it is worth adding an error like this has far-reaching consequences. BCP is not smart to resync at the end of line but it will consume bytes until it has seen the terminator — whicih is the rn on the next line.


              Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

              • Marked as answer by
                Kunal G
                Friday, April 5, 2013 6:25 AM

            Модераторы: kdv, CyberMax

            Max_VM

            Сообщения: 3
            Зарегистрирован: 17 фев 2006, 11:54

            IBX: invalid data conversion

            Есть хранимая процедура:

            CREATE PROCEDURE GET_APPARAT_LAST_BINDING (
            APPARAT_CODE NUMERIC(18,0))
            RETURNS (
            BINDING_CODE NUMERIC(18,0))
            AS

            При вызове TIBStoredProc.ExecProc валимся на процедуре FetchDataIntoOutputParams. :?
            Далее выясняется, что в IBSql.pas TIBXSQLVAR.GetAsVariant заходим по такому условию:
            SQL_INT64:
            if FXSQLVAR^.sqlscale = 0 then
            IBError(ibxeInvalidDataConversion, [nil])
            Изменить хранимую процедуру нет возможности, т.е. Numeric 18,0 поменять на Integer или хотябы Numeric 18,N где N>0.
            Что делать ? :?:


            kdv

            Forum Admin
            Сообщения: 6595
            Зарегистрирован: 25 окт 2004, 18:07

            Сообщение

            kdv » 17 фев 2006, 12:44

            обновить версию IBX.



            kdv

            Forum Admin
            Сообщения: 6595
            Зарегистрирован: 25 окт 2004, 18:07

            Сообщение

            kdv » 17 фев 2006, 17:19

            А нефиг пользоваться variant.

            любит народ эту гадость. Я как увидел первый раз когда это в Delphi 2 (?) ввели, чуть не …
            А после того, как посмотрел на реализацию в RTL, понял, что я ничего не потеряю, просто забив на варианты.


            Max_VM

            Сообщения: 3
            Зарегистрирован: 17 фев 2006, 11:54

            Сообщение

            Max_VM » 20 фев 2006, 08:28

            Это как же мне не пользоваться variant’ом ? :?
            Расскажите, плз. Я вызываю ExecProc и там она валится ! Где мне не пользоваться вариантом ? До загрузки параметров дело еще не дошло !


            kdv

            Forum Admin
            Сообщения: 6595
            Зарегистрирован: 25 окт 2004, 18:07

            Сообщение

            kdv » 20 фев 2006, 09:32

            вариантом — нигде не пользоваться. Как и IBStoredProc. IBX какой версии — самой свежей?


            SAMZ

            Сообщения: 128
            Зарегистрирован: 21 мар 2005, 08:17

            Сообщение

            SAMZ » 20 фев 2006, 11:14

            kdv писал(а):вариантом — нигде не пользоваться. Как и IBStoredProc. IBX какой версии — самой свежей?

            Ну, мужики, Вы фундаменталисты и радикалы. Понятно, можно избегать варианта при работе с БД, а если работаешь с WordAplication, с какой переменной в приложении его связывать.


            Max_VM

            Сообщения: 3
            Зарегистрирован: 17 фев 2006, 11:54

            Сообщение

            Max_VM » 20 фев 2006, 12:47

            Все полечилось обновлением IBX до 7.08 ! :lol:
            Спасибо… :wink:


            0 0 голоса
            Рейтинг статьи
            Подписаться
            Уведомить о
            guest

            0 комментариев
            Старые
            Новые Популярные
            Межтекстовые Отзывы
            Посмотреть все комментарии

            А вот еще интересные материалы:

          • Яшка сломя голову остановился исправьте ошибки
          • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
          • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
          • Invalid community post ошибка
          • Invalid column name sql ошибка