Skip to content

Does SQLpage support caching of CTE data for forms ? #219

Answered by lovasoa
chris-bragg-sift asked this question in Q&A
Discussion options

You must be logged in to vote

Hey !
If I got it right, what you want is create a form that can be used to edit a record in a database table. You want each column in the table to be represented by a field in the form, and each field to be pre-filled with the current value of the column.

The simplest way to do that is to just make one query per form field, which is fine most of the time:

select 'form' as component;
select 'username' as name, username as value from users where user_id = $user_id;
select 'email'    as name, email    as value from users where user_id = $user_id;

But it looks like you would like to avoid making one query per form field.
This is definitely possible, and does not need any special SQLPage feat…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by chris-bragg-sift
Comment options

You must be logged in to vote
2 replies
@lovasoa
Comment options

@chris-bragg-sift
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested sql Topic related to SQL, not specific to SQLPage
2 participants