NetTalk Central

Author Topic: MSSQL Text field processing  (Read 5064 times)

wasatchconsulting

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
    • Email
MSSQL Text field processing
« on: November 08, 2015, 11:27:41 PM »
I have am reading a MSSQL table with a "Text" field. This is translated as a "Blob" in Clarion. NetTalk crashes trying to read this file directly, so I have used the String Theory "FromBlob" to read the field successfully, but for the life of me, I cannot figure out how to get this to display. I have created a local variable to hold the data and it does get the data "in certain embeds", but does not show. I have placed the code to get the data in the "PreUpdate" start embed which does place the data in the local variable, but again, nothing on the screen shows. Tried using "do Refresh::Local", but this causing unexpected results at this point.

Thanks
Ken Watts

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: MSSQL Text field processing
« Reply #1 on: November 09, 2015, 01:56:55 AM »
Hi Ken,

>> NetTalk crashes trying to read this file directly,

Did you mean...
NetTalk crashes trying to read this [field] directly ?

Blobs are special because the table _has_ to be open when they are accessed, so their support is somewhat limited in some places.

You don't mention if you are build a WebServiceMethod here? or a Form?
Perhaps some context will be useful?

Cheers
Bruce

wasatchconsulting

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
    • Email
Re: MSSQL Text field processing
« Reply #2 on: November 09, 2015, 08:36:58 AM »
Sorry, should have mentioned that I was trying to work with the blob on a web form. I was trying to read it with blobfield[0 : size(blobfield)] which causes a crash, so I used the FromBlob in string theory to read the blob.

Thanks
Ken

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: MSSQL Text field processing
« Reply #3 on: November 10, 2015, 03:24:00 AM »
use BLOBTOFILE i have several project that use this function without problems..

wasatchconsulting

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
    • Email
Re: MSSQL Text field processing
« Reply #4 on: November 10, 2015, 09:15:38 AM »
From what I see, this is used to send the contents of a blob to a file. Once you send the data to a file, are you displaying the file? I am trying to display the text in the blob and not send the data to a file so I am not sure how BLOBTOFILE applies, can you give me an example?

Thanks
Ken

wasatchconsulting

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
    • Email
Re: MSSQL Text field processing
« Reply #5 on: November 10, 2015, 11:25:18 AM »
Found the issue.

I placed the code to get the text from the blob field in the "PreUpdate" embed and it was grabbing the data, but when I set the session variable "p_web.SetSessionValue('LOC:Text',LOC:Text)", it was blank. I just needed to clip the data field. The data field I am saving the text to is a STRING(65535) and so this needed to be clipped.

p_web.SetSessionValue('LOC:Text',CLIP(LOC:Text))

Ken