Elke,
sorry,
I made some mistakes by composing the code example (very
quick but very, very, very dirty
;-).
But
the error _did_ belong to the "Pos"
problem. I updated the DB kernel to built 23 and it seems to be fixed now (no
more error reports by customers jet).
Sorry
to be confusing and thanks for your help/response.
Tilmann Starke
SOFTWORK GmbH
SOFTWORK GmbH
Help to prevent global warming by writing cool software.
-----Urspr�ngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Im Auftrag von Zabach, Elke
Gesendet: Montag, 27. Mai 2002 14:31
An: 'Tilmann Starke'; [EMAIL PROTECTED]
Betreff: RE: Ups. wrong key... S1000: [SAP AG][SQLOD32 DLL][SAPDB]General error;-7002 POS(329) KEY not allowed.Tilmann Starke wrote:> Hi there,
>
> some time ago (02/27/02) I reported an error with columns using "POS" as name.
>
> I worked around by turning the WHERE statements over, for example:
>
> "WHERE Pos<1" is now "WHERE 1>Pos". This works.
>
> Suddenly a error occurs which looksalike to this one:
>
> I open a session using RDO, build a table, insert some data and boing...
>
> Here some snippets (using VB6pro, WinXP, SuSE8, SAPDB 7.3.0.23, MDAC 2.6):
>
> Private Sub Command1_Click()
> '...
>
> ' open RDO connection
> rdoEnvironments(0).CursorDriver = rdUseOdbc
> connRDO.Connect = sConnect
> connRDO.CursorDriver = rdUseOdbc
> connRDO.EstablishConnection rdDriverNoPrompt
>
> ' create table
> connRDO.Execute _
> "CREATE TABLE Blabla" & _
> " (" & _
> " Nr LONG NOT NULL," & _
> " Pos INT NOT NULL," & _
> " UPos LONG NOT NULL," & _
> '...
> " MengeGel DECIMAL(15,5)," & _
> " MengeRes DECIMAL(15,5)," & _
> " CONSTRAINT BestPos_PKEY PRIMARY KEY (Nr,Pos,UPos)" & _
> " )"
>
> ' insert data
> connRDO.Execute _
> "INSERT INTO Blabla VALUES" & _
> " (" & _
> " '4711'," & _
> " '2'," & _
> " '0'," & _
> '...
> " '0'" & _
> " '0'" & _
> " )"
>
> '...
> End Sub
>
> The error happens at the INSERT statement.
>
> "S1000: [SAP AG][SQLOD32 DLL][SAPDB]General error;-7002 POS(329) KEY not allowed."
>
> I have a small VB project zipped and attached (only 2k) to reproduce this error.
The description was not correct.The error occurs during the create table.Tilmann tried to use two LONG-columns(NR and U_POS) as part of the primary key.Maybe he thought of some LONG like in some programming languages, being a fat integer.Thick/Fat numbers he can use in a primary key.But a LONG column is a column which can hold up to 2 GB of character data. And thatkind of datatype is NOT allowed to be used in primary keys.Change LONG to fixed (xy) of float (xy) or some of the known number-datatypesand it will work.Ok, it will work, if in your insert your last number-values will be seperated by commaas the others are.ElkeSAP Labs Berlin
