Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2012
    Posts
    7

    Unanswered: Cli0102e sqlstate=07006

    Hello guys,

    right now I'm trying to run a stored procedure from a vb.net application, but I always get the error in the title. I already checked whether there are any wrong datatypes, but everything seems to be fine.

    I don't know whether anyone can help me out all as this is more of a vb.net problem, but maybe you guys can give me details about the error message itself. Does it have to have something to do with cast/conversion?

    Code:
    Procedure:
    "CREATE OR REPLACE PROCEDURE "ADDON21C"."ENDEJOB_KERNSELECT_TEMP"
    (
            OUT @result BIGINT,
            IN @counter SMALLINT
    )
    LANGUAGE SQL
    SPECIFIC SQL120726112506300
    P1: BEGIN
    
    CASE @counter
            WHEN 1 THEN 
            DELETE FROM "EndeJob_Helper_VZEnde_temp";
            WHEN 2 THEN 
            DELETE FROM "EndeJob_Helper_VZEnde_temp";
            ELSE
            DELETE FROM "EndeJob_Helper_VZEnde_temp";
    END CASE;
         
         SET @result = 0;
    END P1"
    Yes, I always run the same statement, but that will change soon. It's just for testing.

    Code:
    Part of the application code:
        Sub Main(ByVal args As String())
            'Parameter(einlesen)
            Dim Mandant As Int16 = 1
            Dim DbType As Integration.Mandanten.DatabaseType = Integration.Mandanten.DatabaseType.AddonDB
            Dim Command As String = "ENDEJOB_KERNSELECT_TEMP"
    
            Dim result As Long? = Nothing
            Try
                For index As Int16 = 1 To 3
                    Dim paras As New HashSet(Of System.Data.Common.DbParameter)
                    paras.Add(New DB2Parameter("@counter", DB2Type.SmallInt))
                    paras(0).Direction = ParameterDirection.Input
                    paras(0).Value = index
                    result = Database.DbWrapper****nInsertStoredProcedure(Command, paras, Mandant, DbType, 0)
                    MsgBox("Statement No " & index & " ist durch")
                Next
    
    
            Catch ex As Exception
                MsgBox(ex.Message)
                result = 1
            End Try
    As you can see the In parameter is set as an int16 in the application which is smallint in the database. I also set its DB2Type to smallint ... just to be sure.
    The Out parameter (result) is set as long in the application and bigint in the procedure. This should be fine, too. So I really have no clue what's going on.

    I ran the sp already via the dbms (dbv) and it works fine. So the problem must be somewhere in my application.

    I tried a bunch of things already like changing the datatype of the out parameter (counter) to string/varchar, but the same error message comes up.

    Would really appretiate any kind of help and please no links to the db2 documentation. I already googled for about an hour and checked most of those probably already.

    thanks

  2. #2
    Join Date
    Oct 2009
    Location
    221B Baker St.
    Posts
    486
    but maybe you guys can give me details about the error message itself.
    I may have mis-read, but i see no error message?

    There appear to be unpaired "(quotes) on the CREATE?

    fwiw - an hour is not very long for trying to find something. . .

  3. #3
    Join Date
    Jul 2012
    Posts
    7
    Quote Originally Posted by papadi View Post
    I may have mis-read, but i see no error message?

    There appear to be unpaired "(quotes) on the CREATE?

    fwiw - an hour is not very long for trying to find something. . .
    There is an error code. I didn't post the error message, because it's in german and its only two words´:

    "[IBM][CLI Driver] CLI0102E Invalid conversion. SQLSTATE=07006"

    The first quote is obviously a typo. I mentioned already that I can call the procedure without any problems in my dbms.

    By the time you made this very helpful post I searched for about 4 hours for an answer. I do know how to use google and I do realize when it doesn't help me anymore. This seems to be a very unique problem. That's why I posted this in the forum.

    I do get that I am the one asking for help, but that doesn't mean that you can behave however rude you want...

  4. #4
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    When asking for help, please give relevant facts about your environment.

    Post your *db2 client* Version and fixpack . (You also should always post your DB2 server version and fixpack and operating system).

    Post also relevant entries from your db2cli.ini or db2dsdriver.cfg.

    you are mapping the BIGINT output-parameter from the procedure, to a LONG in vb.

    If you take a CLI trace, can you see which action throws the conversion error?

  5. #5
    Join Date
    Apr 2007
    Location
    Chicago
    Posts
    68
    I see 2 parameters defined in the stored proc, but only one in the .NET code. Where's the .NET parameter that corresponds with the stored proc OUT parameter?

  6. #6
    Join Date
    Oct 2009
    Location
    221B Baker St.
    Posts
    486
    but that doesn't mean that you can behave however rude you want...
    If you believe that was meant to be rude, you need a bit of a perception adjustment. The only reason for the reply was to maybe help in your finding a solution.
    I already googled for about an hour and checked most of those probably already.
    Believing what you posted, i merely mentioned that an hour is not so long for "research".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •