Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TPS txt field to SQL Blob,Binary

Status
Not open for further replies.

RobertNM

Programmer
Nov 19, 2015
1
US
I am trying to enter data into a SQL file from a TPS File.
I am getting an error where I am copying the data from the TPS field to a SQL BLOB, Binary.

The file structure of the SQL file was created with the import function in the dictionary editor.
All of the other data is copied just fine, but I can not figure out how to copy the data from
a text field into the BLOB.
The error occurs on this statement.

MGasSQL:FIRST=CUS:FIRST <------ Error occurs Here Expecting Variable?

Thank you in advance for any help that you can give.
Robert

File Structures
-------------------------------------------------------------
CUSTOMER FILE,DRIVER('TOPSPEED'),NAME('Customer'),PRE(CUS)
KeyAddress KEY(+CUS:STREETADD),DUP,OPT,NOCASE
KeyWID KEY(+CUS:WID),OPT,NOCASE
KeyGID KEY(+CUS:GID),OPT,NOCASE
KeyID KEY(+CUS:ID),NOCASE,PRIMARY
KeyLast KEY(+CUS:LAST),DUP,NOCASE
RECORD RECORD
ID DECIMAL(7,0)
WID DECIMAL(7,0)
GID DECIMAL(7,0)
FIRST STRING(15)
INIT STRING(1)
LAST STRING(30)
ADDRESS STRING(25)
STREETADD STRING(30)
CITY STRING(15)
STATE STRING(2)
ZIP STRING(10)


END
END

MGasSQL FILE,DRIVER('ODBC'),OWNER('SQLite3 Datasource'),NAME('MGasSQL')
FIRST BLOB,BINARY
LAST BLOB,BINARY
ADDRESS BLOB,BINARY
NOTE BLOB,BINARY
record RECORD
ID LONG
GASID LONG
METER LONG
PREAD LONG
CREAD LONG
PREUSED LONG
USED LONG
END
END

Code
----------------------------------------------------------------------------------

LOOP 10 times
NEXT(Customer)
IF ErrorCode() = 33 THEN BREAK END
If UPPER(CUS:BORR)<>'I'
Clear(MGasSQL:Record)
MGasSQL.ID=CUS:ID
MGasSql.GasID=CUS:GID
MGasSql.Meter=CUS:GasMeter
MGasSQL:FIRST=CUS:FIRST <------ Error occurs Here Expecting Variable?
!MGasSql.Last=CUS:LAST
!MGasSql.ADDRESS=CUS:Notes
GAS:ID=CUS:ID
Set(GAS:KeyID,GAS:KeyID)
Previous(GASHIS)
Message('GGAS:CREAD ' & GAS:CREAD)
MGasSQL.PRead=GAS:CREAD
MGasSQL.PREUSED=GAS:USED
APPEND(MGasSQL)
IF CheckError() THEN RETURN END
count += 1
DISPLAY(?Count)
End
END
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top