Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Image/General Field Issue
Message
From
15/01/2003 08:39:42
 
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00741648
Message ID:
00741848
Views:
51
Hi Vlad - thanks for responding.

Yes - definitely an image type - note that I CAN succesfully store some binary files there.
I'm still trying to find out why that is, but it may be realted to file size.
Note also that if I insert something small there first, then update with the big file,
it goes in fine.

I haven't tried the tableupdate on insert, but I'm guessing it would work. I'm not doing
that because of a whole other reason to do with identity fields and session scopes - not
relevant here, but that's why I'm doing SPT.

Now - here's a clue. Keep in mind I'm using a simple SPT insert statement from VFP like
Insert into Mytable (ORIGINALFILEPATH, FILENAME, DESCRIPTION, FILEBIN) 
values ("val1", "val2", "val3", ?MyLocalTable.MyGeneralField)
Watching in SQL Profiler, here is what I see. When I insert the small file, Profiler shows
that the entire insert statement is coming in as expected - with hex data for the image field.
However, when I attempt to insert the larger file, here is what comes into SQL Server
begin tran declare @h int exec @h=sp_createorphan 'GFile.FILEBIN' WRITETEXT BULK GFile.FILEBIN @h WITH LOG
Insert into GFile (ORIGINALFILEPATH, FILENAME, DESCRIPTION, FILEBIN) values ('val1', 'val2', 'val3', {fn getimage(1)} )  exec sp_droporphans commit tran
Now - either SQL Server or VFP is doing this, because I'm certainly not.

Any ideas?

TIA,
Ken

>Hi!
>
>Are you sure that field is image field type? I just searched MSDN and read the INSERT command manual. Text pointers are mentioned there. Try to look there.
>
>Also, did you try to insert record using append blank/populate fields/tableupdate()? Would it work for you?
>
>>I am succesfully using an offshoot of Vlad Grynchyshyn's FAQ#7995 technique for moving binary data back and forth from SQL 2K to Desktop via SPT. It works great for word, excel, and all other files I've tried until now.
>>
>>The problem is, that when trying to upload an .exe (a VFP exe actually), I get a SQL error saying that:
>>
>>"Only text pointer are allowed in work tables, never text, ntext, or image columns. The query processor produced a query plan that required a text, ntext, or image column in a work table."
>>
>>I should note that this happens ONLY on INSERT where I'm using SPT with a
(myimage field) values (?mygenfield)
clause. An UPDATE statement from the cursor using tableupdate() works fine.
>>
>>Any ideas anyone?
>>TIA,
Ken B. Matson
GCom2 Solutions
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform