ddl

View Creation using DDL trigger

狂风中的少年 提交于 2020-01-06 13:53:54
问题 I am looking back at Oracle (11g) development after few years for my team project and need help. We are trying to implement a POC where any add/drop column will drop and recreate a corrosponding view. View refers to a Mapping table for producing its alias names and selection of columns. My solutions : --1. DDL Trigger that scans for Add Column, Drop Column -> Identifies Column Names -> Updates Field_Map table -> Drops View -> Creates View with Field_Map table alias names Challenge: Received

Cannot view object schema Azure Datawarehouse

拟墨画扇 提交于 2020-01-06 05:29:10
问题 Attempting to view the a view or procedure : from SQL Server Management Studio 17.4 in Azure SQL Datawarehouse notes the error: I can however, delete and create any object that I want. How can I work to ensure I can view the objects definition? UPDATED Concerning setting the options in SSMS to SQL Datawarehouse, there is not that option: 回答1: Please change this setting under Tools... Options. That should resolve the error. I wish we didn't have to change this but at lease we have a workaround

plsql get table in 'before alter' trigger

巧了我就是萌 提交于 2020-01-05 05:37:31
问题 I have a table ident, and I also have a table ident_hist, which just keeps a log from the table ident. The table ident gets altered a lot, so I want to add the new columns to ident_hist dynamically as well. I have created a procedure which does that: create or replace procedure prc_create_hist_tabel(p_naam_hist_tabel in varchar2, p_naam_tabel in varchar2) is cursor c is select 'alter table ' || p_naam_hist_tabel || ' add ' || column_name || ' ' || data_type || case when data_type = 'DATE'

Hive常规操作-Hive DDL操作

爱⌒轻易说出口 提交于 2020-01-04 18:23:34
Database 查看数据库 0: jdbc:hive2://CentOS:10000 > show databases ; +----------------+--+ | database_name | +----------------+--+ | default | | test | +----------------+--+ 2 rows selected ( 0.441 seconds ) 使用数据库 0: jdbc:hive2://CentOS:10000 > use test ; No rows affected ( 0.03 seconds ) 新建数据库 CREATE (DATABASE|SCHEMA) [IF NOT EXISTS] database_name --DATABASE|SCHEMA 是等价的 [COMMENT database_comment] --数据库注释 [LOCATION hdfs_path] --存储在 HDFS 上的位置 [WITH DBPROPERTIES (property_name=property_value, ...)]; --指定额外属性 CREATE DATABASE IF NOT EXISTS hive_test COMMENT 'database for test' WITH DBPROPERTIES (

Does Mybatis support DDL?

假装没事ソ 提交于 2020-01-04 04:35:29
问题 My project is a Database center, like PLSQL but used in a web browser. Sometimes I need to create or alter a table, but I don't know if Mybatis supports DDL, and I haven't found any documents about this. 回答1: For the most part DDL works just like DML using mybatis. The one difference is that you will need to use ${} instead of #{} for parameters. Most databases do not support prepared statements with DDL. The $ notation is a string substitution rather than a parameter for a prepared statement

SQL Server parallels to Oracle DBMS_METADATA.GET_DDL?

橙三吉。 提交于 2020-01-03 17:12:19
问题 I'm looking for command line or scripted solutions to pull the DDL out of SQL Server 2005+ for all database objects: tables, stored procs, views, indices/indexes, constraints, etc. GUI tools are not of interest. Preference is for built-in tools, since that would be the most comparable to Oracle's DBMS_METADATA stuff. Also, preference for a solution that is as simple as Oracle's for getting the DDL out - eg, a one liner: SELECT DBMS_METADATA.GET_DDL('TABLE', 'MY_TABLE') FROM DUAL Note: Getting

Oracle SQL statement dynamic schema variable

青春壹個敷衍的年華 提交于 2020-01-02 08:32:53
问题 I have some hundred lines of code to create tables but schema name is hardcoded like SCHEMA_NAME1.TABLE_NAME in all DDL statements. How can I have this as a variable and use in all the places so that we can easily change in a single place for multiple locations of SCHEMA_NAME requirement.Please give your thoughts. create table SCHEMA_NAME1.TABLE_NAME1(....); create table SCHEMA_NAME1.TABLE_NAME2(....); create table SCHEMA_NAME1.TABLE_NAME3(....); I want something like this var SCHEMA_NAME

Oracle SQL statement dynamic schema variable

扶醉桌前 提交于 2020-01-02 08:31:26
问题 I have some hundred lines of code to create tables but schema name is hardcoded like SCHEMA_NAME1.TABLE_NAME in all DDL statements. How can I have this as a variable and use in all the places so that we can easily change in a single place for multiple locations of SCHEMA_NAME requirement.Please give your thoughts. create table SCHEMA_NAME1.TABLE_NAME1(....); create table SCHEMA_NAME1.TABLE_NAME2(....); create table SCHEMA_NAME1.TABLE_NAME3(....); I want something like this var SCHEMA_NAME

Get VIEW ddl using query

∥☆過路亽.° 提交于 2020-01-02 02:41:07
问题 For database re-architecture I need to get DDL of each table and view in the database(Oracle). I don't want to go to property of each table/view and get SQL out of it in SQL Developer. I successfully got DDL for table using- select dbms_metadata.get_ddl('TABLE','Table_name','Schema_Name') from dual; But facing problem with VIEW and MVIEW. Could anyone provide commands/keywords for elements other than table. Also, I want to export the result in an excel file with first column as TableName and

In MySQL, with FKs what's “CONSTRAINT” do?

☆樱花仙子☆ 提交于 2020-01-01 09:59:09
问题 I've looked at the MySQL 5.1 docs, and still can't figured this out -- that being I noticed a difference between the code I input into MySQL and output code by the system. What is the difference between the code sample 01 and 02, meaning 02 has added CONSTRAINT before FOREIGN KEY -- why, and what's it do? CODE_SAMPLE_01: FOREIGN KEY (TABLE_02_nID_FK__TABLE_01_sID_PK) REFERENCES TABLE_01(TABLE_01_sID_PK), CONTEXT: CREATE TABLE `TABLE_02` ( `TABLE_02_sID_PK` int(8) NOT NULL, `TABLE_02_nID_FK_