Changing the Accept String in a Transaction
Get the serviceid of the transaction
- Log in to the database server using SecureCRT
At the command prompt type psql -d gnw and press enter
This brings you to the database command prompt which is represented as dbname=#
[bcamp@dbcoma01aprd ~]$ psql -d gnw psql (9.0.4) Type "help" for help. gnw=#
At the SQL command prompt enter the following query using the serviceid of the service in question:
select step, accept_string from tservicelist where serviceid = 32351;
Remember to replace 32351 with the correct serviceid number.
- Note: the query must have a semicolon at the end.
gnw=# select step, accept_string from tservicelist where serviceid = 32351; step | accept_string ------+--------------- 0 | Apple Inc 1 | 301 2 | Welcome 3 | Shop iPod (4 rows)
- This shows the accept string for each step of the transaction.
Note: It is important to note in the output of the transaction steps that the steps are numbered starting with zero. This means that the step number in the database will be one less than the step number shown in the GNW web interface.
- To change an accept string you need the serviceid of the transaction and the database step number. Enter the following command to update the accept string.
update tservicelist set accept_string='new accept string' where serviceid = 32351 and step = 2;
Be sure to replace 32351 with the correct serviceid
Be sure to replace 2 with the correct database step number
Be sure to replace new accept string with the correct accept string
Note: the accept string must be enclosed in single quotes: 'new accept string'
Note: the command must end in a semicolon
gnw=# update tservicelist set accept_string='new accept string' where serviceid = 32351 and step = 2; 1 row updated. gnw=#
- To verify the change we just re-run the select query in step 5 again.
Next we have to update the change flag so that the updates will be sent out to the nodes. At the SQL prompt type the following command using the correct serviceid
gnw=# update servicelist set change=1 where serviceid=32351; 1 row updated. gnw=#
- After committing the change, type quit at the SQL prompt to leave the database and return to the iprev3 command prompt.