Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Pre-requisite: User needs to have access to the database to execute the SQL query

Steps:

  1. Import the workflow for at least one CP using UI as below.Image Modified
  2. Below SQL sets the workflow set for CP using UI (whose ID is 1) to other CPs (CP1, CP2, CP3, CP4)

    Code Block
    languagesql
    titleMySQL
    updateinsert into 
      os_cp_workflows
    dst 
    select
     inner join os_cp_workflows src on src.cp_id = 1 
    set 
      dst.workflows = src.workflows 
    where 
      dst.cp_id in (
        select
          identifier 
        from 
          catissue_collection_protocol 
        where 
          short_title in ('CP1', 'CP2', 'CP3', 'CP4')
      );
    Code Block
    languagesql
    titleOracle
    merge into
      os_cp_workflows dst
    using (
      select
        src.cp_id, src.workflows   from
        os_cp_workflows src
    ) on (src.where cp_id = 1)
    when matched then
      update 
        set dst.workflows
    = src.workflows 
      where 
        dst.cp_id in (
          select
            identifier 
          from 
         
      catissue_collection_protocol 
        cp
     where
             cp.short_title in ('CP1', 'CP2', 'CP3', 'CP4') and cp.identifier !=  )1