SQL实现分解带分隔符的字符串实验
SQL> var v_str varchar2(100);
SQL> exec :v_str:=',id1,id11,id101,';
PL/SQL procedure successfully completed.
SQL> select :v_str a,replace(:v_str,',','') b
2 ,substr(:v_str,instr(:v_str,',',1,rownum)+1,
3 instr(:v_str,',',1,rownum+1)-instr(:v_str,',',1,rownum)-1) c
4 from dual
5 connect by rownum<length(:v_str)-length(replace(:v_str,',',''));
A B C
-------------------------------- -------------------------------- --------------------------------
,id1,id11,id101, id1id11id101 id1
,id1,id11,id101, id1id11id101 id11
,id1,id11,id101, id1id11id101 id101
相关文档:
来源:http://hi.baidu.com/czgblog/blog/item/3abd5aa911d51ff51f17a292.html
function OnFirstUIAfter()
STRING szTitle, szMsg1, szMsg2, szOpt1, szOpt2;
NUMBER bvOpt1, bvOpt2;
NUMBER bShowUpdateServiceDlg;
......
使用VB把Excel导入到Sql数据库中,其实有几种方法。
下面我介绍的这种方法,较为简单。
其实这种方法的话,是直接使用T-SQL操作的,因此,到了VB里面,直接eccute这个代码就OK了的。
-----------------------------------------------------下面是在T-sql中的语句
if object_id('NewTable') is not null/*判断表NewTabl ......
一、SQL拼写建议 1、查询时不返回不需要的行、列 业务代码要根据实际情况尽量减少对表的访问行数,最小化结果集,在查询时,不要过多地使用通配符如:select * from table1语句,要用到几列就选择几列,如:select col1,col2 from table1;在可能的情况下尽量限制结果集行数如:se ......
----查看所有角本
Create table #y (txt text)
select name, iid = identity(int,1,1) into #x from SysObjects where xtype = 'TR'
declare @i int, @max int
declare @name varchar(40)
set @i = 1
select @max = max(iid) from #x
while @i <= @max
begin
select @name = name from #x w ......
随着B/S模式应用开发的发展,使用这种模式编写应用程序的程序员也越来越多。但是由于程序员的水平及经验也参差不齐,相当大一部分程序员在编写代码的时候,没有对用户输入数据的合法性进行判断,使应用程序存在安全隐患。用户可以提交一段数据库查询代码,根据程序返回的结果,获得某些他想得知的数据,这就是所谓的SQL Inj ......