TMysSql : Cannot create a table

TMysSql : Cannot create a table

Postby mosh1 » Wed Aug 08, 2012 2:30 pm

use phcust
aStru := phcust->(dbStruct())
IF oServer:CreateTable( "cust", aStru)

Error BASE/1066 Argument error: conditional Arguments: ( [ 1] = Type: N Val: 0)
Error at ...: (b)TMYSQLSERVER:CREATETABLE(1730) in Module: tmysql.prg
Called from : TMYSQLSERVER:CREATETABLE(1735) in Module: tmysql.prg
Called from : MAIN(87) in Module: test.prg
mosh1
 
Posts: 129
Joined: Sun Oct 09, 2011 3:50 pm

Re: TMysSql : Cannot create a table

Postby mosh1 » Thu Aug 09, 2012 6: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

mosh1
 
Posts: 129
Joined: Sun Oct 09, 2011 3:50 pm

Re: TMysSql : Cannot create a table

Postby Marc Vanzegbroeck » Thu Aug 09, 2012 6:32 pm

What is your database'structure of the table phcust?

I didn't have any problem creating database till now.

Marc
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: TMysSql : Cannot create a table

Postby mosh1 » Thu Aug 09, 2012 6:41 pm

Marc Vanzegbroeck wrote:What is your database'structure of the table phcust?

I didn't have any problem creating database till now.

Marc



Code: Select all  Expand view

Dbase III file: PHCUST.DBF.
Last Updated : 08/06/12.
Record size :        612.
Recors  :           2315.
# of Fields :         63.

Name           Type    Len    Dec
===========    ====    ===    ===
LAST_NAME        C      20      0
FIRST_NAME       C      20      0
ACCOUNT          C       7      0
TAGCODE          C       1      0
CUST_NO          C       7      0
BALANCE          N       9      2
DISCOUNT         N       4      1
BLDG_NO          C       5      0
ADDRESS          C      30      0
DIRECTION        C      20      0
UNIT             C       4      0
CITY             C      10      0
STATE            C       2      0
ZIP              C       5      0
PHONE            C      13      0
LAST_ORDER       D       8      0
LSTORD_AMT       N       8      2
BPHONE           C      13      0
PHONE3           C      13      0
TIME             C       8      0
PD               C       1      0
LAST_PAY         D       8      0
LSTPAY_AMT       N       8      2
PAY_TIME         C       8      0
CRLIMIT          N       9      2
COMMENT          C      60      0
MESSAGE          C      60      0
CATEGORY         C       3      0
CATAGORY         C       3      0
CASH             L       1      0
CLOSED           L       1      0
TAX_EMPT         L       1      0
DAYLIMIT         N       3      0
WCOUNTER         N       1      0
TRNS             L       1      0
LOK_AT_MEM       L       1      0
PAYMETH          C       6      0
CRCARD           C      16      0
CRCNAME          C      20      0
EXP_DATP         C       4      0
TRACK2           C      40      0
EXP_DAT          N       4      0
CALLED           L       1      0
WHOLESAL         L       1      0
PLEVEL           N       1      0
NOTE             C      16      0
EBT              C      23      0
REWARD           C      23      0
POINTS           N       3      0
FREQ_SHOP        L       1      0
POS_CHECK        L       1      0
ROUTE            C       2      0
SEQ              N       4      0
DAY              N       1      0
BANK_NAME        C      12      0
BANK_ACC_N       C      12      0
C_NO             N       5      0
PHONE2           C      13      0
C_WHOLESAL       C       1      0
STADY            L       1      0
EZLM             N       8      2
SF_DATE          D       8      0
ST_DATE          D       8      0



 
mosh1
 
Posts: 129
Joined: Sun Oct 09, 2011 3:50 pm

Re: TMysSql : Cannot create a table

Postby Marc Vanzegbroeck » Fri Aug 10, 2012 5:38 am

For me there was no problem creating that database.

Marc
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 111 guests