通过SAS fastload Mysql table 到 Teradata
/*clear fastload tables*/
%let gdw_dir =( user="XXXXX" password="XXXXX" database="XXXXX" tdpid="XXXXX");
proc sql;
connect to teradata as TD &gdw_dir;
execute (drop table STG_MYSQL_lkp_verticals)
by TD;
execute (commit) by TD;
disconnect from TD;
quit;
proc sql;
connect to teradata as TD &gdw_dir;
execute (drop table append_err1)
by TD;
execute (commit) by TD;
disconnect from TD;
quit;
proc sql;
connect to teradata as TD &gdw_dir;
execute (drop table append_err2)
by TD;
execute (commit) by TD;
disconnect from TD;
quit;
proc sql;
connect to teradata as TD &gdw_dir;
execute
(
create table STG_MYSQL_lkp_verticals
(
vertical varchar(10),
category_id integer,
category_name varchar(70),
short_name varchar(70)
)primary index(vertical,category_id)
)
by TD;
execute (commit) by TD;
disconnect from TD;
quit;
/*create source data table*/
libname bu_data mysql user='XXXXX' password='XXXXX' database='XXXXX' server='XXXXX' port=XXXX;
proc sql;
create table work.lkp_verticals as
select vertical, category_id, category_name, short_name
from bu_data.lkp_verticals
;
quit;
libname TDPET teradata databASe=XXXXX user="XXXXX" pASsword="XXXXX" TDPID="XXXXX";
proc append data=work.lkp_verticals base=TDPET.STG_MYSQL_lkp_verticals
(bulkload=yes bl_log=append_err);
run;
相关文档:
转自http://www.linuxbyte.org/yi-ge-mysql-server-shang-de-xiao-ji-qiao.html
在my.cnf 的 mysql 端 添加如下设置
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
prompt="(\u:mysql1@linuxbyte.org \R:\m)[\d]: "
会产生如下效果:
root@ubuntu:/home/hew# mysql -u hew -p
Enter pass ......
Doing INTERSECT and MINUS in MySQL
By Carsten | October 3, 2005
Doing an INTERSECT
An INTERSECT is simply an inner join where we compare the tuples of one table with those of the other, and select those that appear in both while weeding out duplicates. So
SELECT member_id, name from a
INTERSECT ......
一、MySQL安装:
添加系统用户:
groupadd mysql (/usr/sbin/groupadd)
useradd -g mysql mysql
安装步骤:
tar zxfv mysql-*.tar.gz(mysql-5.0.51a)
./configure --prefix=/usr/local/mysql
make
make install
cp support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql
bin/mysql_install_db --user ......
今天用JPA生成数据表,虽然在Entity上已经配置好了一对多和多对一的关系,总是奇怪不能生成外键索引。
后来发现是MySQL的 storage engine 的问题。
默认的MyISAM是不支持外键的。
只有改成 InnoDB才支持外键
修改方法,找到 my.ini
在里面添加或修改(如果有的话)
default-storage-engine = InnoDB
附:
MyISAM和 ......
安装JDBC驱动:
解压缩mysql-connector-java-3.1.10.zip
将要使用的是mysql-connector-java-3.1.10-bin-g.jar和mysql-connector-java-3.1.10-bin.jar
配置
在C:\Program Files\Java目录下建立mysqlforjdbc子目录,进入该目录将mysql-connector-java-3.1.10-bin.jar到该目录下
进入C:\Program Files\Java\jdk1.5.0_04\l ......