Sybase iq procedure使用感想
最近经常使用到iq procedure,和pl/sql差太远了。最大的不爽是,调试信息不能在结果窗口中输出,message print都是在console窗口,要是用select,只能输出第一次的,要不就要使用resume,这在写临时存储时候,非常不方便。其次是很多便利的语句使用也有限制,如goto居然只能用在TSQL,写在临时存储过程,再用DBISQL去调度,不起作用。而且抛出异常,不能跟在select的后面,不知道iq搞什么,太不方便了。还有一点,就是没有package。这对习惯与面向编程的人来说,也是不习惯。至于其他细小的东西,也多有不便。就如别人说的那样,iq擅长的是
sybase iq中的load语句
用sybase iq作为数据仓库的存储,确实有其独特的特点和优势,但是在数据ETL的时候,如果用insert、update方式,速度太慢,大概是2秒钟左右一条数据。好在iq提供了一条load语句来解决这个问题。[@more@]load语句的格式: [code]LOAD TABLE [ owner ].table-name[ ( load-specification, ... ) ]FROM 'filename-string', ...[ FORMAT { 'ascii' | 'binary' } ]... [ DELIMITED BY string ]... [ STRIP { ON | OFF } ]... [ QUOTES { ON | OFF } ]... [ ESCAPES { ON | OFF } ][ ESCAPE CHARACTER character ] [ WITH CHECKPOINT ON|OFF ]...
2 bytes FP index convert to 3 bytes FP 引发的宕机
前几日,连续出现系统莫名宕机,几经检查每次出现宕机时候都有表FL_D_ICB_MSC_CDR_N进行DML或者DDL操作[@more@]最后经过Sybase工程师证实这是一个bug,是2 bytes FP index convert to 3 bytes FP中途异常中断而引发的error.Sybase's reply:As per conversation, from the stack trace itself, it shows to me that there is memory error when the 3 byte FP index is trying to access on this table. This give us some hints that your table is corrupted and would like to verify by sp_iqcheckdb, but finally the table is corrupt
sybase iq中的load语句4
在导入的数据中可能有些是业务系统产生的乱码,但是在抽取的时候没有处理,这时可以在load处理:数据如下:a|111|888|888b|222|2006-12-11|2007-11-13数据结构如下:CREATE TABLE TEST( A char(10), b integer, c date, d date);[@more@]可以看到第一行数据中888是错误的日期数据,我们希望把这个数据处理成日期型的NULL值。Load语句如下:LOAD TABLE test2(a '|',b '|',c '|' null('888'),d 'x0dx0a' null('888') )FROM 'c: est.txt' ESCAPES OFFQUOTES Off format ASCIIWITH CHECKPOINT ON;ref: http://gavin-wu.itpub.net/post/35205/4
[原]IQ 导出操作实例子
关于SybaseIQ导出data的例子很少,在这里分别用三种方法output出data,与大家分享.[@more@]/*select * from gz_user.bill_test;select * from gz_user.bill_test;select 1;output to /home/sybase/billliang/script/bill3.txtformat asciidelimited by '|'quote '';commit;*//*select * from gz_user.bill_test># bill2.datcommit;*/set temporary Option Temp_Extract_Append = 'ON';set temporary option temp_extract_name1 = '/home/sybase/billliang/script/bill3.txt';set temporary option temp_extract_name2 = '';set tempor
sybase iq load tabe语句5
最近在做sybase iq load数据工作,记录些心得:如果infile是固定长度和格式的文件,可以使用下面的load table方法: [@more@]truncate table gz_user.MSC_RCF;commit;load table gz_user.MSC_RCF( MD_RECORD_TYPE ascii(2),MD_IMSI ascii(15),MD_DIALLED_DIGITS ascii(24),MD_SERVICE_TYPE ascii(2),MD_SERVICE_ID ascii(4),MD_MSC_SMTMSC ascii(15),MD_CELL_ID_ORIG ascii(13),MD_MS_CLASS_MARK ascii(1),MD_START_DATE ascii(6),MD_START_TIME ascii(6),MD_CHARGEABLE_TIME ascii(6),MD_DATA_VOL ascii(6),MD_DATA_VOL_REF ascii(6),MD_PU
How to check and release lock of sysbase table
check locking: sp_iqlocks check connection: sp_iqconnection kill connection: drop connection <ConnHandle_Number>[@more@]
Not enough server threads available for this query的处理
Error:UDA-SQL-0107 A general exception has occurred during the operation "fetch". [Sybase][ODBC Driver][Sybase IQ]Not enough server threads available for this query. UDA-CUR-0000 Unable to fetch the row[@more@]Reference:http://manuals.sybase.com/onlinebooks/group-iq/iqg1250e/iqapg/@Generic__BookTextView/42350;pt=42326;lang=frFix:Sybase DBhad been config with higher server value as below and db restart completed: =============================================================IQ server sta
drop partition 引发的hang机.
当直接用alter table table_name drop partition partition_name时候.如果partition的记录太多,表过大.会有可能出现hang机.[@more@]Sybase's engineer reply:1) First , truncate the data with partition2) And then, drop the truncated partitions
大表里面删除重复记录记
今日05月份公司数据load入sybase iq数据仓库,load入后,发现含有少量重复记录。其中有一张表数据量巨大,有197,864,981条记录,而且表列有40列。使用group by 查找重复纪录不成功,应为表大,临时空间不足而退出。sql如下:[@more@]select da.* from (select count(*) as tcount , RECORD_TYPE ,IMSI,DIALLED_DIGITS,SERVICE_TYPE,SERVICE_ID ,MSC_SMTMSC ,CELL_ID_ORIG ,MS_CLASS_MARK ,CALL_START_DATE ,CALL_START_TIME ,CHARGEABLE_TIME ,DATA_VOL ,DATA_VOL_REF ,PULSES ,CALL_END_DATE ,CALL_END_TIME ,MSC_ID_TERM ,CELL_ID_T
sybase iq中的load语句2
load中注意的问题:1、load的文本文件要在iq同一台机子上2、load的时候经常出现类型转换错误,所以要注意字段类型和长度一致3、最后一个字段有空值,也会出现字符转换错误,但真正的原因是最后一个字段有空值。[@more@]对最后一个字段空值的load语句:数据:256|59|水资源费费展x00费|5903|自来水厂自来水厂保险x00船x00船x00x00|0|2006-12-01 02:15:19.0|2006-12-02 02:15:19.0257|59|水资源费费展x00费|5904|自来水厂取地自来保险x00船x00船x00x00|0|2006-12-01 02:15:19.0|2006-12-02 02:15:19.0258|59|水资源费费展x00费|5905|工业生产