Insert Image in Stored Procedures: Not Supported

Insert Image in Stored Procedures: Not Supported

Post by Neil Pik » Fri, 20 Mar 1998 04:00:00



Justin,

 You could store the images outside sql and just hold UNC pointers to
them.

 Neil Pike MVP/MCSE
 Protech Computing Ltd

 
 
 

1. Image and Text inserts in Stored Procedures

Peter,
    If you are not doing any manipulation with the text / image data in the
SP, just a plain INSERT / UPDATE statement will suffice. You are not
required to use WRITETEXT or UPDATETEXT. These statements are used when you
want to say add the image data to an existing value or replace a portion of
a text value or copy values from one table into another etc.
    However, passing the text / image value to the SP depends on what
development tool you are using.

1. ODBC uses SQLGetData & SQLPutData
2. ADO uses GetChunk & AppendChunk
3. In VFP you can just pass it by reference from a local table or cursor
4. From T-SQL, you can only pass the text / image data as a constant value
since you cannot declare variables of these datatype & initialize them.

    Here is one simple T-SQL example:


varbinary(2))
as

create table #blob(id  int identity, t text, i image)

select id, convert(varchar(50), t) as t, convert(varbinary, i) from #blob

select id, convert(varchar(50), t) as t, convert(varbinary, i) from #blob


from #blob


select id, convert(varchar(50), t) as t, convert(varbinary, i) from #blob


select id, convert(varchar(50), t) as t, convert(varbinary, i) from #blob
go

exec #t 'SOME TEXT HERE...', 0x02498765bcde3,
            'MODIFIED TEXT...', 0xab86ec64,
            '(INSERT BEFORE TEXT) ', 0xcd -- replace 3rd byte

--
Umachandar Jayachandran (UC)
SQL Server MVP, MCDBA, MCSE + I
SQL Resources at http://umachandar.homepage.com/resources.com

2. Do you know a query that does what I want ?

3. XML stored procedures are not supported in fibers mode

4. SQL Server Permission Problems

5. Rowset does not support fetching backward error with stored procedure call

6. linked SQL Table

7. Rowset does not support fetching backward with stored procedure

8. bulk import error

9. Access Client does not work with INSERT and SELECT in same stored procedure

10. Data From INSERT In Stored Procedure Does Not Appear In Table

11. insert does not work when triggerd Stored Procedure fails

12. To Stored Procedure or not to stored procedure

13. To stored procedure or not to stored procedure