[#161847160] Add sqlcl support to other scripts
This commit is contained in:
parent
1aa1fc8d06
commit
65475a3751
@ -5,9 +5,16 @@ source config/asc.conf || exit 1
|
|||||||
NLS_LANG=.AL32UTF8
|
NLS_LANG=.AL32UTF8
|
||||||
export NLS_LANG
|
export NLS_LANG
|
||||||
|
|
||||||
|
if which -s sql; then
|
||||||
|
sql_cmd=sql
|
||||||
|
else
|
||||||
|
echo WARNING: could not find SQLcl \(sql\). Falling back to sqlplus
|
||||||
|
sql_cmd=sqlplus
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "${app_alias}" ]; then
|
if [ -z "${app_alias}" ]; then
|
||||||
#call install_apex with an empty app_alias string (will ask for user input otherwise)
|
#call install_apex with an empty app_alias string (will ask for user input otherwise)
|
||||||
sqlplus "${username}"/"${password}"@"${database_connection}" @"${script_folder}"/install_apex.sql "${apexappid}" "${workspace_name}" "${parsing_schema}" '' || exit 1
|
${sql_cmd} "${username}"/"${password}"@"${database_connection}" @"${script_folder}"/install_apex.sql "${apexappid}" "${workspace_name}" "${parsing_schema}" '' || exit 1
|
||||||
else
|
else
|
||||||
sqlplus "${username}"/"${password}"@"${database_connection}" @"${script_folder}"/install_apex.sql "${apexappid}" "${workspace_name}" "${parsing_schema}" "${app_alias}" || exit 1
|
${sql_cmd} "${username}"/"${password}"@"${database_connection}" @"${script_folder}"/install_apex.sql "${apexappid}" "${workspace_name}" "${parsing_schema}" "${app_alias}" || exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -1,9 +1,23 @@
|
|||||||
# designed to be called from top level project dir
|
# designed to be called from top level project dir
|
||||||
script_folder=$(dirname $0)
|
script_folder=$(dirname $0)
|
||||||
source config/asc.conf || exit 1
|
source config/asc.conf || exit 1
|
||||||
sqlplus ${username}/${password}@${database_connection} @${script_folder}/generate_new_app_id.sql || exit 1
|
|
||||||
|
|
||||||
app_id=$(head -c -1 config/new_app_id.txt | sed -e 's/[[:space:]]*$//')
|
if which -s sql; then
|
||||||
|
echo Running PWD $PWD
|
||||||
|
sql_cmd="sql -S"
|
||||||
|
else
|
||||||
|
echo WARNING: could not find SQLcl \(sql\). Falling back to sqlplus
|
||||||
|
sql_cmd="sqlplus -S"
|
||||||
|
fi
|
||||||
|
|
||||||
|
tmpfile=$(mktemp -t generate_app_id)
|
||||||
|
|
||||||
|
echo ${sql_cmd} ${username}/${password}@${database_connection} @${script_folder}/generate_new_app_id.sql $tmpfile || exit 1
|
||||||
|
${sql_cmd} ${username}/${password}@${database_connection} @${script_folder}/generate_new_app_id.sql > $tmpfile || exit 1
|
||||||
|
|
||||||
|
app_id=$(cat $tmpfile)
|
||||||
|
|
||||||
|
rm $tmpfile
|
||||||
|
|
||||||
if [ -h config/asc.conf ]; then
|
if [ -h config/asc.conf ]; then
|
||||||
conf_file=$(readlink ./config/asc.conf)
|
conf_file=$(readlink ./config/asc.conf)
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
spool config/new_app_id.txt
|
|
||||||
set serveroutput on
|
set serveroutput on
|
||||||
set feedback off
|
set feedback off
|
||||||
begin
|
begin
|
||||||
@ -6,5 +5,4 @@ begin
|
|||||||
dbms_output.put_Line(apex_application_install.get_application_id);
|
dbms_output.put_Line(apex_application_install.get_application_id);
|
||||||
end;
|
end;
|
||||||
/
|
/
|
||||||
spool off
|
|
||||||
exit
|
exit
|
||||||
|
|||||||
@ -2,4 +2,12 @@
|
|||||||
script_folder=$(dirname $0)
|
script_folder=$(dirname $0)
|
||||||
"${script_folder}"/check_conf_file.sh || exit 1
|
"${script_folder}"/check_conf_file.sh || exit 1
|
||||||
source config/asc.conf || exit 1
|
source config/asc.conf || exit 1
|
||||||
sqlplus "${username}"/"${password}"@"${database_connection}" @"${script_folder}"/uninstall_apex.sql "${apexappid}" "${workspace_name}" "${parsing_schema}" || exit 1
|
|
||||||
|
if which -s sql; then
|
||||||
|
sql_cmd=sql
|
||||||
|
else
|
||||||
|
echo WARNING: could not find SQLcl \(sql\). Falling back to sqlplus
|
||||||
|
sql_cmd=sqlplus
|
||||||
|
fi
|
||||||
|
|
||||||
|
${sql_cmd} "${username}"/"${password}"@"${database_connection}" @"${script_folder}"/uninstall_apex.sql "${apexappid}" "${workspace_name}" "${parsing_schema}" || exit 1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user