PB Êý¾Ý¿âÁ¬½ÓÒÔ¼°sqlÓï¾äÔËÐÐÐÅÏ¢·µ»Ø´úÂë½âÊÍ´óÈ«
Èç¹ûÒ»¸ö SQL Óï¾ä·¢ÉúÁË´íÎó£¬ÄÇô sqlca.sqlcode ½«ÊÇ·ÇÁãÖµ¡£
Èç¹û sqlca.sqlcode СÓÚ 0 ÄÇô¾ÍÊÇ·¢ÉúÁËijÖÖÑÏÖصĴíÎó£¬ÏóÊý¾Ý¿â¶¨ÒåÓë²éѯ¶¨Òå²»Ò»Öµȣ®
Èç¹û´óÓÚ 0 ÔòÊÇͨ³£µÄ´íÎó£¬Ïó±í²»°üÀ¨ËùÒªÇóµÄÐеȣ®
sqlca.sqlcode == 0£¬³É¹¦
sqlca.sqlcode == -1 ʧ°Ü £¨»ñÈ¡¾ßÌåʧ°ÜÐÅÏ¢£ºmessagebox('',"³ö´íÐÅÏ¢:"+sqlca.SQLErrText) £©--PBÀïµÄ²Ù×÷·½·¨
sqlca.sqlcode == 100, Data not found line %d.
ÕâÊÇÒ»¸ö"Õý³£µÄ"´íÎ󣬸æËßÄãÄãÕýÔÚ²éѯµÄ¶«Î÷ÕÒ²»µ½»òÕßÎÒÃÇÒѾԽ¹ýÁËÓαêµÄ·¶Î§¡£££Èç²éѯ²»µ½Ïà¹ØÐÅÏ¢µÈ
¿ÉÄÜ·¢ÉúµÄ´íÎóÁÐ±í£º
-12, Out of memory in line %d.
ͨ³£²»³öÏÖÕâ¸ö´íÎó¡£ÕâÊÇÄãµÄÐéÄâÄÚ´æºÄ¾¡µÄ±êÖ¾¡£
-200, Unsupported type %s on line %d.
ͨ³£²»³öÏÖÕâ¸ö´íÎó£®Õâ±íÃ÷Ô¤±àÒëÆ÷Éú³ÉÁËһЩ¿â£¨º¯Êý£©²»ÈϵõĶ«Î÷£®¿ÉÄÜÄãÔËÐеÄÔ¤±àÒëÆ÷ºÍµ±Ç°¿â²»¼æÈÝ£®
-201, Too many arguments line %d.
ÕâÒâζ×Å Postgres ·µ»ØÁ˱ÈÎÒÃǵÄÆ¥Åä±äÁ¿¸ü¶àµÄ²ÎÊý£®¿ÉÄÜÄã©Á˼¸¸öINTO :var1,:var2-ÁбíÀïµÄËÞÖ÷±äÁ¿£®
-202, Too few arguments line %d.
ÕâÒâζ×Å Postgres ·µ»ØÁ˱ÈÎÒÃǵĶÔÓ¦ËÞÖ÷±äÁ¿ÒªÉٵIJÎÊý£®¿ÉÄÜÄã¶àÊäÈëÁ˼¸¸öINTO :var1,:var2-ÁбíÀïµÄËÞÖ÷±äÁ¿£®
-203, Too many matches line %d.
×ÅÒâζ×Ųéѯ·µ»ØÁ˶à¸öÐУ¬µ«ÄãÉùÃ÷µÄ±äÁ¿²»ÊÇÊý×飮ÄãÖ´ÐÐµÄ SELECT ¿ÉÄܲ»ÊÇΨһµÄ£®
-204, Not correctly formatted int type: %s line %d.
×ÅÒâζ×ÅËÞÖ÷±äÁ¿ÊÇÒ»¸ö int ÀàÐͲ¢ÇÒ Postgres Êý¾Ý¿âÀïµÄ×Ö¶ÎÊÇÁíÒ»ÖÖÀàÐÍ£¬°üº¬×ÅÒ»¸ö²»ÄÜת»»³ÉÒ»¸ö int ÀàÐ͵ÄÊýÖµ£®¿â£¨º¯Êý£©Ê¹Óà strtol ×ö´ËÀàת»»£®
-205, Not correctly formatted unsigned type: %s line %d.
×ÅÒâζ×ÅËÞÖ÷±äÁ¿ÊÇÒ»¸ö unsigned int£¨ÎÞ·ûºÅÕûÊý£©ÀàÐͶøPostgres Êý¾Ý¿âÀïµÄ×Ö¶ÎÊÇÁíÍâÒ»ÖÖÀàÐͲ¢ÇÒ°üº¬Ò»¸ö²»ÄÜת»»³Éunsigned int µÄÊýÖµ£®¿â£¨º¯Êý£©Ê¹Óà strtoul ×öÕâÀàת»»£®
-206, Not correctly formatted floating point type: %s line %d.
×ÅÒâζ×ÅËÞÖ÷±äÁ¿ÊÇÒ»¸ö float £¨¸¡µã£©ÀàÐͶø Postgres Êý¾Ý¿âÀïµÄ×Ö¶ÎÊÇÁíÍâÒ»ÖÖÀàÐͲ¢ÇÒ°üº¬Ò»¸ö²»ÄÜת»»³É float µÄÊýÖµ£®¿â£¨º¯Êý£©Ê¹Óà strtod ×öÕâÀàת»»£®
-207, Unable to convert %s to bool on line %d.
ÕâÒâζ×ÅËÞÖ÷±äÁ¿ÊÇÒ»¸ö bool £¨²¼¶û£©ÀàÐÍ£¬¶ø Postgres Êý¾Ý¿âÀïµÄ×Ö¶ÎÖµ¼È²»ÊÇ 't' Ò²²»ÊÇ 'f'¡£
-208, Empty query l
Ïà¹ØÎĵµ£º
Sql Server ÖÐÒ»¸ö·Ç³£Ç¿´óµÄÈÕÆÚ¸ñʽ»¯º¯Êý
Select CONVERT(varchar(100), GETDATE(), 0): 05 16 2006 10:57AM
Select CONVERT(varchar(100), GETDATE(), 1): 05/16/06
Select CONVERT(varchar(100), GETDATE(), 2): 06.05.16
Select CONVERT(varchar(100), GETDATE(), 3): 16/05/06
Select CONVE ......
update anketo1 set fb = substring('10',fb+1,1) WHERE id =5
ºóÀ´ÎÊÁËBM,BM˵ֱ½ÓÈ¡·´
update anketo1 set fb = ~ fb WHERE id =5
ÎÒ¸æËßÁËBMÓÃsubstringÒ²¿ÉÒÔ.
BM˵:"Õâ¼Ò»ïÀ÷º¦£¬ÕâÒ²ÄÜÏë³ö,ÕâÊôÓÚаÃÅÎ书."
×îºóÓÖÏëµ½ÓÃABSÈ¡¾ø¶ÔÖµÒ²¿ÉÒÔ
update anketo1 set fb = abs(fb-1)
ÎÒ¾õµÃ²»¹ÜÊÇʲôÎ书,ÄÜÖ ......
ÔÚPostgreSQL8.1.3ÉÏ¿ÉÒÔwork
1. È¡Êý¾Ý¿â´óС
SELECT pg_size_pretty(pg_database_size('somedatabase')) As fulldbsize
2. È¡±í´óС
SELECT pg_size_pretty(pg_total_relation_size('someschema.sometable')) As fulltblsize, pg_size_pretty(pg_relation_size('someschema.sometable')) As justthetblsize
ÔÌù£º
......
SQL SERVER ºÍEXCELµÄÊý¾Ýµ¼Èëµ¼³ö
1¡¢ÔÚSQL SERVERÀï²éѯExcelÊý¾Ý:
-- ======================================================
SELECT *
from OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\book1.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...[Sheet1$]
ÏÂÃæÊǸö²éÑ ......
select case when c.colid=1 then object_name(c.id) else '' end as ±íÃû
,c.name as ×Ö¶ÎÃû
,t.name Êý¾ÝÀàÐÍ
,c.prec as ³¤¶È ......