Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Image/General Field Issue
Message
From
15/01/2003 08:54:00
 
 
To
15/01/2003 08:39:42
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00741648
Message ID:
00741855
Views:
22
Hi!

The T-SQL code for SQL Server command is certainly generated by deep internals in VFP. That is why I attempt to find/propose anotehr solution :-)

You can get cursor by SPT and make it updatable like remote view. See FAQ#8153. The only issue here is that SPT cannot map image field into memo. However, despite you will have General field type there, you can always copy MyLocalTable.MyGeneralField into that field and then make update.

HTH.

>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,
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform