Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Store/Retrieve BLOB data from Oracle
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Oracle
Miscellaneous
Thread ID:
00995704
Message ID:
00995896
Views:
18
I am not using s stored proc. To test this, here is what I am doing, and it works for me:
CLEAR
LOCAL lcFile, lnHandle, lcCursor

lcFile = GETFILE('jpg') && just get a JPG file
IF EMPTY(lcFile) OR NOT FILE(lcFile) OR NOT JUSTEXT(lcFile) = 'JPG'
   RETURN
ENDIF
lnHandle = SQLSTRINGCONNECT('Driver=Oracle in OraHome92;UID=my_uid;PWD=my_pwd;DBQ=local;')
IF lnHandle < 0
   RETURN
ENDIF

lcCursor = 'crsTest'

? SQLEXEC(lnHandle, [select * from test], lcCursor)
*
* My Test table in Oracle has the structure KeyID Number(6), Photo BLOB
*
* Make the cursor updatable with appropriate code here
*
CURSORSETPROP('Tables', 'Test')
CURSORSETPROP('UpdateNameList', 'KeyID Test.KeyID, Photo Test.Photo', lcCursor)
CURSORSETPROP('KeyFieldList', 'KeyID', lcCursor)
CURSORSETPROP('UpdatableFieldList', 'KeyID, Photo', lcCursor)
CURSORSETPROP('SendUpdates', .T., lcCursor)
CURSORSETPROP('UpdateType', 1, lcCursor)
CURSORSETPROP('WhereType', 1, lcCursor)

APPEND BLANK
REPLACE keyid WITH 1
APPEND GENERAL Photo FROM (lcFile)
BROWSE            && confirm the graphic is there
? TABLEUPDATE(1)   && returns .T. for me
CLOSE ALL
? SQLEXEC(lnHandle, [select * from test], [crsTest])
BROWSE LAST NOCAPTIONS
*!* the graphic is still there
SQLDISCONNECT(lnHandle)
>Hi Mark,
>
>I'm back. Any ideas on figuring out what's wrong? Should we use stored procedures instead in updating the BLOB?
>
>Thanks,
>Arriyel
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform