apm_upgrade_script_compare (private)

 apm_upgrade_script_compare f1 f2

Defined in packages/acs-tcl/tcl/apm-install-procs.tcl

Parameters:
f1 (required)
f2 (required)
Returns:
1 if f1 comes after f2, 0 if they are the same, -1 if f1 comes before f2.

Partial Call Graph (max 5 caller/called nodes):
%3 db_exec_plsql db_exec_plsql (public) apm_upgrade_script_compare apm_upgrade_script_compare apm_upgrade_script_compare->db_exec_plsql

Testcases:
No testcase defined.
Source code:
    # Strip off any path information.
    set f1 [lindex [split $f1 /] end]
    set f2 [lindex [split $f2 /] end]

    # Get the version number from, e.g. the 2.0 from upgrade-2.0-3.0.sql
    if {[regexp {\-(.*)-.*.sql} $f1 match f1_version_from]
        && [regexp {\-(.*)-.*.sql} $f2 match f2_version_from]
    } {
        # At this point we should have something like 2.0 and 3.1d which Tcl string
        # comparison can handle.
        set f1_version_from [db_exec_plsql test_f1 {}]
        set f2_version_from [db_exec_plsql test_f2 {}]
        return [string compare $f1_version_from $f2_version_from]
    } else {
        error "Invalid upgrade script syntax.  Should be \"upgrade-major.minor-major.minor.sql\"."
    }
Generic XQL file:
packages/acs-tcl/tcl/apm-install-procs.xql

PostgreSQL XQL file:
<fullquery name="apm_upgrade_script_compare.test_f1">
    <querytext>

	    select apm_package_version__sortable_version_name(:f1_version_from);

      </querytext>
</fullquery>

<fullquery name="apm_upgrade_script_compare.test_f2">
    <querytext>

	    select apm_package_version__sortable_version_name(:f2_version_from);

      </querytext>
</fullquery>
packages/acs-tcl/tcl/apm-install-procs-postgresql.xql

Oracle XQL file:
<fullquery name="apm_upgrade_script_compare.test_f1">
    <querytext>
      
	    begin
	    :1 := apm_package_version.sortable_version_name('$f1_version_from');
	    end;
	
      </querytext>
</fullquery>

<fullquery name="apm_upgrade_script_compare.test_f2">
    <querytext>
      
	    begin
	    :1 := apm_package_version.sortable_version_name('$f2_version_from');
	    end;
	
      </querytext>
</fullquery>
packages/acs-tcl/tcl/apm-install-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: