Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
5 replies
Subscribers
4 subscribers
Views
1636 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Reports
141806 - no subject - I have an existing legacy table, which d
guozhangy
over 9 years ago
I have an existing legacy table, which doesn't have a primary key. Because this table is shared by other applications and I can't add primary key column, which means I can't create CDT for this table.
I want to display the rows from this table in a Grid Report, is there a way to use "Query Database" smart service to retrieve the data from the table and display it in Grid? If yes, can anyone show me the example?
Thank you so much.
OriginalPostID-141806
Discussion posts and replies are publicly visible
0
Conor Cahill
Certified Lead Developer
over 9 years ago
Are there any columns in the table that are unique for every row?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tim
Certified Lead Developer
over 9 years ago
You can create a database view for this table and create your own primary identifier in the view sql which can then be mapped in the CDT. You could concatenate a selection of fields to create your unique column or use the internal rowid from the database.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 9 years ago
If it's an Oracle database, you may wish to consider using the ROWID Pseudocolumn in the view that Tim suggests:
docs.oracle.com/.../pseudocolumns008.htm
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
guozhangy
over 9 years ago
Thanks all. Yes, creating a view with ROWID or ROWNUM as the primary key can solve my problem because I just use it for display.
But you can't use this approach to write to database using CDT, just FYI.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tim
Certified Lead Developer
over 9 years ago
You should be able to use a BEFORE INSERT trigger to achieve this at a database level.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel