StrataFrame Forum

Incorrect # of parameters passed

http://forum.strataframe.net/Topic13348.aspx

By Keith Chisarik - 1/10/2008

Any clue what would cause this?



PRMILLNBR is getting passed twice as you can see, so there are 10 values when 9 are needed.



This results in error:

SQL0313N: The number of host variables in the EXECUTE or OPEN statement is not equal to the number of values required.



************************** DEBUG INFO ***********************

Command #:    1

Timestamp:    2008-01-10 18:12:12.559

General Command Settings

Command Type:    Text

Object Type:    DDTek.DB2.DB2Command

Connection String:    Database=S1094B1B;User ID=QSECOFR;Server=192.168.42.100:446

Transaction:    False

Command Settings

CommandText:    INSERT INTO "SIGMA"."INSTYPRPF" ("PRMILLNBR", "PRSTYLNBR", "PRUNITMEAS", "PRSIZECODE", "PRCUTCOST", "PRROLLCOST", "PRCUTRETL", "PRROLLRETL", "PRROWVERSION") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)

Command Parameters

P0:    '1' [DbType: Decimal | Size: 0 | Direction: Input | SourceColumn: PRMILLNBR | SourceVersion: Current]

P1:    '2' [DbType: Decimal | Size: 0 | Direction: Input | SourceColumn: PRSTYLNBR | SourceVersion: Current]

P2:    '' [DbType: StringFixedLength | Size: 3 | Direction: Input | SourceColumn: PRUNITMEAS | SourceVersion: Current]

P3:    '' [DbType: StringFixedLength | Size: 3 | Direction: Input | SourceColumn: PRSIZECODE | SourceVersion: Current]

P4:    '1' [DbType: Decimal | Size: 0 | Direction: Input | SourceColumn: PRCUTCOST | SourceVersion: Current]

P5:    '0' [DbType: Decimal | Size: 0 | Direction: Input | SourceColumn: PRROLLCOST | SourceVersion: Current]

P6:    '2' [DbType: Decimal | Size: 0 | Direction: Input | SourceColumn: PRCUTRETL | SourceVersion: Current]

P7:    '0' [DbType: Decimal | Size: 0 | Direction: Input | SourceColumn: PRROLLRETL | SourceVersion: Current]

P8:    '0' [DbType: Int32 | Size: 0 | Direction: Input | SourceColumn: PRROWVERSION | SourceVersion: Current]

P9:    '1' [DbType: Decimal | Size: 0 | Direction: Input | SourceColumn: PRMILLNBR | SourceVersion: Current]
By Keith Chisarik - 1/10/2008

More info:



It does not do it when I change the primary key to a new field that auto increments.



The key on the table (set via BO Mapper) when it has the above errors was a concatenated key:



PRIMARY KEY( PRMILLNBR, PRSTYLNBR)
By StrataFrame Team - 1/11/2008

I'm looking through the code, and it doesn't look like those primary key fields should be included in the Fields collection of the QueryInfo object, so I'm not sure why that one is showing up twice.  Could you email me the .designer.vb file for that business object?  I'll take a look at it and see if there is something strange there causing the problem.  Thanks.
By Keith Chisarik - 1/11/2008

File sent as requested, thank you.
By StrataFrame Team - 1/11/2008

Is the PR_PK field an auto-assigned value within DB2?
By StrataFrame Team - 1/11/2008

For some reason, that field was completely left out of the INSERT...

Let me see if I can't dump this designer file into a project and test it.

By StrataFrame Team - 1/11/2008

No clue, Keith, because I can't get it to fail... it might be that my source has changed since you got the version when you purchased the provider... I'll email you the latest version and we'll see if that makes a difference.