) BEGIN 5 SET @S='' 8 BEGIN -@I) 10 BEGIN SET @S=@S+' ' END ELSE 14 BEGIN SET @S=@S+'**' 16 END END SET @S =@S+'*' 20 PRINT @S END 结果: ) BEGIN SET @S='' BEGIN -@I) BEGIN SET @S=@S+' ' END ELSE BEGIN SET @S=@S+'**' END END SET @S =@S+'*' PRINT @S END
declare @i int ,@j int ,@s nvarchar(max) set @i = 1 while @i <=9 begin set @s = ' ' set @j = 1 while @j <=@i begin set @s += cast(@j as char(1)) + '*' + cast(@i as char(1)) set @s += ' ' set @j +=1 end print @s set @i += 1 end declare @i int ,@j int
最近一直在使用cakephp这个框架学习,最近发现了一些问题,就是怎样将SQL语句打印出来进行调试,方法如下: $db=ConnectionManager::getDataSource('default'); $db->showLog(); 可以举一个例子来进行说明: public function abc(){ $this->layout="default"; $userData=$this->User-find('all'); //Below code to ru
kettle job中的JavaScript如何获取同一个job中SQL步骤的执行语句并让执行语句记录在日志中呢?首先写日志需要用到job中JavaScript写日志的方法,其次是利用java反射机制获取执行的sql. 如: var sqlObj = getJobStep("SQL"); var sql = sqlObj.environmentSubstitute(sqlObj.getSQL()); var logWriter = org.pentaho.di.core.logging