Copy the data in data list to other table in mysql

Confluence User - 09 Mar, 2018

I am using enterprise version of joget. I have a datalist where I have data imported from excel using import tool. Also, as specified in the docs, it does create a table in background in mysql corresponding to data in thats imported and is shown in datalist. Now, I have added a jdbc action in the datalist common for all rows in it.

 

In the query section of that jdbc datalist binder, I have added this query:

 

Insert into finalTable values(select col1, col2, col3 from app_fd_autoCreatedTable)

 

I want to add selected data in finalTable from the auto created table after importing. This above query does not work. This has totally stalled me as I didn't find any examples of using nested queries like this on the web.

Please help.

Thanks :)

datalists;#jdbcbinder;query;mysql;userviews;forms

2


10 Mar, 2018
confluenceUser
confluenceUser

Hi

Datalist only allows SELECT SQL statements as it's job is to list records, and from this listing users can select to open into a form for CRUD. Datalist cannot perform database updates or inserts.

You can use Database Update Tool in a process flow to INSERT records in Joget database tables.

Note that Joget tables start with "app_fd_[your form table name]"  and columns start with "c_[your form field id]".

Example:

CREATE TABLE `app_fd_j_crm_account` (
`id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`dateCreated` datetime DEFAULT NULL,
`dateModified` datetime DEFAULT NULL,
`c_country` longtext COLLATE utf8_unicode_ci DEFAULT NULL,
`c_address` longtext COLLATE utf8_unicode_ci DEFAULT NULL,
`createdBy` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`createdByName` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`modifiedBy` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`modifiedByName` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

`createdBy` and `modifiedBy` fields are new in Joget Workflow v6.

You can download free apps from Joget Marketplace and examine how apps are built as they are all editable web console.

11 Mar, 2018
confluenceUser
confluenceUser

Thanks For answering Andrew :) But I have one more small problem. I also want to perform some post-processing on the data imported through import tool. For eg, I want to spilt the strings in column 1 where values are like: value1/value2. I want to split them using "/" and add them to separate columns in final table. Any idea on how this can be done? Thanks in advance :)

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print