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
Alberto Ferreira
3
Views
3
Comments
Pictures in Database
Discussion
How-to
I have alreay get how to have a Picture in an Entity (Picture.Entity). Good :)
But I could only to have 1 Picture for each record in the main Entity.
How I can have several pictures for each record of one Entity.
TIA
Gerry
Create another (a child) entity that contains a binary field for the picture and the id of the other entity.
Alberto Ferreira
Ok. Thanks. But if I pretend have several pictures for each record (8 or more) That becames complex.
Izak Joubert
Gerry suggested the best workable approach.
Assume you have an entity called Product for which you want to store multiple pictures. Create a second ProductPicture entity with Id, ProductId and Image fields. When you want to retrieve all the pictures for a particular product, use an advanced query to write the sql. In the advanced query retrieve all the records for the specific ProductId and the use sql PIVOT to transpose the rowset into a series of columns.
You should be able find the exact syntax and example code if you google for "t-sql pivot".
Hope this helps.
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...