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.
>
> 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
that
kind 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-datatypes
and it will
work.
Ok, it will
work, if in your insert your last number-values will be seperated by
comma
as the
others are.
Elke
SAP Labs
Berlin
