Posts: 129
Joined: Sun Oct 09, 2011 03:50 PM
Re: TMysSql : Cannot create a table
Posted: Thu Aug 09, 2012 06:19 PM
This fixed it :
// returns NOT NULL if extended structure has DBS_NOTNULL field to true
local cNN := {|aArr| iif(Len(aArr) > DBS_DEC, iif(aArr[DBS_NOTNULL] # 0, " NOT NULL ", ""), "")}
Somehow it was assumed to be logical!
PS
TyMSQL seems to me unfinished and untested. Another sample :
Return __objsendmsg(Self,::aFieldStruct[nNum][MYSQL_FS_NAME])
produces an error "no such method".
METHOD New(aRow, aFStruct, cTableName) CLASS TMySQLRow
local nI
default cTableName to ""
default aFStruct to {}
::aRow := aRow
::aFieldStruct := aFStruct
::cTable := cTableName
::aDirty := Array(Len(::aRow))
::aOldValue := Array(Len(::aRow))
AFill(::aDirty, .F.)
// inserting these lines fixed the bug!
for nI := 1 to Len(::aRow)
__ObjAddData(Self,::aFieldStruct[nI][MYSQL_FS_NAME])
next
return Self