Is there a way to add value from one query to another in xml based changeset?

Hi there,

I would like to know is there any chance for this and how to pull it

<insert tableName="print_template">
                <column name="fk_po_service" valueNumeric="some_sql_here_to_find_this_id/>
                <column name="template" valueBlobFile="../al-pos.vm"/>
                <column name="is_deleted" valueBoolean="false"/>
                <column name="created_by" valueNumeric="1"/>
                <column name="updated_by" valueNumeric="1"/>
                <column name="description" value="al-pos"/>
            </insert>

Important part is this one some_sql_here_to_find_this_id. I would like to insert some sql there like
SELECT id FROM some_table. Is there a way of doing this ?

1 Like

valueComputed instead of valueNumeric will allow you to use SQL in there.

1 Like

Hi @labanluka22! Thanks @NathanVoxland for the answer.

Here’s the documentation:

valueComputed A value that is returned from a function or procedure call. This attribute will contain the function to call.

This is not what he asked about. You can’t be creating functions every time you need to make a subquery. Ok, you can, create function, use it, and then delete function. But it’s a little ugly