Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Yuri Melo
5
Views
6
Comments
Site Property
Question
Hi,
I'm trying to pass a text variable into a site property. This variable can store a large amount of text. Because of this the resulting error message is "String or binary data would be truncated. The statement has been terminated." Do you know what is the maximum length allowed for a site property of type text?
Thank you for your help
Yuri
Justin James
MVP
Why are you putting so much data into a site property? Especially from user input? That is a BIG red flag!
The max length is probably 2000 or 5000, if I had a guess.
J.Ja
1 reply
19 Mar 2012
Show thread
Hide thread
Miguel João
Staff
Justin James wrote
:
Why are you putting so much data into a site property? Especially from user input? That is a BIG red flag!
The max length is probably 2000 or 5000, if I had a guess.
J.Ja
Hello Justin
You guess right.
Site Property values are stored in the database, and then can have up to 2000 unicode characters.
@Yuri, so if your Site Property value a text larger then 2000 characters this error would occur. Usually, for that kind of volume, binary type values are used, however, you cannot stored in a Site Property.
I would suggest an entity with a binary data attribute.
Cheers
Miguel Simões João
Yuri Melo
Hi Miguel,
Thank you for your quick reply.
The issue is that I need to pass an SQL query to generate a pdf. If I put it on a entity (which I understand it will work) that means that I need to read and write from the database every time I want to generate a pdf and I would think it would slow down the page.
Passing it as a variable in the URL causes the same problem.
Is there any other way of doing this?
Thanks again for your help.
Yuri
1 reply
19 Mar 2012
Show thread
Hide thread
Miguel João
Staff
Yuri Melo wrote
:
Hi Miguel,
Thank you for your quick reply.
The issue is that I need to pass an SQL query to generate a pdf. If I put it on a entity (which I understand it will work) that means that I need to read and write from the database every time I want to generate a pdf and I would think it would slow down the page.
Passing it as a variable in the URL causes the same problem.
Is there any other way of doing this?
Thanks again for your help.
Yuri
Hello Yuri
I'm not seeing the full picture here, so maybe my question may sound stupid, but why are you saving the SQL query on the Site Property (or Database) when you can put in a SImple Query (if it's over app datamodel) or advanced query?
Cheers
Miguel Simões João
Justin James
MVP
Yuri -
Site properties get stored in the database too, so you aren't saving any DB access. So do Session variables, so that won't be saving DB access either.
If you are dead set against having it in the DB (and really, pulling a few KB of data from the DB per request is NOT a big deal, especially compared to the time it will take to generate a PDF!), you could try to use a local page variable and set the value in that variable as a literal.
J.Ja
Yuri Melo
Hi Justin,
If that is the case then it seems the best option! I guess that the entity will have to eventually get purged once I finished using it to avoid filling the table with temp garbage.
@ Miguel, I use the html to pdf solution from outsystems which required a url to be passed to this mechanism. Since the query is dynamic where the SQL "where" clause is set based on options previosuly selected by the user, I need to pass the clause line together with the URL that will generate the pdf. Since there are multiple options the user can select, then the size of the line is unpredictable and can indeed exceed the max length.
Does that make sense?
Yuri
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...