OPO Importing flat files???
Date: 1996/04/16
Message-ID: <blankman-1604961958270001_at_bldg158_0001.unm.edu>#1/1
does anyone know how to import a flat file with Oracle Power Objects. I got a technical bulletin, that gives the code, but it doen't tell what kind of an object to attach the code to. I tried putting it into a button and assigning it to a click, but I got an error message saying it was not an appropriate object.
Below is the code. Thanks in advance for any suggestions
Inherited.Click()
DIM sourceFileName, lineData, data1, data2, data3 as String
'open file with read-only access (buffer length of 1024 bytes)
sourceFileName = "Groucho:OPO Data :Softwre.csv " 'file path ON ERROR GOTO openCloseError 'checks to make sure file exists WHILE (TRUE) LINE INPUT #1, lineData data1 = udmParseDelimited(lineData,1) data2 = udmParseDelimited(lineData,2) data3 = udmParseDelimited(lineData,3) data4 = udmParseDelimited(lineData,4) data5 = udmParseDelimited(lineData,5) data6 = udmParseDelimited(lineData,6) data7 = udmParseDelimited(lineData,7)
data8 = udmParseDelimited(lineData,8)
data9 = udmParseDelimited(lineData,9)
EXEC SQL WHENEVER SQLERROR GOTO aSQLError EXEC SQL INSERT INTO software VALUES & ( : data1, : data2, : data3, : data4, : data5, : data6, : data7, : data8, : data9, TO_CHAR) ' numbers can be CHAR dates should be coverted manually or with SQL command TO_DATE;
WEND openCloseError:
msgbox("Error opening/closing file - ERR = " & str(ERR)) GOTO CloseFile:
readError: 'File read error occurs; 1074 means no more data msgbox("Error oreading file - ERR = " & str(ERR)) GOTO CloseFile:
aSQLError:
msgbox("SQL Error occurred: Code = " & str(SqlErrCode()) & & ", Text = " & SqlErrText())
GOTO CloseFile
closeFile:
EXEC SQL COMMIT
ON ERROR GOTO openCloseError
CLOSE # 1
finished:
exit sub Received on Tue Apr 16 1996 - 00:00:00 CEST