pl/sql±¨ora 12154£ºTNS:ÎÞ·¨½âÎöÖ¸¶¨µÄÁ¬½Ó·ûÎÊÌâ
½â¾ö·½·¨Ò»
ÔÚoraDb10g_home->ÅäÖúÍÒÆÖ²¹¤¾ß->net Manager
ÔÚ±¾µØÖÐн¨Ò»¸ö·þÎñÃüÃû
Õâ¸öÍøÂç·þÎñÃû¾ÍÊǵǽʱµÄÊý¾Ý¿âÃû
Íê³ÉÕâЩ²Ù×÷ºó£¬Ñ¡Ôñ²Ëµ¥ÖÐÎļþ->±£´æÍøÂçÅäÖþÍokÁË¡£
½â¾ö·½·¨¶þ
´ò¿ª°²×°Ä¿Â¼Ï·þÎñÆ÷¶ËµÄtnsnames.ora£¬±ÈÈçÎÒµÄÍêÕûĿ¼ÊÇE:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\tnsnames.ora£¬Ìí¼Ó
ORCL_100.0.0.509 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 100.0.0.50)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = orcl)
(SERVER = DEDICATED)
)
)
Ïà¹ØÎĵµ£º
--´¦ÀíʾÀý
--ʾÀýÊý¾Ý
create table tb(ID int,Name varchar(10),ParentID int)
insert tb select 1,'AAAA' ,0
union all select 2,'BBBB' ,0
union all select 3,'CCCC' ,0
union all select 4,'AAAA-1' ,1
union all select 5,'AAAA-2' ,1
u ......
#include "iostream.h"
#include "stdio.h"
#import "C:\program files\common files\system\ado\msado15.dll" no_namespace rename("EOF","adoEOF")
int main(int argc, char* argv[])
{
::CoInitialize(NULL);
_ConnectionPtr m_pConnection;
m_pConnection.CreateInstance("ADODB.Connection");
tr ......
Case¾ßÓÐÁ½ÖÖ¸ñʽ¡£¼òµ¥Caseº¯ÊýºÍCaseËÑË÷º¯Êý¡£
--¼òµ¥Caseº¯Êý
CASE sex
WHEN '1' THEN 'ÄÐ'
WHEN '2' THEN 'Å®'
ELSE 'ÆäËû' END
--CaseËÑË÷º¯Êý
CASE WHEN sex = '1' THEN 'ÄÐ'
&nbs ......
Sql ServerÖеÄÈÕÆÚÓëʱ¼äº¯Êý
1. µ±Ç°ÏµÍ³ÈÕÆÚ¡¢Ê±¼ä
select getdate()
2. dateadd ÔÚÏòÖ¸¶¨ÈÕÆÚ¼ÓÉÏÒ»¶Îʱ¼äµÄ»ù´¡ÉÏ£¬·µ»ØÐ嵀 datetime Öµ
ÀýÈ磺ÏòÈÕÆÚ¼ÓÉÏ2Ìì
select dateadd(day,2,'2004-10-15') --·µ»Ø£º2004-10-17 00:00:00.000
3. datediff ·µ»Ø¿çÁ½¸öÖ ......