Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Inserting data from fields to MS SQL

Avatar

Former Community Member
I have read various topics on the forum concerning inserting data into a database, but they all seem to require that the table in the database contains the same fields as the form.



In my case I just have on field in the database into which I want to insert a xml containing the values of the fields from the form.



How do I do regular SQL statements like insert, select, update and connect without specifying a dataconnection in the dataview, but only by using javascript?
2 Replies

Avatar

Former Community Member
Unfortunately I think the answer is "You can't". The only way to run SQL is through a data connection.



What you could do is bind the data to some invisible fields, and then use JavaScript to pull the data that gets populated into the invisible fields into the visible fields that you want - this lets you still use the data connection, but have more control over what happens with the data.



Would this work for you?

--

SteveX

Adobe Systems

Avatar

Former Community Member
I had actually thought of that in the first place, but didn't know if there was a "better" way of doing it. I have decided to use your suggestion to solve my problem.



Thanks for the help.