Hi,
I follow this documentation:
https://confluence.atlassian.com/display/JIRAKB/Changing+Server+ID+for+Test+Installations
I put this query on my database in JIRA, with ID that I want:
UPDATE propertystring SET propertyvalue = '<ID>' where id = (select id from propertystring where id in (select id from propertyentry where PROPERTY_KEY='jira.sid.key'));
UPDATE propertystring SET propertyvalue =
'<ID>'
where id = (select id from propertystring where id in (select id from propertyentry where PROPERTY_KEY=
'jira.sid.key'
));
ERROR 1093 (HY000): You can't specify target table 'propertystring' for update in FROM clause
Finally, this was the sentence SQL that I used to change my Server ID on JIRA:
UPDATE propertystring SET propertyvalue = 'XXXX-XXXX-XXXX-XXXX' where id= XXXX<br>
You have to search which ID you have to change with query:
select * from propertystring where id in (select id from propertyentry where PROPERTY_KEY='jira.sid.key');
Need someone who is good in MSSQL on this. Quick search lead me to this and this link.
UPDATE propertystring SET propertyvalue = 'XXXX-XXXX-XXXX-XXXX' where id in (select id from propertystring where id in (select id from propertyentry where PROPERTY_KEY='jira.sid.key'));
Your SQL query must be wrong and may need the extra schemas/domain included with the table name. Fix it.
Don't work for me. I still get the same error...
I test:
And works, return:ID | property value10006 | XXXX-XXXX-XXXX-XXXXI test this:
UPDATE propertystring SET propertyvalue = 'XXXX-XXXX-XXXX-XXXX' where id in (select id from propertystring where id in (select id from propertyentry where PROPERTY_KEY='jira.sid.key'));<br>
And not works... I get the same error... why??
MySQL does not allow modifying tables, that are mentioned in subqueries of the UPDATE. So rephrase your update to avoid subqueries. Something like (untested):
UPDATE propertystring, propertyentry SET propertyvalue = 'XXXX-XXXX-XXXX-XXXX' WHERE propertstring.id=propertyentry.id AND propertyentry.PROPERTY_KEY='jira.sid.key'
propertyvalue = 'XXXX-XXXX-XXXX-XXXX' WHERE propertstring.id=propertyentry.id AND
propertyentry.PROPERTY_KEY=
Test the query with SELECT instead of UPDATE. Yes, you can list multiple tables in UPDATE even if you are only modifying some of them...
Why to put in addition "select id from propertystring where id..."
select id from propertystring where id..."
Is it not simpliest as below ?
UPDATE propertystring SET propertyvalue = 'XXXX-XXXX-XXXX-XXXX' where id in ( select id from propertyentry where PROPERTY_KEY='jira.sid.key');
Best regards
It looks like you're new here. Sign in or register to get started.