Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

My PL/SQL practice 8/2/10

SQLPlus  :http://www.orafaq.com/wiki/SQL*Plus_FAQ
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/sqloperations.htm
1. Transfer values from a sql scripts:
   CNT=`sqlplus -s username/password1@dbname @getUVQuery_NULLCNT`;
 
   Note : Remeber to use option "-s"  (-s or -silent      -- start sqlplus in silent mode. Not recommended for beginners!)
   if not use "-s" , will return something as below :
        SQL*Plus: Release 10.2.0.3.0 - Production on Tue Feb 9 11:03:08 2010
    Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    0
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
2.getUVQuery_NULLCNT.sql
        set term off
    column cnt noprint new_value total
    SELECT count(inquiry_id) cnt
      from inquire_all_current a
     WHERE FORM_COMPLETE_STATUS = 'Y'
      and ITEM_POPULATE_STATUS = 'N'
     and expand_type='uvall'
    and uv_query is null
     ORDER BY INQUIRY_ID ASC;
    set term on
    prompt &total
    exit
3. Define cursor and use cursor:
    DECLARE
    CURSOR cur IS
    SELECT inquiry_id
      from inquire_all_current a
     WHERE FORM_COMPLETE


Ïà¹ØÎĵµ£º

»ñÈ¡¾ÖÓòÍøSQL ServerʵÀýÐÅÏ¢

ÓÉÓÚ´úÂë¹ýÓÚ¼òµ¥£¬Ö±½ÓÌù³ö£º
SqlDataSourceEnumerator SseInstance = SqlDataSourceEnumerator.Instance;
//ServerName:·þÎñÆ÷Ãû;
//InstanceName:ʵÀýÃû;
//IsClustered:ÊÇ·ñΪȺ¼¯·þÎñÆ÷µÄÒ»²¿·Ö;
//Version:°æ±¾,8.*ÊÇSQL 2000,9.*ÊÇSQL 2005
DataTable DtSqlInstance = SseInstance.GetDataSources();

×¢£º ......

MS SQL 2005 32/64λÏÂÔØ

MS SQL 2005 32/64λÏÂÔØ
thunder://QUFmdHA6Ly9TaGFyZToxNjQzQHd3dy5zb293ZWIubmV0L1NoYXJlL1NlcnZlci9NaWNyb3NvZnQlMjBTUUwlMjBTZXJ2ZXIlMjAyMDA1L1NRTC4yMDA1LmFsbC5jaHMuaXNvWlo=
Microsoft SQL Server 2005 CHN 32λ CD1
ed2k://|file|%5B%E5%BE%AE%E8%BD%AFSQL%E6%9C%8D%E5%8A%A1%E5%99%A82005%E7%AE%80%E4%BD%93% ......

SQLÖÐÖ÷¼üºÍÍâ¼üµÄÇø±ð

Ö÷¼ü:
Äܹ»Î¨Ò»±íʾÊý¾Ý±íÖеÄÿ¸ö¼Ç¼µÄ¡¾×ֶΡ¿»òÕß¡¾×ֶΡ¿µÄ×éºÏ¾Í³ÆΪÖ÷Âë(Ö÷¼ü)¡£ Ò»¸öÖ÷¼üÊÇΨһʶ±ðÒ»¸ö±íµÄÿһ¼Ç¼£¬µ«ÕâÖ»ÊÇÆä×÷ÓõÄÒ»²¿·Ö£¬Ö÷¼üµÄÖ÷Òª×÷ÓÃÊǽ«¼Ç¼ºÍ´æ·ÅÔÚÆäËû±íÖеÄÊý¾Ý½øÐйØÁª¡£ÔÚÕâÒ»µãÉÏ£¬Ö÷¼üÊDz»Í¬±íÖи÷¼Ç¼֮¼äµÄ¼òµ¥Ö¸Õë¡£Ö÷¼üÔ¼Êø¾ÍÊÇÈ·¶¨±íÖеÄÿһÌõ¼Ç¼¡£Ö÷¼ü²»ÄÜÊÇ¿ÕÖµ¡£Î¨Ò ......

¹ØÓÚSQLÓï¾äCountµÄÒ»µãϸ½Ú

countÓï¾äÖ§³Ö*¡¢ÁÐÃû¡¢³£Á¿¡¢±äÁ¿,²¢ÇÒ¿ÉÒÔÓÃdistinct¹Ø¼ü×ÖÐÞÊΣ¬ ²¢ÇÒcount(ÁÐÃû)²»»áÀÛ¼ÆnullµÄ¼Ç¼¡£ÏÂÃæËæ±ãÓÃһЩÀý×Óʾ·¶Ò»ÏÂcountµÄ¹æÔò£º±ÈÈç¶ÔÈçϱí×öͳ¼Æ£¬ËùÓÐÁÐÕâÀﶼÓÃsql_variantÀàÐÍÀ´±íʾ¡£
if (object_id ('t_test' )> 0 )
    drop table t_test
go
create table t_test (a ......

·ÀÖ¹SQL×¢Èë

×î½ü¿´µ½ºÜ¶àÈ˵ÄÍøÕ¾¶¼±»×¢Èëjs,±»iframeÖ®ÀàµÄ¡£·Ç³£¶à¡£
±¾ÈËÔø½ÓÊÖ¹ýÒ»¸ö±È½Ï´óµÄÍøÕ¾£¬±»È˼ÒÈëÇÖÁË£¬ÒªÎÒÊÕÊ°²Ð¾Ö¡£¡£
1.Ê×ÏÈÎÒ»á¼ì²éһϷþÎñÆ÷ÅäÖã¬ÖØÐÂÅäÖÃÒ»´Î·þÎñÆ÷°²È«£¬¿ÉÒԲο¼
http://hi.baidu.com/zzxap/blog/item/18180000ff921516738b6564.html
2.Æä´Î£¬ÓÃÂ󿧷È×Ô¶¨Òå²ßÂÔ£¬¼´Ê¹ÍøÕ¾³ÌÐòÓЩ¶´ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ