My application runs fine from the development environment but GPF's in the EXE. What do I do?
There is a little-known command line option you can add when you run your executable which will produce a trace of each line of code executed by your EXE. Simply place '/pbdebug' (no quotes) on the command line and PowerBuilder will generate a file called <appname>.dbg containing a trace of each line of code executed.
This file will grow in size very quickly, so it is best to go straight to the area causing the problem to prevent too large a trace file being created.
Generally the last line of code the trace file shows executing is the one just prior to the GPF. At this point you at least have a place to start looking for your problem. From there it's just basic debugging techniques.
When creating a machine code executable, ensure you select the checkbox labeled 'Trace Information' if you are planning on using the '/pbdebug' switch.
[2.17] What is the best way to organize my library list?
Some people will say 'place your most frequently used objects at the top of the list.' That is generally good advice, but you really need to understand how PowerBuilder handles class definitions at run time to use it effectively.
Using the above advice, you might think all your ancestors should go at the top of the list. Just the opposite is true. If all windows are inherited from one base class, once the frame has been opened, that class definition is in the pool. At that point there is no benefit to having it listed near the top of the search path and, in fact, increases the number of PBD's through which PowerBuilder must search to find your concrete classes.
Also, another seemingly unknown fact is that once PowerBuilder has found a class it caches that class's location. This is per run-time session of course. So, if PB needs to open w_customer, the first time it searches the PBD's, the second time it goes straight to the PBD containing the class because it knows from the previous time where to find it. Therefore, once any ancestor class has been referenced, even if it's no longer in the pool, PowerBuilder knows its location.
一、自关联查询方法
Oracle系统中,对于所有的表都存在一个唯一的列,这就是rowid。对该列使用最大(max)或者最小(min)函数可以非常容易地确定重复的行。
select rowid,codename,old,new
from code_ref a
where a.rowid>
(select min(b.rowid)
from cod_ref b where b.codename = a.codename and b.old = a.old)
;
二、GROUP BY/HAVING查询方法
利用分组函数GROUP BY/HAVING也很容易确定重复的行。以需要创建唯一索引的列分组并统计每组的个数,很明显如果组中记录数超过1个就存在重复的行。
select count(*) , codename,old
from code_ref
group by codename,old
having count(*) > 1;
查两个日期间的工作日
select count(*)
from ( select rownum-1 rnum
from all_objects
where rownum <= to_date('2002-02-28','yyyy-mm-dd') - to_date('2002-02-01','yyyy-mm-dd')+1 )
where to_char( to_date('2002-02-01','yyyy-mm-dd')+rnum-1, 'D' ) not
in (
'1', '7' )
/
想得到按日期的月累计销售量,即
日期 月销售量
2003-04-01 100
2003-04-02 220
2003-04-03 335
2003-04-04 442
请问用SQL语句该如何写?
//////////////////////////////////////////
select to_char(a.sale_date,'yyyy-mm-dd'), sum(b.sale_num)
from yourtable a, yourtable b
where b.sale_date <= a.sale_date
group by a.sale_date
03 001 10 30
03 002 10 30
03 003 10 10
//////////////shahand///////////////////////////////////////////////
select a.row_no, a.class_no,
sum(b.price_no)
from test_table a ,test_table b
where b.row_no <= a.row_no
and b.class_no = a.class_no
group by a.row_no, a.class_no
;