when try to use "existing" PostgreSQL Table i have Problem with METHOD SavePQQ()
it seems to work when use FWPG_ImportFromDBF() to create a "new" SQL Table
---
in METHOD SavePQQ() it is "WHERE"
- Code: Select all Expand view RUN
- FOR n := 1 TO LEN( aKey )
IF n == 1
cSql += " WHERE "
ELSE
cSql += " AND "
ENDIF
cSql += aKey[ n, 2 ] + " = " + FW_ValToSQL( aKey[ n, 3 ] )
NEXT
it get those aKey from ::aStructPG
but ::aStructPG does NOT contain "my" PRIMARY KEY
var2char(::aStructPG[1]) = "{artnr, C, 5, 0, 16820, 1, artikel, __lock_owner, NIL, NIL}"
p.s. __lock_owner is "last" FIELD ... i guess while not found "id"
so it did not work when PRIMARY KEY was create this Way
- Code: Select all Expand view RUN
- // all FIELD before
// add "internal" Xbase++ v2.x ISAM Emulation Fields
cQuery += " __deleted boolean NOT NULL DEFAULT false, "
cQuery += " __record serial NOT NULL, "
cQuery += " __rowversion integer NOT NULL DEFAULT 0, "
cQuery += " __keyversion integer NOT NULL DEFAULT 0, "
cQuery += " __lock_owner integer NOT NULL DEFAULT 0, "
// Alaska have this
// CONSTRAINT artikel_pkey PRIMARY KEY (__record)
//
cQuery += " CONSTRAINT " + cTable + "_pkey PRIMARY KEY (__record)"
cQuery += " )"
oTable := oServer:Query( cQuery )
and was "filled"
- Code: Select all Expand view RUN
- cIns += "false," // "__deleted"
cIns += "nextval('" + cTable + "___record_seq')" + "," // use nextval() for Sequence !
cIns += "0," // "__rowversion"
cIns += "0," // "__keyversion"
cIns += "0 " // "__lock_owner"
cIns += ")"
---
so my Question is : how to use own PRIMARY KEY