Merge branch 'Flyway-join'
commit
8140b0ea8a
|
@ -0,0 +1,10 @@
|
|||
/.classpath
|
||||
/.project
|
||||
/.settings
|
||||
/target
|
||||
/settings.xml
|
||||
/dist
|
||||
/.factorypath
|
||||
/*.BASE.xml
|
||||
/*.LOCAL.xml
|
||||
/*.REMOTE.xml
|
|
@ -0,0 +1,82 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>br.com.rjconsultores</groupId>
|
||||
<artifactId>Flyway</artifactId>
|
||||
<version>1.106.0</version>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>rj-releases</id>
|
||||
<url>http://52.5.53.15:8081/nexus/content/repositories/releases/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<sourceDirectory>src</sourceDirectory>
|
||||
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${basedir}/src</directory>
|
||||
<includes>
|
||||
<include>*.*</include>
|
||||
<include>db/**</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-maven-plugin</artifactId>
|
||||
<version>3.2.1</version>
|
||||
<configuration>
|
||||
<validateMigrationNaming>true</validateMigrationNaming>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>2.17.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-core</artifactId>
|
||||
<version>4.2.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>4.0.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.oracle.database.jdbc</groupId>
|
||||
<artifactId>ojdbc8</artifactId>
|
||||
<version>21.7.0.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,3 @@
|
|||
Manifest-Version: 1.0
|
||||
Class-Path:
|
||||
|
|
@ -0,0 +1,430 @@
|
|||
package com.rjconsultores.ventaboletos;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Writer;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.flywaydb.core.Flyway;
|
||||
import org.flywaydb.core.api.callback.FlywayCallback;
|
||||
|
||||
import com.rjconsultores.ventaboletos.vo.FlyWayCustomDetail;
|
||||
|
||||
public class FlyWay {
|
||||
private static final Logger log = LogManager.getLogger(FlyWay.class);
|
||||
|
||||
private static final FlyWay INSTANCE = new FlyWay();
|
||||
|
||||
final private static String TABELA_FLYWAY = "schema_version_cst";
|
||||
final private static String AMBIENTE_DEV = "dev";
|
||||
final private static String AMBIENTE_CONSULTA = "consulta";
|
||||
final File JBOSS_DATA = getJBossDataDirectory();
|
||||
|
||||
private DataSource dataSource = null;
|
||||
|
||||
private String url = null;
|
||||
private String user = null;
|
||||
private String password = null;
|
||||
|
||||
private String location = "db.migration";
|
||||
private String oldies = "db.backup.oracle";
|
||||
|
||||
private FlyWay() {
|
||||
|
||||
}
|
||||
|
||||
public static FlyWay getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
private File getJBossDataDirectory() {
|
||||
try {
|
||||
return new File(System.getProperty("jboss.server.data.dir"));
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void defineLocation(final String location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public void defineDataSource(final DataSource dataSource) {
|
||||
this.dataSource = dataSource;
|
||||
|
||||
fixFiles(dataSource);
|
||||
}
|
||||
|
||||
public void defineProperties(final String url, final String user, final String password) {
|
||||
this.url = url;
|
||||
this.user = user;
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
private void fixFiles(final DataSource ds) {
|
||||
try {
|
||||
Connection c = dataSource.getConnection();
|
||||
Statement s = c.createStatement();
|
||||
|
||||
fixVersion(s, "20161710.1833", "20161017.1833", "V20161017_1833__mantis8112.sql");
|
||||
fixVersion(s, "20161910.0934", "20161019.0934", "V20161019_0934__mantis7907.sql");
|
||||
fixVersion(s, "20162410.1119", "20161024.1119", "V20161024_1119__mantis7904.sql");
|
||||
|
||||
s.close();
|
||||
c.close();
|
||||
|
||||
} catch (SQLException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
private void fixVersion(final Statement s, final String oldVersion, final String newVersion, final String newScript) throws SQLException {
|
||||
ResultSet rs = s.executeQuery("select count(*) as total from \"schema_version\" where \"version\" like '" + oldVersion + "'");
|
||||
|
||||
int total = 0;
|
||||
|
||||
while (rs.next()) {
|
||||
total = rs.getInt("total");
|
||||
}
|
||||
|
||||
rs.close();
|
||||
|
||||
if (total > 0) {
|
||||
log.info("Fix version " + oldVersion + " to new version " + newVersion + " and new script " + newScript);
|
||||
|
||||
StringBuilder sql = new StringBuilder("");
|
||||
sql.append(" update \"schema_version\"");
|
||||
sql.append(" set \"version\" = '" + newVersion + "', \"script\" = '" + newScript + "'");
|
||||
sql.append(" where \"version\" like '" + oldVersion + "'");
|
||||
|
||||
s.executeUpdate(sql.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public boolean start() {
|
||||
return start(null, null, false);
|
||||
}
|
||||
|
||||
public boolean start(Boolean isReloadFyway) {
|
||||
return start(null, null, isReloadFyway);
|
||||
}
|
||||
|
||||
public boolean startCustom() {
|
||||
String location = "db.performance";
|
||||
|
||||
if (JBOSS_DATA != null) {
|
||||
File data = new File(JBOSS_DATA, "flyway");
|
||||
|
||||
if (!data.exists()) {
|
||||
data.mkdirs();
|
||||
}
|
||||
|
||||
if (!validarScripts(data)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
location = "filesystem:" + data.getPath();
|
||||
}
|
||||
|
||||
return start(location, TABELA_FLYWAY, false);
|
||||
}
|
||||
|
||||
public boolean start(final String customLocation, final String customTable, Boolean isReloadFlyway) {
|
||||
log.info("Executando Flyway...");
|
||||
|
||||
try{
|
||||
String ambiente = System.getProperty("ambiente") ==null || System.getProperty("ambiente").isEmpty() ? "" : System.getProperty("ambiente");
|
||||
if( (AMBIENTE_DEV.equalsIgnoreCase(ambiente) && AMBIENTE_CONSULTA.equalsIgnoreCase(ambiente)) && Boolean.FALSE.equals(isReloadFlyway) ) {
|
||||
log.warn("Flyway não executado. Ambiente = dev ou consulta");
|
||||
return true;
|
||||
}
|
||||
|
||||
final Flyway flyway = new Flyway();
|
||||
|
||||
if (customTable != null) {
|
||||
flyway.setTable(customTable);
|
||||
}
|
||||
|
||||
if (customLocation != null) {
|
||||
flyway.setLocations(customLocation);
|
||||
} else if (this.location != null && !this.location.equals("db.migration")) {
|
||||
flyway.setLocations(this.location);
|
||||
}else {
|
||||
flyway.setLocations(this.oldies, this.location);
|
||||
}
|
||||
|
||||
if (dataSource != null) {
|
||||
flyway.setDataSource(dataSource);
|
||||
} else {
|
||||
flyway.setDataSource(url, user, password);
|
||||
|
||||
dataSource = flyway.getDataSource();
|
||||
}
|
||||
|
||||
execute(flyway);
|
||||
log.info("Flyway executado.");
|
||||
|
||||
}catch(Throwable t){
|
||||
log.error("Erro ao executar o Flyway",t);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void execute(final Flyway flyway) {
|
||||
flyway.setValidateOnMigrate(false);
|
||||
flyway.setIgnoreFutureMigrations(true);
|
||||
flyway.setOutOfOrder(true);
|
||||
flyway.setBaselineOnMigrate(true);
|
||||
|
||||
if (flyway.getTable().equals(TABELA_FLYWAY)) {
|
||||
FlyWayCallback errorCallback = new FlyWayCallback();
|
||||
|
||||
FlywayCallback[] callbacks = new FlywayCallback[]{ errorCallback };
|
||||
flyway.setCallbacks(callbacks);
|
||||
|
||||
boolean reexecute = false;
|
||||
|
||||
do {
|
||||
reexecute = false;
|
||||
|
||||
try {
|
||||
flyway.migrate();
|
||||
} catch (final Exception e) {
|
||||
if (errorCallback.getScriptError() != null && JBOSS_DATA != null) {
|
||||
reexecute = true;
|
||||
|
||||
log.error("[Flyway] Erro ao executar o script: " + errorCallback.getScriptError() + ". Este script sera desabilitado na tabela FLYWAY_SCRIPTS.");
|
||||
|
||||
File scriptFile = new File(JBOSS_DATA, "flyway");
|
||||
scriptFile = new File(scriptFile, errorCallback.getScriptError());
|
||||
|
||||
if (scriptFile.exists()) {
|
||||
boolean success = scriptFile.delete();
|
||||
|
||||
log.info("[Flyway] Excluindo fisicamente o script: " + errorCallback.getScriptError() + ". " + (success ? "OK" : "ERROR"));
|
||||
|
||||
if (!success) {
|
||||
reexecute = false;
|
||||
}
|
||||
}
|
||||
|
||||
Connection c = null;
|
||||
PreparedStatement ps = null;
|
||||
|
||||
try {
|
||||
c = flyway.getDataSource().getConnection();
|
||||
ps = c.prepareStatement("update flyway_scripts set activo = 0 where nome like ?");
|
||||
ps.setString(1, errorCallback.getScriptError().replace(".sql", ""));
|
||||
ps.executeUpdate();
|
||||
|
||||
} catch (SQLException e1) {
|
||||
} finally {
|
||||
if (ps != null) {
|
||||
try { ps.close(); } catch (SQLException e1) {}
|
||||
}
|
||||
|
||||
if (c != null) {
|
||||
try { c.close(); } catch (SQLException e1) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flyway.repair();
|
||||
}
|
||||
} while (reexecute);
|
||||
} else {
|
||||
flyway.migrate();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean validarScripts(File data) {
|
||||
Map<String, FlyWayCustomDetail> scripts = new HashMap<String, FlyWayCustomDetail>(0);
|
||||
|
||||
try {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
boolean existe = existeSchema(dataSource.getConnection());
|
||||
|
||||
if (existe) {
|
||||
sb.append(" select nome as nome_arquivo, sql as sql_arquivo, sql_erro as erro, datahora_execucao as datahora");
|
||||
sb.append(" from flyway_scripts");
|
||||
sb.append(" where activo = 1 and nome not in (select replace(\"script\", '.sql', '') from \"schema_version_cst\")");
|
||||
sb.append(" order by nome_arquivo");
|
||||
} else {
|
||||
sb.append(" select nome as nome_arquivo, sql as sql_arquivo, sql_erro as erro, datahora_execucao as datahora");
|
||||
sb.append(" from flyway_scripts");
|
||||
sb.append(" where activo = 1");
|
||||
sb.append(" order by nome_arquivo");
|
||||
}
|
||||
|
||||
Connection c = dataSource.getConnection();
|
||||
Statement s = c.createStatement();
|
||||
|
||||
ResultSet rs = s.executeQuery(sb.toString());
|
||||
|
||||
while (rs.next()) {
|
||||
if (!isRegistroValido(rs.getString("nome_arquivo"), rs.getString("sql_arquivo"))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Timestamp timestamp = rs.getTimestamp("datahora");
|
||||
|
||||
FlyWayCustomDetail detail = new FlyWayCustomDetail();
|
||||
detail.setVersion(rs.getString("nome_arquivo"));
|
||||
detail.setSql(rs.getString("sql_arquivo"));
|
||||
detail.setErrorCode(rs.getString("erro"));
|
||||
|
||||
if (timestamp != null) {
|
||||
detail.setDatetimeExecute(new java.util.Date(timestamp.getTime()));
|
||||
}
|
||||
|
||||
scripts.put(rs.getString("nome_arquivo"), detail);
|
||||
}
|
||||
|
||||
rs.close();
|
||||
s.close();
|
||||
c.close();
|
||||
|
||||
} catch (SQLException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
if (scripts.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean retorno = false;
|
||||
|
||||
Writer writer = null;
|
||||
|
||||
for (Map.Entry<String, FlyWayCustomDetail> entry : scripts.entrySet()) {
|
||||
if (entry.getValue().getDatetimeExecute() != null) {
|
||||
Calendar atual = Calendar.getInstance();
|
||||
|
||||
if (atual.getTime().before(entry.getValue().getDatetimeExecute())) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
File scriptFile = new File(data, entry.getKey() + ".sql");
|
||||
|
||||
if (scriptFile.exists()) {
|
||||
scriptFile.delete();
|
||||
}
|
||||
|
||||
if (!scriptFile.exists()) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
if (entry.getValue().getErrorCode() != null) {
|
||||
sb.append("declare").append("\n");
|
||||
sb.append(" object_exists exception;").append("\n").append("\n");
|
||||
sb.append(" pragma exception_init (object_exists , ").append(entry.getValue().getErrorCode()).append(");").append("\n");
|
||||
sb.append("begin").append("\n");
|
||||
sb.append(" execute immediate '").append(entry.getValue().getSql()).append("';").append("\n");
|
||||
sb.append(" exception when object_exists then null;").append("\n");
|
||||
sb.append("end;");
|
||||
} else {
|
||||
sb.append(entry.getValue().getSql());
|
||||
}
|
||||
|
||||
try {
|
||||
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(scriptFile), "utf-8"));
|
||||
writer.write(sb.toString());
|
||||
|
||||
log.info("[Flyway] Script gerado: " + scriptFile.toString());
|
||||
|
||||
retorno = true;
|
||||
} catch (IOException ex) {
|
||||
} finally {
|
||||
try {writer.close();} catch (Exception ex) {log.info(ex.getMessage(), ex);}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return retorno;
|
||||
}
|
||||
|
||||
private boolean isRegistroValido(String versao, String sql) {
|
||||
boolean valido = true;
|
||||
|
||||
String v[] = versao.split("_");
|
||||
|
||||
if (!versao.startsWith("V")) {
|
||||
valido = false;
|
||||
} else {
|
||||
if (!(v.length == 4)) {
|
||||
valido = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!valido) {
|
||||
Connection c = null;
|
||||
PreparedStatement ps = null;
|
||||
|
||||
try {
|
||||
c = dataSource.getConnection();
|
||||
ps = c.prepareStatement("update flyway_scripts set activo = 0 where nome like ?");
|
||||
ps.setString(1, versao);
|
||||
ps.executeUpdate();
|
||||
|
||||
} catch (SQLException e1) {
|
||||
} finally {
|
||||
if (ps != null) {
|
||||
try { ps.close(); } catch (SQLException e1) {}
|
||||
}
|
||||
|
||||
if (c != null) {
|
||||
try { c.close(); } catch (SQLException e1) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return valido;
|
||||
}
|
||||
|
||||
private boolean existeSchema(Connection c) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("SELECT count(table_name) as existe FROM user_tables WHERE table_name = 'schema_version_cst'");
|
||||
|
||||
try {
|
||||
Statement s = c.createStatement();
|
||||
ResultSet rs = s.executeQuery(sb.toString());
|
||||
|
||||
int existe = 0;
|
||||
|
||||
while (rs.next()) {
|
||||
existe = rs.getInt("existe");
|
||||
}
|
||||
|
||||
rs.close();
|
||||
s.close();
|
||||
c.close();
|
||||
|
||||
if (existe > 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
} catch (SQLException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
package com.rjconsultores.ventaboletos;
|
||||
|
||||
import java.sql.Connection;
|
||||
|
||||
import org.flywaydb.core.api.MigrationInfo;
|
||||
import org.flywaydb.core.api.callback.FlywayCallback;
|
||||
|
||||
/* https://flywaydb.org/documentation/callbacks.html */
|
||||
public class FlyWayCallback implements FlywayCallback {
|
||||
private String script = null;
|
||||
|
||||
public String getScriptError() {
|
||||
return script;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeClean(Connection connection) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterClean(Connection connection) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeMigrate(Connection connection) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterMigrate(Connection connection) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeEachMigrate(Connection connection, MigrationInfo info) {
|
||||
this.script = info.getScript();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterEachMigrate(Connection connection, MigrationInfo info) {
|
||||
this.script = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeValidate(Connection connection) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterValidate(Connection connection) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeBaseline(Connection connection) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterBaseline(Connection connection) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeRepair(Connection connection) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterRepair(Connection connection) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeInfo(Connection connection) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterInfo(Connection connection) {
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.rjconsultores.ventaboletos.servlet;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.rjconsultores.ventaboletos.FlyWay;
|
||||
|
||||
public class ReloadFlyway extends HttpServlet {
|
||||
private static final long serialVersionUID = -2076848353707789950L;
|
||||
|
||||
private PrintWriter out = null;
|
||||
|
||||
@Override
|
||||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||
out = resp.getWriter();
|
||||
out.println("<h2>Reload Flyway</h2>");
|
||||
|
||||
boolean retorno = FlyWay.getInstance().start(true);
|
||||
|
||||
if (retorno) {
|
||||
out.print("Processo realizado com sucesso.");
|
||||
} else {
|
||||
out.print("Erro ao executar o flyway. Verifique o log do servidor.");
|
||||
}
|
||||
|
||||
out.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||
doGet(req, resp);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package com.rjconsultores.ventaboletos.vo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class FlyWayCustomDetail {
|
||||
private String version;
|
||||
private String sql;
|
||||
private String errorCode;
|
||||
private Date datetimeExecute;
|
||||
|
||||
public FlyWayCustomDetail() {
|
||||
super();
|
||||
}
|
||||
|
||||
public FlyWayCustomDetail(String version, String sql, String errorCode, Date datetimeExecute) {
|
||||
super();
|
||||
this.version = version;
|
||||
this.sql = sql;
|
||||
this.errorCode = errorCode;
|
||||
this.datetimeExecute = datetimeExecute;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getSql() {
|
||||
return sql;
|
||||
}
|
||||
|
||||
public void setSql(String sql) {
|
||||
this.sql = sql;
|
||||
}
|
||||
|
||||
public String getErrorCode() {
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
public void setErrorCode(String errorCode) {
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
|
||||
public Date getDatetimeExecute() {
|
||||
return datetimeExecute;
|
||||
}
|
||||
|
||||
public void setDatetimeExecute(Date datetimeExecute) {
|
||||
this.datetimeExecute = datetimeExecute;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FlyWayCustomDetail [version=" + version + ", sql=" + sql + ", errorCode=" + errorCode
|
||||
+ ", datetimeExecute=" + datetimeExecute + "]";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE FECHAMENTO_PARAMPTOVTA ADD (TIPOPAGAMENTO VARCHAR2(1) DEFAULT ''B'')';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
dup_val_on_index exception;
|
||||
pragma exception_init (dup_val_on_index , -00001);
|
||||
begin
|
||||
execute immediate 'update autorizacion set NOMBAUTORIZACION = ''AUT_AUMENTA_DISPONIBILIDAD'' where NOMBAUTORIZACION = ''AUT_AUMENTA_DISPONIB''';
|
||||
exception when dup_val_on_index then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE DIAGRAMA_AUTOBUS ADD INDBARCO NUMBER(1,0) DEFAULT 0';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,42 @@
|
|||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE
|
||||
CASETA_PEAJE_EXCEPCION
|
||||
(
|
||||
CASETAPEAJEEXCEPCION_ID NUMBER(7) NOT NULL,
|
||||
CASETAPEAJE_ID NUMBER(7) NOT NULL,
|
||||
FECHAVENTAINI DATE,
|
||||
FECHAVENTAFIN DATE,
|
||||
FECHORINICIO DATE,
|
||||
FECHORFINAL DATE,
|
||||
INDLUNES NUMBER(1),
|
||||
INDMARTES NUMBER(1),
|
||||
INDMIERCOLES NUMBER(1),
|
||||
INDJUEVES NUMBER(1),
|
||||
INDVIERNES NUMBER(1),
|
||||
INDSABADO NUMBER(1),
|
||||
INDDOMINGO NUMBER(1),
|
||||
ACTIVO NUMBER(1),
|
||||
FECMODIF DATE,
|
||||
USUARIO_ID NUMBER(7),
|
||||
PRECIO NUMBER(7,2),
|
||||
CONSTRAINT CASETA_PEAJE_EXCEPCION_PK PRIMARY KEY (CASETAPEAJEEXCEPCION_ID),
|
||||
CONSTRAINT CASETAPEXCEPCION_CASETA_FK FOREIGN KEY (CASETAPEAJE_ID) REFERENCES
|
||||
CASETA_PEAJE (CASETAPEAJE_ID),
|
||||
CONSTRAINT NNC_CASETAPEAJEEXCEPCION_ID CHECK ("CASETAPEAJEEXCEPCION_ID" IS NOT NULL),
|
||||
CONSTRAINT NNC_CASETAPEAJE_ID CHECK ("CASETAPEAJE_ID" IS NOT NULL)
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE SEQUENCE "CASETA_PEAJE_EXCEPCION_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE CONF_RESTRICAO_CANALVENTA ADD (INDEXIBECORRIDABLOQ NUMBER(1,0) DEFAULT 0 NOT NULL ENABLE)';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,16 @@
|
|||
declare
|
||||
dup_val_on_index exception;
|
||||
except_02291 exception;
|
||||
|
||||
pragma exception_init (dup_val_on_index , -00001);
|
||||
pragma exception_init (except_02291 , -02291);
|
||||
begin
|
||||
execute immediate
|
||||
'insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID)
|
||||
values
|
||||
(FUNCION_SISTEMA_SEQ.NEXTVAL,''2'',''VDA > MANUTENÇÃO DE SERVIÇOS >> MODIFICAÇÕES DE SERVIÇO >>> INICIADO/FECHADO'',''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.MODIFICASERVICOINICIADOFECHADO'',''1'',SYSDATE,''1'')';
|
||||
|
||||
exception
|
||||
when dup_val_on_index then null;
|
||||
when except_02291 then null;
|
||||
end;
|
|
@ -0,0 +1,15 @@
|
|||
declare
|
||||
dup_val_on_index exception;
|
||||
pragma exception_init (dup_val_on_index , -00001);
|
||||
begin
|
||||
execute immediate 'update autorizacion set NOMBAUTORIZACION = ''AUT_EXCEDE_TRANSFERENCIA'' where NOMBAUTORIZACION = ''AUT_CAMBIO_ULTIMA_HR''';
|
||||
exception when dup_val_on_index then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
dup_val_on_index exception;
|
||||
pragma exception_init (dup_val_on_index , -00001);
|
||||
begin
|
||||
execute immediate 'update autorizacion set activo = 0 where NOMBAUTORIZACION in (''AUT_BOL_ASIENTOS'',''AUT_CAMBIAR_FOLIO'',''AUT_CANCELA_PAGOTAR'',''AUT_ENTREGA_EXTRAVIA'',''AUT_EXCEDE_TRANSFERE'',''AUT_OTORGAR_CORTESIA'')';
|
||||
exception when dup_val_on_index then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE RUTA ADD INDRUTACENLADA NUMERIC(1) default 0';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,21 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE EXCEPCION_PEAJE_VIGENCIA ADD (CASETAPEAJE_ID NUMBER(7))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
except_02275 exception;
|
||||
|
||||
pragma exception_init (column_exists , -01430);
|
||||
pragma exception_init (column_exists , -02275);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE EXCEPCION_PEAJE_VIGENCIA ADD CONSTRAINT EXCPEAJEVIGENCIA_CASETA_FK FOREIGN KEY (CASETAPEAJE_ID) REFERENCES CASETA_PEAJE (CASETAPEAJE_ID)';
|
||||
|
||||
exception
|
||||
when column_exists then null;
|
||||
when except_02275 then null;
|
||||
end;
|
|
@ -0,0 +1,124 @@
|
|||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'
|
||||
CREATE TABLE MENSAJE (
|
||||
MENSAJE_ID NUMBER(7,0) NOT NULL ENABLE,
|
||||
FECINI DATE,
|
||||
FECFIN DATE,
|
||||
DESCRIPCION VARCHAR2(500 BYTE),
|
||||
INDTIPO NUMBER(1,0),
|
||||
ACTIVO NUMBER(1,0),
|
||||
FECMODIF DATE,
|
||||
USUARIO_ID NUMBER(7,0),
|
||||
CONSTRAINT "PK_MENSAJE" PRIMARY KEY ("MENSAJE_ID"),
|
||||
CONSTRAINT "FK_MENSAJE_USUARIO" FOREIGN KEY ("USUARIO_ID") REFERENCES USUARIO("USUARIO_ID")
|
||||
)
|
||||
';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'
|
||||
CREATE TABLE MENSAJE_PUNTO_VENTA(
|
||||
MENSAJE_PUNTO_VENTA_ID NUMBER(7,0) NOT NULL ENABLE,
|
||||
MENSAJE_ID NUMBER(7,0),
|
||||
PUNTOVENTA_ID NUMBER(7,0),
|
||||
ACTIVO NUMBER(1,0),
|
||||
FECMODIF DATE,
|
||||
USUARIO_ID NUMBER(7,0),
|
||||
CONSTRAINT "PK_MENSAJE_PUNTO_VENTA" PRIMARY KEY ("MENSAJE_PUNTO_VENTA_ID"),
|
||||
CONSTRAINT "FK_MENSAJE_PTO_VENTA_MENSAJE" FOREIGN KEY ("MENSAJE_ID") REFERENCES MENSAJE("MENSAJE_ID"),
|
||||
CONSTRAINT "FK_MENSAJE_PTO_VENTA_PTO_VENTA" FOREIGN KEY ("PUNTOVENTA_ID") REFERENCES PUNTO_VENTA("PUNTOVENTA_ID"),
|
||||
CONSTRAINT "FK_MENSAJE_PUNTO_VENTA_USUARIO" FOREIGN KEY ("USUARIO_ID") REFERENCES USUARIO("USUARIO_ID")
|
||||
)
|
||||
';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'
|
||||
CREATE TABLE MENSAJE_EMPRESA(
|
||||
MENSAJE_EMPRESA_ID NUMBER(7,0) NOT NULL ENABLE,
|
||||
MENSAJE_ID NUMBER(7,0),
|
||||
EMPRESA_ID NUMBER(7,0),
|
||||
ACTIVO NUMBER(1,0),
|
||||
FECMODIF DATE,
|
||||
USUARIO_ID NUMBER(7,0),
|
||||
CONSTRAINT "PK_MENSAJE_EMPRESA" PRIMARY KEY ("MENSAJE_EMPRESA_ID"),
|
||||
CONSTRAINT "FK_MENSAJE_EMPRESA_MENSAJE" FOREIGN KEY ("MENSAJE_ID") REFERENCES MENSAJE("MENSAJE_ID"),
|
||||
CONSTRAINT "FK_MENSAJE_EMPRESA_EMPRESA" FOREIGN KEY ("EMPRESA_ID") REFERENCES EMPRESA("EMPRESA_ID"),
|
||||
CONSTRAINT "FK_MENSAJE_EMPRESA_USUARIO" FOREIGN KEY ("USUARIO_ID") REFERENCES USUARIO("USUARIO_ID")
|
||||
)
|
||||
';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'
|
||||
CREATE TABLE MENSAJE_USUARIO(
|
||||
MENSAJE_USUARIO_ID NUMBER(7,0) NOT NULL ENABLE,
|
||||
MENSAJE_ID NUMBER(7,0),
|
||||
USUARIO_ID NUMBER(7,0),
|
||||
FECLEIDO DATE,
|
||||
ACTIVO NUMBER(1,0),
|
||||
USUARIOMODIF_ID NUMBER(7,0),
|
||||
FECMODIF DATE,
|
||||
CONSTRAINT "PK_MENSAJE_USUARIO" PRIMARY KEY ("MENSAJE_USUARIO_ID"),
|
||||
CONSTRAINT "FK_MENSAJE_USUARIO_MENSAJE" FOREIGN KEY ("MENSAJE_ID") REFERENCES MENSAJE("MENSAJE_ID"),
|
||||
CONSTRAINT "FK_MENSAJE_USUARIO_USUARIO" FOREIGN KEY ("USUARIO_ID") REFERENCES USUARIO("USUARIO_ID"),
|
||||
CONSTRAINT "FK_MENSAJE_USUMODIF_USUARIO" FOREIGN KEY ("USUARIOMODIF_ID") REFERENCES USUARIO("USUARIO_ID")
|
||||
)
|
||||
';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE SEQUENCE "MENSAJE_SEQ" MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE SEQUENCE "MENSAJE_PUNTO_VENTA_SEQ" MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE SEQUENCE "MENSAJE_EMPRESA_SEQ" MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE SEQUENCE "MENSAJE_USUARIO_SEQ" MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
|
@ -0,0 +1,24 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE EMPRESA ADD INDGENNUMFOLIOVTAINTIMPOST NUMBER(1,0) DEFAULT 0 NOT NULL';
|
||||
exception
|
||||
when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
begin
|
||||
execute immediate 'INSERT INTO FUNCION_SISTEMA VALUES
|
||||
(
|
||||
FUNCION_SISTEMA_SEQ.NEXTVAL,
|
||||
1,
|
||||
''ADM > CATALOGOS >> EMPRESA >> GERA NUMERO BILHETE VENDA INTERNET E IMP. POSTERIOR'',
|
||||
''COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.EMPRESA.GENERAFOLIOSISTEMAVTAINTIMPPOSTERIOR'',
|
||||
1 ,
|
||||
sysdate,
|
||||
1
|
||||
)';
|
||||
|
||||
exception when others then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE TAXA_EMBARQUE_PARADA ADD (EMPRESA_ID NUMBER(7) DEFAULT -1 NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,17 @@
|
|||
DECLARE
|
||||
itemExists NUMBER;
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
BEGIN
|
||||
itemExists := 0;
|
||||
|
||||
SELECT COUNT(CONSTRAINT_NAME) INTO itemExists
|
||||
FROM ALL_CONSTRAINTS
|
||||
WHERE UPPER(CONSTRAINT_NAME) = UPPER('TARIFA_UNICA');
|
||||
|
||||
IF itemExists > 0 THEN
|
||||
EXECUTE IMMEDIATE 'ALTER TABLE TARIFA DROP CONSTRAINT TARIFA_UNICA';
|
||||
END IF;
|
||||
|
||||
exception when column_exists then null;
|
||||
END;
|
|
@ -0,0 +1,17 @@
|
|||
DECLARE
|
||||
itemExists NUMBER;
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
BEGIN
|
||||
itemExists := 0;
|
||||
|
||||
SELECT COUNT(CONSTRAINT_NAME) INTO itemExists
|
||||
FROM ALL_CONSTRAINTS
|
||||
WHERE UPPER(CONSTRAINT_NAME) = UPPER('UNIQUE_TARIFA_OFICIAL');
|
||||
|
||||
IF itemExists > 0 THEN
|
||||
EXECUTE IMMEDIATE 'ALTER TABLE TARIFA_OFICIAL DROP CONSTRAINT UNIQUE_TARIFA_OFICIAL';
|
||||
END IF;
|
||||
|
||||
exception when column_exists then null;
|
||||
END;
|
|
@ -0,0 +1,13 @@
|
|||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'update ruta set INDRUTACENLADA=0 where INDRUTACENLADA is null';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
begin
|
||||
execute immediate 'alter table ruta modify (INDRUTACENLADA not null)';
|
||||
exception when others then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'alter table tarjeta_fidelidad modify numtarjeta NUMBER(14,0)';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE FISCAL_ML2 ADD (COOVINCULADO VARCHAR2(9))';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,22 @@
|
|||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE FISCAL_ENVIO_FISCO (
|
||||
FISCALENVIOFISCO_ID NUMBER(15) NOT NULL,
|
||||
NUMSERIE20 VARCHAR2(20) NOT NULL,
|
||||
DATAMOV VARCHAR2(8) NOT NULL,
|
||||
ARQUIVO VARCHAR2(50) NOT NULL,
|
||||
RETORNO VARCHAR2(50)
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate 'CREATE SEQUENCE FISCAL_ENVIO_FISCO_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999999999999999999999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER';
|
||||
exception when object_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE FISCAL_ENVIO_FISCO ADD (TENTATIVAS NUMBER(2))';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'alter table peaje modify (importepeaje number(15, 10))';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,5 @@
|
|||
declare
|
||||
begin
|
||||
execute immediate 'ALTER TABLE FISCAL_IMPRESSORA RENAME COLUMN INDGERAARQGT TO INDCTRL';
|
||||
exception when others then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE FISCAL_ML2 ADD (COOCUPOMFISCAL VARCHAR2(9))';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,64 @@
|
|||
/* INSERINDO O EVENTO EXTRA DIFERENCA DE TRANSFERENCIA OCD */
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate '
|
||||
INSERT
|
||||
INTO TIPO_EVENTO_EXTRA
|
||||
(
|
||||
TIPOEVENTOEXTRA_ID,
|
||||
PARAMARTICULO_ID,
|
||||
INDTIPO,
|
||||
IMPMAX,
|
||||
INDVALIDACORTE,
|
||||
INDVALIDADOCUMENTO,
|
||||
INDCONTRAPARTIDA,
|
||||
INDBOLETO,
|
||||
INDORDENSERVICIO,
|
||||
PORCIVA,
|
||||
FORMAPAGO_ID,
|
||||
USUARIO_ID,
|
||||
FECMODIF,
|
||||
ACTIVO,
|
||||
PARAMARTICULO2_ID,
|
||||
INDTIPO2,
|
||||
FORMAPAGO2_ID,
|
||||
INDOPERACION,
|
||||
DESCTIPOEVENTO,
|
||||
PROVEEDOR,
|
||||
IMPFISCALNUMOPERACAO,
|
||||
NATUREZA,
|
||||
CONTACONTABIL,
|
||||
INDCONFERENCIAFISICACOMISSAO
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
''99978'',
|
||||
NULL,
|
||||
''1'',
|
||||
''99999'',
|
||||
NULL,
|
||||
''0'',
|
||||
NULL,
|
||||
''0'',
|
||||
NULL,
|
||||
''0'',
|
||||
NULL,
|
||||
''6486'',
|
||||
to_date(''22/08/2016 14:55:00'',''DD/MM/YYYY HH24:MI:SS''),
|
||||
''0'',
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
''1'',
|
||||
''DIFERENCA DE TRANSF. OCD'',
|
||||
NULL,
|
||||
NULL,
|
||||
''RECEITA'',
|
||||
NULL,
|
||||
NULL
|
||||
)
|
||||
';
|
||||
exception when ja_existe then null;
|
||||
end;
|
|
@ -0,0 +1,15 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE FISCAL_ML2 MODIFY (DESCTIPODOC VARCHAR2(18))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE FISCAL_ML2 MODIFY (DESCTIPODOC2 VARCHAR2(18))';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE TARIFA_KM MODIFY (KMATE NUMBER(7, 2))';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE OCD_PARAM ADD (INDOCDTRANSFERENCIA NUMBER(1,0) DEFAULT 0 NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,15 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE DIAGRAMA_AUTOBUS ADD (INDTIPO NUMBER(1))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'UPDATE DIAGRAMA_AUTOBUS SET INDTIPO = INDBARCO + 1';
|
||||
exception when ja_existe then null;
|
||||
end;
|
|
@ -0,0 +1,15 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE FISCAL_IMPRESSORA ADD (INDGERAARQGT NUMBER(1))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'UPDATE FISCAL_IMPRESSORA SET INDGERAARQGT = INDCTRL';
|
||||
exception when ja_existe then null;
|
||||
end;
|
|
@ -0,0 +1,23 @@
|
|||
declare
|
||||
begin
|
||||
execute immediate 'insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID)
|
||||
values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > INTEGRACION'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.INTEGRACION'',1,SYSDATE, -1)';
|
||||
|
||||
exception when others then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
begin
|
||||
execute immediate 'insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID)
|
||||
values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > ANALITICO'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.ANALITICO'',1,SYSDATE, -1)';
|
||||
|
||||
exception when others then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
begin
|
||||
execute immediate 'insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID)
|
||||
values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > ANALITICO > BGM'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.ANALITICO.BGM'',1,SYSDATE,-1)';
|
||||
|
||||
exception when others then null;
|
||||
end;
|
|
@ -0,0 +1,24 @@
|
|||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE CLASSE_INDICE_PEAJE (
|
||||
CLASSE_INDICE_PEAJE_ID INTEGER PRIMARY KEY,
|
||||
ACTIVO NUMERIC(1),
|
||||
CLASSE_SERVICIO_ID INTEGER,
|
||||
ORGAOCONCEDENTE_ID INTEGER,
|
||||
INDICE_PEAJE INTEGER,
|
||||
FOREIGN KEY (CLASSE_SERVICIO_ID) REFERENCES CLASE_SERVICIO (CLASESERVICIO_ID),
|
||||
FOREIGN KEY (ORGAOCONCEDENTE_ID) REFERENCES ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID)
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate 'CREATE SEQUENCE "CLASSE_INDICE_PEAJE_SEQ" MINVALUE 1 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
|
@ -0,0 +1,174 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE INSCRICAO_ESTADUAL ADD (EQUIVALENCIAAG NUMBER(7))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE PUNTO_VENTA ADD (INDINTEGRADOAG NUMBER(1) DEFAULT 0)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE PUNTO_VENTA ADD (MOTIVONAOINTEGRADOAG VARCHAR2(256))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE AG_CONTAS_RECEBER (
|
||||
AGCONTASRECEBER_ID NUMBER(7) NOT NULL,
|
||||
ESTABELECIMENTO VARCHAR2(4) NOT NULL,
|
||||
CENTRORESULTADOS VARCHAR2(10),
|
||||
CLIENTE VARCHAR2(10) NOT NULL,
|
||||
FCLIENTEIDWS VARCHAR2(30),
|
||||
RECEITA VARCHAR2(250) NOT NULL,
|
||||
DOCUMENTO VARCHAR2(20),
|
||||
EMISSAO DATE NOT NULL,
|
||||
OBSERVACAO VARCHAR2(60),
|
||||
INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL,
|
||||
FECINTEGRACION DATE,
|
||||
MOTIVONAOINTEGRADO VARCHAR2(255),
|
||||
IDWS VARCHAR2(30),
|
||||
PRIMARY KEY (AGCONTASRECEBER_ID)
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE AG_SERVICOS_CTAS_RECEBER (
|
||||
AGSERVICOSCTASRECEBER_ID NUMBER(7) NOT NULL,
|
||||
AGCONTASRECEBER_ID NUMBER(7) NOT NULL,
|
||||
SERVICO VARCHAR2(4) NOT NULL,
|
||||
MODALIDADE VARCHAR2(2) NOT NULL,
|
||||
VALOR NUMBER(12,2) NOT NULL,
|
||||
INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL,
|
||||
FECINTEGRACION DATE,
|
||||
MOTIVONAOINTEGRADO VARCHAR2(255),
|
||||
PRIMARY KEY (AGSERVICOSCTASRECEBER_ID),
|
||||
CONSTRAINT FK_AG_SERVICOS_CTASRECEBER FOREIGN KEY (AGCONTASRECEBER_ID) REFERENCES AG_CONTAS_RECEBER (AGCONTASRECEBER_ID)
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE AG_VENCIMENTOSDIV_CTAS_RECEBER (
|
||||
AGVENCIMENTOSDIVCTASRECEBER_ID NUMBER(7) NOT NULL,
|
||||
AGCONTASRECEBER_ID NUMBER(7) NOT NULL,
|
||||
DATAVENCIMENTO DATE NOT NULL,
|
||||
VALOR NUMBER(12,2) NOT NULL,
|
||||
TIPODOCUMENTO VARCHAR2(3) NOT NULL,
|
||||
TITULO VARCHAR2(20),
|
||||
AGENTECOBRADOR VARCHAR2(4) NOT NULL,
|
||||
DESCONTOPREVISTO NUMBER(12,2) DEFAULT 0 NOT NULL,
|
||||
NUMBOLETO VARCHAR2(20) NOT NULL,
|
||||
INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL,
|
||||
FECINTEGRACION DATE,
|
||||
MOTIVONAOINTEGRADO VARCHAR2(255),
|
||||
PRIMARY KEY (AGVENCIMENTOSDIVCTASRECEBER_ID),
|
||||
CONSTRAINT FK_AG_VENCDIV_CTASRECEBER FOREIGN KEY (AGCONTASRECEBER_ID) REFERENCES AG_CONTAS_RECEBER (AGCONTASRECEBER_ID)
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE AG_RATEIO_CTAS_RECEBER (
|
||||
AGRATEIOCTASRECEBER_ID NUMBER(7) NOT NULL,
|
||||
AGCONTASRECEBER_ID NUMBER(7) NOT NULL,
|
||||
ESTABELECIMENTO VARCHAR2(4) NOT NULL,
|
||||
CENTRORESULTADOS VARCHAR2(10),
|
||||
RECEITA VARCHAR2(250) NOT NULL,
|
||||
VALOR NUMBER(12,2) NOT NULL,
|
||||
INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL,
|
||||
FECINTEGRACION DATE,
|
||||
MOTIVONAOINTEGRADO VARCHAR2(255),
|
||||
PRIMARY KEY (AGRATEIOCTASRECEBER_ID),
|
||||
CONSTRAINT FK_AG_RATEIO_CTASRECEBER FOREIGN KEY (AGCONTASRECEBER_ID) REFERENCES AG_CONTAS_RECEBER (AGCONTASRECEBER_ID)
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE AG_VNCTO_CARTAO_CTAS_RECEBER (
|
||||
AGVNCTOCARTAOCTASRECEBER_ID NUMBER(7) NOT NULL,
|
||||
AGCONTASRECEBER_ID NUMBER(7) NOT NULL,
|
||||
REDE VARCHAR2(20) NOT NULL,
|
||||
BANDEIRA VARCHAR2(20) NOT NULL,
|
||||
VENCIMENTO DATE NOT NULL,
|
||||
VALOR NUMBER(12,2) NOT NULL,
|
||||
INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL,
|
||||
FECINTEGRACION DATE,
|
||||
MOTIVONAOINTEGRADO VARCHAR2(255),
|
||||
PRIMARY KEY (AGVNCTOCARTAOCTASRECEBER_ID),
|
||||
CONSTRAINT FK_AG_VENCCARTAO_CTASRECEBER FOREIGN KEY (AGCONTASRECEBER_ID) REFERENCES AG_CONTAS_RECEBER (AGCONTASRECEBER_ID)
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE AG_CONTAS_PAGAR (
|
||||
AGCONTASPAGAR_ID NUMBER(7) NOT NULL,
|
||||
ESTABELECIMENTO VARCHAR2(4) NOT NULL,
|
||||
CENTRORESULTADOS VARCHAR2(10),
|
||||
FORNECEDOR VARCHAR2(6) NOT NULL,
|
||||
DESPESA VARCHAR2(10) NOT NULL,
|
||||
DOCUMENTO VARCHAR2(40),
|
||||
EMISSAO DATE NOT NULL,
|
||||
ENTRADA DATE NOT NULL,
|
||||
INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL,
|
||||
FECINTEGRACION DATE,
|
||||
MOTIVONAOINTEGRADO VARCHAR2(255),
|
||||
IDWS VARCHAR2(30),
|
||||
PRIMARY KEY (AGCONTASPAGAR_ID)
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE AG_VENCIMENTOS_CTAS_PAGAR (
|
||||
AGVENCIMENTOSCTASPAGAR_ID NUMBER(7) NOT NULL,
|
||||
AGCONTASPAGAR_ID NUMBER(7) NOT NULL,
|
||||
VENCIMENTO DATE NOT NULL,
|
||||
VALOR NUMBER(12,2) NOT NULL,
|
||||
SEQNUMPARCELA NUMBER(3) DEFAULT 1,
|
||||
TITULO VARCHAR2(20),
|
||||
PRIMARY KEY (AGVENCIMENTOSCTASPAGAR_ID),
|
||||
CONSTRAINT FK_AG_VENCPAGAR_CTASPAGAR FOREIGN KEY (AGCONTASPAGAR_ID) REFERENCES AG_CONTAS_PAGAR (AGCONTASPAGAR_ID)
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
|
@ -0,0 +1,15 @@
|
|||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'DELETE FROM CLASSE_INDICE_PEAJE';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE CLASSE_INDICE_PEAJE MODIFY (INDICE_PEAJE NUMERIC(7,2))';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'alter table PUNTO_VENTA ADD (FECFECHAMENTO DATE, FECABERTURA DATE)';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,55 @@
|
|||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE AG_ADIANTAMENTO_CLIENTE (
|
||||
AGADIANTAMENTOCLIENTE_ID NUMBER(7) NOT NULL,
|
||||
CLIENTE VARCHAR2(10) NOT NULL,
|
||||
ESTABELECIMENTO VARCHAR2(4) NOT NULL,
|
||||
CENTRORESULTADOS VARCHAR2(10),
|
||||
CONTADESPREC VARCHAR2(10) NOT NULL,
|
||||
CONTAFINANCEIRA VARCHAR2(4),
|
||||
DATA DATE NOT NULL,
|
||||
VALOR NUMBER(12,2) NOT NULL,
|
||||
IDWS VARCHAR2(30),
|
||||
INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL,
|
||||
FECINTEGRACION DATE,
|
||||
MOTIVONAOINTEGRADO VARCHAR2(255),
|
||||
PRIMARY KEY (AGADIANTAMENTOCLIENTE_ID)
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE AG_BAIXA_VENCTOCARTAO (
|
||||
AGBAIXAVENCTOCARTAO_ID NUMBER(7) NOT NULL,
|
||||
CONTARECEBER_ID VARCHAR2(11) NOT NULL,
|
||||
SEQUENCIAL NUMBER(4) DEFAULT 1 NOT NULL ,
|
||||
DATA DATE NOT NULL,
|
||||
VALOR NUMBER(12,2) NOT NULL,
|
||||
TAXA NUMBER(12,2) DEFAULT 0 NOT NULL ,
|
||||
CONTAFINANCEIRA VARCHAR2(4),
|
||||
HISTORICO VARCHAR2(80) NOT NULL,
|
||||
CONTADESPRECTAXA VARCHAR2(10) NOT NULL,
|
||||
EXPORTAAC NUMBER(7) NOT NULL,
|
||||
IDWS VARCHAR2(30),
|
||||
INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL,
|
||||
FECINTEGRACION DATE,
|
||||
MOTIVONAOINTEGRADO VARCHAR2(255),
|
||||
PRIMARY KEY (AGBAIXAVENCTOCARTAO_ID)
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE INSTI_FINANCEIRA ADD (INTEGRACIONAG VARCHAR2(4))';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,79 @@
|
|||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate 'CREATE SEQUENCE "AG_CONTAS_RECEBER_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate 'CREATE SEQUENCE "AG_SERVICOS_CTAS_RECEBER_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate 'CREATE SEQUENCE "AG_VENCDIVCTAS_RECEBER_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate 'CREATE SEQUENCE "AG_RATEIO_CTAS_RECEBER_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate 'CREATE SEQUENCE "AG_VNCTCARTAOCTAS_RECEBER_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate 'CREATE SEQUENCE "AG_CONTAS_PAGAR_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate 'CREATE SEQUENCE "AG_VENCIMENTOS_CTAS_PAGAR_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate 'CREATE SEQUENCE "AG_BAIXA_VENCTOCARTAO_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate 'CREATE SEQUENCE "AG_ADIANTAMENTO_CLIENTE_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE ESTADO ADD (CENTRORESULTADOSAG NUMBER(1))';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,15 @@
|
|||
declare
|
||||
col_count integer;
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
select count(*)
|
||||
into col_count from FORMA_PAGO
|
||||
where FORMAPAGO_ID = 35;
|
||||
|
||||
if col_count = 0 then
|
||||
execute immediate 'Insert into FORMA_PAGO (FORMAPAGO_ID,DESCPAGO,EQUIVALENCIA_ID,ACTIVO,FECMODIF,USUARIO_ID,INDOPERACION,CVEPAGO,IMPFISCAL,INDCONFERENCIAFISICACOMISSAO) values (''35'',''GERACAO OCD'',null,''1'',sysdate,''1'',null,''GO'',null,''0'')';
|
||||
end if;
|
||||
|
||||
exception when ja_existe then null;
|
||||
end;
|
|
@ -0,0 +1,31 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE EMPRESA ADD INDENVIAEMAILCOMISSAO NUMBER(1,0)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE EMPRESA ADD EMAIL_PENDENCIA VARCHAR(50)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE FECHAMENTO_CNTCORRENTE ADD INDEMAILENVIADO NUMBER(1,0)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'UPDATE FECHAMENTO_CNTCORRENTE SET INDEMAILENVIADO = 1';
|
||||
exception when ja_existe then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE INSTI_FINANCEIRA ADD (CONTAFINANCEIRAAG VARCHAR2(4))';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'INSERT INTO MOTIVO_CANCELACION(MOTIVOCANCELACION_ID,DESCMOTIVO,TIPOMOTIVO,ACTIVO,FECMODIF,USUARIO_ID,TXTRELATORIO) VALUES(99,''GERACAO OCD'',''B'',1,SYSDATE,1,''GERACAO OCD'')';
|
||||
exception when ja_existe then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE ESTACION ADD NUMPORTAPINPAD NUMBER(2,0)';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,9 @@
|
|||
declare
|
||||
begin
|
||||
execute immediate
|
||||
'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID)
|
||||
values (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''HABILITAR NOVO CLIENTE'',
|
||||
''COM.RJCONSULTORES.VENTABOLETOS.WEB.UTILERIAS.MENU.ITEM.VENTA.CLINETE.HABILITARNOVOCLIENTE'',
|
||||
''1'',to_date(''15/04/16'',''DD/MM/RR''),''1'')';
|
||||
exception when others then null;
|
||||
end;
|
|
@ -0,0 +1,8 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE CATEGORIA_DESCUENTO ADD HORARIOLIBERACAOVENDAPESSAGEM NUMBER(1,0) DEFAULT 1';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'update punto_venta set INDBLOQCANCIMPPOSTERIOR = 0 where INDBLOQCANCIMPPOSTERIOR is null';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'alter table CONVENIO_DET ADD PORCOUTROS NUMBER(5,2)';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,21 @@
|
|||
DECLARE
|
||||
type namesarray IS VARRAY(13) OF VARCHAR2(20);
|
||||
|
||||
names namesarray;
|
||||
total integer;
|
||||
existe integer;
|
||||
BEGIN
|
||||
names := namesarray('OCA', 'VISA', 'MASTERCARD', 'AMERICAN EXPRESS', 'CABAL', 'CREDITOS DIRECTOS','ANDA', 'CREDITEL', 'PASS CARD', 'DINERS', 'CLUB DEL ESTE', 'CTC', 'ASI');
|
||||
|
||||
total := names.count;
|
||||
|
||||
FOR i in 1 .. total LOOP
|
||||
select count(*) into existe from tarjeta_credito where DESCTARJETACREDITO = names(i);
|
||||
if existe = 0 then
|
||||
|
||||
INSERT INTO TARJETA_CREDITO (TARJETACREDITO_ID,DESCTARJETACREDITO,CANTMAXSINTASA,CANMAXCONTASA,TASA,ACTIVO,FECMODIF,USUARIO_ID)
|
||||
VALUES (TARJETA_CREDITO_seq.nextval,names(i),1,1,1,1,sysdate,-1);
|
||||
end if;
|
||||
END LOOP;
|
||||
END;
|
||||
/
|
|
@ -0,0 +1,13 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_CONTAS_RECEBER MODIFY (CLIENTE VARCHAR2(14))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_ADIANTAMENTO_CLIENTE MODIFY (CLIENTE NULL)';
|
||||
exception when others then null;
|
||||
end;
|
|
@ -0,0 +1,9 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'alter table ESQUEMA_CORRIDA ADD AUTOBUS_ID NUMBER(7,0)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
declare
|
||||
begin
|
||||
execute immediate
|
||||
'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID)
|
||||
values (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''ADM > COMISSAO >> TIPO INFORMATIVO'',
|
||||
''COM.RJCONSULTORES.ADMINISTRACION.GUI.COMISSAO.MENU.TIPOINFORMATIVO'',
|
||||
''1'',to_date(''15/04/16'',''DD/MM/RR''),''1'')';
|
||||
exception when others then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE TIPO_INFORMATIVO (
|
||||
TIPOINFORMATIVO_ID NUMBER(7,0) NOT NULL ENABLE,
|
||||
DESCTIPO VARCHAR2(500 BYTE),
|
||||
ACTIVO NUMBER(1,0),
|
||||
FECMODIF DATE,
|
||||
USUARIO_ID NUMBER(7,0),
|
||||
CONSTRAINT "PK_TIPOINFORMATIVO" PRIMARY KEY ("TIPOINFORMATIVO_ID"),
|
||||
CONSTRAINT "FK_TIPOINFORMATIVO_USUARIO" FOREIGN KEY ("USUARIO_ID") REFERENCES USUARIO("USUARIO_ID")
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate 'CREATE SEQUENCE TIPO_INFORMATIVO_SEQ';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE LOG_CONFERENCIA ADD TIPOINFORMATIVOCOMISSAO_ID NUMBER(7,0)';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,13 @@
|
|||
declare
|
||||
dup_val_on_index exception;
|
||||
except_02275 exception;
|
||||
|
||||
pragma exception_init (dup_val_on_index , -01430);
|
||||
pragma exception_init (except_02275 , -02275);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE LOG_CONFERENCIA ADD CONSTRAINT FK_LOGCONFERENCIA_TIPOINFOR FOREIGN KEY (TIPOINFORMATIVOCOMISSAO_ID) REFERENCES TIPO_INFORMATIVO (TIPOINFORMATIVO_ID)';
|
||||
|
||||
exception
|
||||
when dup_val_on_index then null;
|
||||
when except_02275 then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE ORGAO_CANCELACION ADD(PORCCAMBIOEMBARCADO NUMBER (5,2) DEFAULT 0)';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,15 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'alter table fiscal_ml2 add (indvendamanual NUMBER(1) DEFAULT 0)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'alter table fiscal_r4 add (indvendamanual NUMBER(1) DEFAULT 0)';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,57 @@
|
|||
/* Sequence */
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate 'CREATE SEQUENCE CONFERENCIA_PENDENCIA_SEQ INCREMENT BY 1 MAXVALUE 9999999 MINVALUE 1 CACHE 20';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
/* Create */
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE CONFERENCIA_PENDENCIA (
|
||||
CONFERENCIAPENDENCIA_ID NUMBER(7) NOT NULL,
|
||||
DESCPENDENCIA VARCHAR2(50) NULL,
|
||||
ACTIVO NUMBER(1) NULL,
|
||||
FECMODIF DATE NULL,
|
||||
USUARIO_ID NUMBER(7) NULL,
|
||||
PRIMARY KEY (CONFERENCIAPENDENCIA_ID)
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
/* Alter table */
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE LOG_CONFERENCIA ADD CONFERENCIAPENDENCIA_ID NUMBER(7) NULL';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
dup_val_on_index exception;
|
||||
except_02275 exception;
|
||||
|
||||
pragma exception_init (dup_val_on_index , -01430);
|
||||
pragma exception_init (except_02275 , -02275);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE LOG_CONFERENCIA ADD CONSTRAINT FK_LOGCONFERENCIA_CONFPEN FOREIGN KEY (CONFERENCIAPENDENCIA_ID) REFERENCES CONFERENCIA_PENDENCIA (CONFERENCIAPENDENCIA_ID)';
|
||||
|
||||
exception
|
||||
when dup_val_on_index then null;
|
||||
when except_02275 then null;
|
||||
end;
|
||||
/
|
||||
/* Insert */
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'INSERT INTO CONFERENCIA_PENDENCIA VALUES(CONFERENCIA_PENDENCIA_SEQ.NEXTVAL, ''MOVIMENTO SEM BILHETE FISICO'', 1, SYSDATE, 1)';
|
||||
exception when ja_existe then null;
|
||||
end;
|
|
@ -0,0 +1,21 @@
|
|||
declare
|
||||
begin
|
||||
execute immediate
|
||||
'update fiscal_ml2 set indvendamanual = 1 where fiscalml2_id in (
|
||||
select ml2.fiscalml2_id
|
||||
from fiscal_ml2 ml2
|
||||
join boleto b on b.boleto_id = ml2.boleto_id
|
||||
where b.tipoventa_id = 3)';
|
||||
exception when others then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
begin
|
||||
execute immediate
|
||||
'update fiscal_r4 set indvendamanual = 1 where fiscalr4_id in (
|
||||
select r4.fiscalr4_id
|
||||
from fiscal_r4 r4
|
||||
join boleto b on b.boleto_id = r4.boleto_id
|
||||
where b.tipoventa_id = 3)';
|
||||
exception when others then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE PTOVTA_EMPRESA ADD INDIMPCOMPCARTAO NUMBER(1,0) DEFAULT 1';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,15 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'alter table caja add CCF VARCHAR2(6 BYTE)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'alter table boleto add CCF VARCHAR2(6 BYTE)';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE ORGAO_CONCEDENTE ADD IDADE_IDOSO NUMBER(2,0) DEFAULT 60 NOT NULL';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,23 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE LOG_CONFERENCIA ADD INDMESMODIA NUMBER(1,0)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'INSERT INTO CONFERENCIA_PENDENCIA VALUES (CONFERENCIA_PENDENCIA_SEQ.NEXTVAL,''ENTRADA DE CORRECAO'', 1, current_date, 1)';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'INSERT INTO CONFERENCIA_PENDENCIA VALUES (CONFERENCIA_PENDENCIA_SEQ.NEXTVAL,''SAIDA DE CORRECAO'', 1, current_date, 1)';
|
||||
exception when ja_existe then null;
|
||||
end;
|
|
@ -0,0 +1,5 @@
|
|||
declare
|
||||
begin
|
||||
execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''VDA > CAIXA >> CONSULTA DE BILHETES >> TROCA TITULARIDADE'',''COM.RJCONSULTORES.VENTABOLETOS.GUI.CONSULTABOLETO.TROCATITULARIDADE'',''1'',to_date(''28-01-2015 17:15:17'',''DD-MM-YYYY HH24:MI:SS''),''1'')';
|
||||
exception when others then null;
|
||||
end;
|
|
@ -0,0 +1,8 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'alter table corte_turno modify (corteturno_id number(10,0))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'alter table punto_venta add (indusataxaconversao NUMBER(1) DEFAULT 0)';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,16 @@
|
|||
declare
|
||||
table_exists exception;
|
||||
pragma exception_init (table_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE REGION_METROPOLITANA
|
||||
(
|
||||
REGIONMETROPOLITANA_ID NUMBER(7,0) NOT NULL ENABLE,
|
||||
DESCREGION VARCHAR2(100),
|
||||
ACTIVO NUMBER(1,0),
|
||||
FECMODIF DATE,
|
||||
USUARIO_ID NUMBER(7,0),
|
||||
CONSTRAINT REGION_METROPOLITANA_PK PRIMARY KEY (REGIONMETROPOLITANA_ID)
|
||||
ENABLE)';
|
||||
exception when table_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE PARADA ADD (REGIONMETROPOLITANA_ID NUMBER(7,0))';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'alter table estacion add(indterminalmultiplo number(1,0) default 0)';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE FISCAL_IMPRESSORA ADD (NUMEROIDENTIFICACAO NUMBER(3))';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE EMPRESA_IMPOSTO ADD (ICMSIMMATRICIAL NUMBER(7,2))';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,9 @@
|
|||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate 'CREATE SEQUENCE REGION_METROPOLITANA_SEQ
|
||||
MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1
|
||||
START WITH 1 CACHE 20 NOORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_VNCTO_CARTAO_CTAS_RECEBER ADD (sequencial NUMBER(7) DEFAULT 1 NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,6 @@
|
|||
declare
|
||||
begin
|
||||
execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID)
|
||||
values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM >> CATALOGOS > REGIAO METROPOLITANA'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.REGIONMETROPOLITANA'',1,SYSDATE,1)';
|
||||
exception when others then null;
|
||||
end;
|
|
@ -0,0 +1,127 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE CLASSE_INDICE_PEAJE add (INDICE_PEAJE2 NUMBER(7,3))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'update CLASSE_INDICE_PEAJE set INDICE_PEAJE2 = INDICE_PEAJE';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'update CLASSE_INDICE_PEAJE set INDICE_PEAJE = null';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE CLASSE_INDICE_PEAJE drop column INDICE_PEAJE';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE CLASSE_INDICE_PEAJE add (INDICE_PEAJE NUMBER(7,3))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'update CLASSE_INDICE_PEAJE set INDICE_PEAJE = INDICE_PEAJE2';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'update CLASSE_INDICE_PEAJE set INDICE_PEAJE2 = null';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE CLASSE_INDICE_PEAJE drop column INDICE_PEAJE2';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE ORGAO_CONCEDENTE add (INDICE_PEAJE2 NUMBER(7,3))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'update ORGAO_CONCEDENTE set INDICE_PEAJE2 = INDICEPEAJE';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'update ORGAO_CONCEDENTE set INDICEPEAJE = null';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE ORGAO_CONCEDENTE drop column INDICEPEAJE';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE ORGAO_CONCEDENTE add (INDICEPEAJE NUMBER(7,3))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'update ORGAO_CONCEDENTE set INDICEPEAJE = INDICE_PEAJE2';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'update ORGAO_CONCEDENTE set INDICE_PEAJE2 = null';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE ORGAO_CONCEDENTE drop column INDICE_PEAJE2';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,15 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE EMPRESA_IMPOSTO ADD (CODIGOCONTABILMUNICIPAL NUMBER(15))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE EMPRESA_IMPOSTO ADD (CODIGOCONTABILESTADUAL NUMBER(15))';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'INSERT INTO AIDF_ESPECIE (AIDFESP_ID, DECESPECIE, ACTIVO, FECMODIF, USUARIO_ID) VALUES (3, ''RMD'', 1, TIMESTAMP ''2016-11-25 16:45:00'', 1)';
|
||||
exception when ja_existe then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE EMPRESA ADD (INDNAOPERMITECONFSEMMALOTE NUMBER(1,0) DEFAULT 0 NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,23 @@
|
|||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_ADIANTAMENTO_CLIENTE ADD (CLIENTECNPJCPF VARCHAR2(20))';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_ADIANTAMENTO_CLIENTE ADD (CLIENTEIDWS VARCHAR2(30))';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_ADIANTAMENTO_CLIENTE ADD (OBSERVACAO VARCHAR2(255))';
|
||||
exception when object_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE BOLETO ADD (RMD_ID NUMBER(15))';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,37 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE CONF_RESTRICAO_CANALVENTA ADD EMPRESA_ID NUMBER(7,0)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
dup_val_on_index exception;
|
||||
except_02275 exception;
|
||||
|
||||
pragma exception_init (dup_val_on_index , -01430);
|
||||
pragma exception_init (except_02275 , -02275);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE CONF_RESTRICAO_CANALVENTA ADD CONSTRAINT FK_CONF_REST_CV_EMPRESA FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA(EMPRESA_ID)';
|
||||
|
||||
exception
|
||||
when dup_val_on_index then null;
|
||||
when except_02275 then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE CONF_RESTRICAO_CANALVENTA ADD FECINICIOVIGENCIA DATE';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE CONF_RESTRICAO_CANALVENTA ADD FECFINVIGENCIA DATE';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,19 @@
|
|||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate 'CREATE SEQUENCE MOTIVO_CANCEL_VENDA_PACOTE_SEQ
|
||||
MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1
|
||||
START WITH 1 CACHE 20 NOORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE MOTIVO_CANCEL_VENDA_PACOTE
|
||||
ADD (TIPOMOTIVOCANCEL VARCHAR2(20))';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
|
@ -0,0 +1,127 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE CLASSE_INDICE_PEAJE add (INDICE_PEAJE2 NUMBER(7,4))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'update CLASSE_INDICE_PEAJE set INDICE_PEAJE2 = INDICE_PEAJE';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'update CLASSE_INDICE_PEAJE set INDICE_PEAJE = null';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE CLASSE_INDICE_PEAJE drop column INDICE_PEAJE';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE CLASSE_INDICE_PEAJE add (INDICE_PEAJE NUMBER(7,4))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'update CLASSE_INDICE_PEAJE set INDICE_PEAJE = INDICE_PEAJE2';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'update CLASSE_INDICE_PEAJE set INDICE_PEAJE2 = null';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE CLASSE_INDICE_PEAJE drop column INDICE_PEAJE2';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE ORGAO_CONCEDENTE add (INDICE_PEAJE2 NUMBER(7,4))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'update ORGAO_CONCEDENTE set INDICE_PEAJE2 = INDICEPEAJE';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'update ORGAO_CONCEDENTE set INDICEPEAJE = null';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE ORGAO_CONCEDENTE drop column INDICEPEAJE';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE ORGAO_CONCEDENTE add (INDICEPEAJE NUMBER(7,4))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'update ORGAO_CONCEDENTE set INDICEPEAJE = INDICE_PEAJE2';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
ja_existe exception;
|
||||
pragma exception_init (ja_existe , -00001);
|
||||
begin
|
||||
execute immediate 'update ORGAO_CONCEDENTE set INDICE_PEAJE2 = null';
|
||||
exception when ja_existe then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE ORGAO_CONCEDENTE drop column INDICE_PEAJE2';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE EMPRESA_IMPOSTO ADD (ICMSMATRICIAL NUMBER(7,2))';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE MOTIVO_CANCEL_VENDA_PACOTE ADD (PORCMULTA NUMBER(5,2) DEFAULT 0 NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE usuario ADD (DESCMAC VARCHAR2(25) )';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE TARIFA_VENDA_PACOTE ADD (USUARIO_CANCELAMENTO_ID NUMBER(7,0), MOTIVOCANCELVENDAPACOTE_ID NUMBER(7,0), INDCANCELADO NUMBER(1,0), DATACANCELAMENTO DATE)';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,33 @@
|
|||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE AG_DEV_ADIANTAMENTO_CLIENTE (
|
||||
AGDEVADIANTAMENTOCLIENTE_ID NUMBER(7) NOT NULL,
|
||||
CLIENTE VARCHAR2(10),
|
||||
ESTABELECIMENTO VARCHAR2(4) NOT NULL,
|
||||
CENTRORESULTADOS VARCHAR2(10),
|
||||
CONTADESPREC VARCHAR2(10) NOT NULL,
|
||||
CONTAFINANCEIRA VARCHAR2(4),
|
||||
DATA DATE NOT NULL,
|
||||
VALOR NUMBER(12,2) NOT NULL,
|
||||
IDWS VARCHAR2(30),
|
||||
INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL,
|
||||
FECINTEGRACION DATE,
|
||||
MOTIVONAOINTEGRADO VARCHAR2(500),
|
||||
CLIENTECNPJCPF VARCHAR2(20),
|
||||
CLIENTEIDWS VARCHAR2(30),
|
||||
OBSERVACAO VARCHAR2(255),
|
||||
PRIMARY KEY (AGDEVADIANTAMENTOCLIENTE_ID)
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate 'CREATE SEQUENCE "AG_DEVADIANTAMENTO_CLIENTE_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
|
@ -0,0 +1,29 @@
|
|||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE AG_DEPOSITOS_DIVERSOS (
|
||||
AGDEPOSITOSDIVERSOS_ID NUMBER(7) NOT NULL,
|
||||
DATADEPOSITO DATE NOT NULL,
|
||||
CREIDWS VARCHAR2(30) NOT NULL,
|
||||
IDWS VARCHAR2(30),
|
||||
REFERENCIABANCO VARCHAR2(200),
|
||||
SEQUENCIA NUMBER(7) DEFAULT 1,
|
||||
SEQUENCIAVENCIMENTO NUMBER(7) DEFAULT 1,
|
||||
VALOR NUMBER(12,2) NOT NULL,
|
||||
INDINTEGRADO NUMBER(1) DEFAULT 0 NOT NULL,
|
||||
FECINTEGRACION DATE,
|
||||
MOTIVONAOINTEGRADO VARCHAR2(255),
|
||||
PRIMARY KEY (AGDEPOSITOSDIVERSOS_ID)
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate 'CREATE SEQUENCE "AG_DEPOSITOS_DIVERSOS_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_CONTAS_RECEBER ADD (TIPOCONTARECEBER NUMBER(1) DEFAULT 1)';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,13 @@
|
|||
declare
|
||||
dup_val_on_index exception;
|
||||
except_01451 exception;
|
||||
|
||||
pragma exception_init (dup_val_on_index , -01430);
|
||||
pragma exception_init (except_01451 , -01451);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_VENCIMENTOSDIV_CTAS_RECEBER MODIFY (NUMBOLETO NULL)';
|
||||
|
||||
exception
|
||||
when dup_val_on_index then null;
|
||||
when except_01451 then null;
|
||||
end;
|
|
@ -0,0 +1,5 @@
|
|||
declare
|
||||
begin
|
||||
execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID) values (FUNCION_SISTEMA_SEQ.NEXTVAL,''1'',''VDA > ESTOQUE DE PASSAGENS >> TROCA DE ESTOQUE'',''COM.RJCONSULTORES.VENTABOLETOS.GUI.VENTA.MENU.ITENS.ITEMMENUTROCAFOLIO'',''1'',to_date(''02-12-2016 14:59:00'',''DD-MM-YYYY HH24:MI:SS''),''1'')';
|
||||
exception when others then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_DEV_ADIANTAMENTO_CLIENTE ADD (AGCONTASRECEBER_ID NUMBER(7))';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,175 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_ADIANTAMENTO_CLIENTE ADD (DATAINICIO DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_ADIANTAMENTO_CLIENTE ADD (DATAFIM DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_BAIXA_VENCTOCARTAO ADD (DATAINICIO DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_BAIXA_VENCTOCARTAO ADD (DATAFIM DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_CONTAS_PAGAR ADD (DATAINICIO DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_CONTAS_PAGAR ADD (DATAFIM DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_CONTAS_RECEBER ADD (DATAINICIO DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_CONTAS_RECEBER ADD (DATAFIM DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_DEPOSITOS_DIVERSOS ADD (DATAINICIO DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_DEPOSITOS_DIVERSOS ADD (DATAFIM DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_DEV_ADIANTAMENTO_CLIENTE ADD (DATAINICIO DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_DEV_ADIANTAMENTO_CLIENTE ADD (DATAFIM DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_RATEIO_CTAS_RECEBER ADD (DATAINICIO DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_RATEIO_CTAS_RECEBER ADD (DATAFIM DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_SERVICOS_CTAS_RECEBER ADD (DATAINICIO DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_SERVICOS_CTAS_RECEBER ADD (DATAFIM DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_VENCIMENTOS_CTAS_PAGAR ADD (DATAINICIO DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_VENCIMENTOS_CTAS_PAGAR ADD (DATAFIM DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_VENCIMENTOSDIV_CTAS_RECEBER ADD (DATAINICIO DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_VENCIMENTOSDIV_CTAS_RECEBER ADD (DATAFIM DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_VNCTO_CARTAO_CTAS_RECEBER ADD (DATAINICIO DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_VNCTO_CARTAO_CTAS_RECEBER ADD (DATAFIM DATE NOT NULL)';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,23 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_DEPOSITOS_DIVERSOS ADD (BANCO VARCHAR2(3))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_DEPOSITOS_DIVERSOS ADD (AGENCIA VARCHAR2(50))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE AG_DEPOSITOS_DIVERSOS ADD (CONTACORRENTE VARCHAR2(50))';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,6 @@
|
|||
declare
|
||||
begin
|
||||
execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID)
|
||||
values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM >> CONFIG COMERCIAL > MOTIVO DO CANCELAMENTO VENDA PACOTE'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.MOTIVOSDELACANCELVENDAPACOTE'',1,SYSDATE,1)';
|
||||
exception when others then null;
|
||||
end;
|
|
@ -0,0 +1,6 @@
|
|||
declare
|
||||
begin
|
||||
execute immediate 'Insert into FUNCION_SISTEMA (FUNCIONSISTEMA_ID,SISTEMA_ID,NOMBFUNCION,DESCRUTA,ACTIVO,FECMODIF,USUARIO_ID)
|
||||
values (FUNCION_SISTEMA_SEQ.NEXTVAL,1,''ADM > CATALOGOS >> EMPRESA >> RESTRINGE VENDA SE RED. Z NAO EMITIDA'',''COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.EMPRESA.RESTRIGEVENDAREDUCAOZ'',1,SYSDATE,1)';
|
||||
exception when others then null;
|
||||
end;
|
|
@ -0,0 +1,7 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'alter table consumo_boleto modify (CORTETURNO_ID number(10,0))';
|
||||
exception when column_exists then null;
|
||||
end;
|
|
@ -0,0 +1,8 @@
|
|||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'alter table boleto modify NUMASIENTOVINCULADO varchar(12)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue