Re: TEXT AND CHAR Variables
Posted in 2000
On Friday 27th October 2000, Mark Peterson asked: >>Can someone give statement to update a table with a text field using a >>char define program variable? On Monday 30th October 2000, Jonathan Leffler responded: >Assuming you mean TEXT as in a blob, then there is no way to do it. >You could write a UDR to handle it in IUS, but ignoring that, it cannot >be done. On Monday 6th November 2000, Art Kagel countered: >Jonathan you are incorrect. > >You can do this in an ESQL/C program using the LOC_USER method which >gives you complete control of what data is inserted into the BLOB and >where it comes from or using LOC_MEMORY by placing the address of the >char variable into loc_buffer. Art, I think we're giving contradictory answers because we're making different assumptions. I agree with you that if you use ESQL/C and a level of indirection, you could initialize a loc_t variable to reference a char variable, and then pass the loc_t variable into the statement, and that would achieve the required result. However, I was assuming something like I4GL, for which I think my answer remains valid in general. You probably can use your solution with a global char variable, even in I4GL, but not with a local variable (because you can't get the address of a char variable into the ESQL/C code). Additionally, I was assuming that the statement Mark was asking about was going to reference the char variable directly (:variable in ESQL/C). I think that remains correct too. -- Yours, Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN "I don't suffer from insanity; I enjoy every minute of it!"