SQL ÅжÏÉí·ÝÖ¤ºÅÂë
ÏÖÒªÇó²éѯ½çÃ棺²»ÂÛ15λ»òÕß18λÉí·ÝÖ¤ºÅ¶¼Äܲéѯ³öÊý¾Ý¿âÖÐËùÓе±Ç°Óû§ÐÅÏ¢¡£
·½°¸1£º
create or replace function CONVERT_ID_15 (/*ת»»Éí·ÝÖ¤ºÅΪ15λ*/
p_id2 in varchar2
) return varchar2
is
p_id varchar2(20);
id varchar2(15);
begin
p_id:=ltrim(p_id2);
p_id:=rtrim(p_id);
if length(p_id) = 18 then
id:=substr(p_id, 1, 6) || substr(p_id, 9, 9);
else
id:=substr(p_id, 1, 15);
end if;
return id;
exception
when others then
return null;
end
;
//delphi
s:=s + ' and CONVERT_ID_15(hf_id) = ''' + ConvertID15(edHf_id.Text) + '''';
·½°¸2£º
ÔÚ´úÂë¶Ë °ÑÊäÈëµÄÉí·ÝÖ¤ºÅͳһ½Ø³É15λ£¬È»ºó¸ñʽ»¯³É'430221£¥850924382£¥'
//15λÉí·ÝÖ¤ÀàËƳÉ18λ ×¢ÒâÒªÏÈת³É15λ
function hf_id18(id15:String):String;
var
id18:String;
begin
if length(id15) = 15 then
begin
id18:=copy(id15,0,6)+'%'+copy(id15,7,9)+'%';
end
else
begin
id18:= id15;
end;
result:=id18;
end;
SQL:=SQL+' AND YQ_IDCARD like ''' + CardIdNew+'''';
²éѯËÙ¶ÈÉõÖÁ±È·½°¸Ò»»¹ÉÔ¿ì¡£
Ïà¹ØÎĵµ£º
SQLÓïÑÔÓÉÃüÁî¡¢×Ӿ䡢ÔËËãºÍ¼¯ºÏº¯ÊýµÈ¹¹³É¡£ÔÚSQLÖУ¬Êý¾Ý¶¨ÒåÓïÑÔDDL£¨ÓÃÀ´½¨Á¢¼°¶¨ÒåÊý¾Ý±í¡¢×Ö¶ÎÒÔ¼°Ë÷ÒýµÈÊý¾Ý¿â½á¹¹£©°üº¬µÄÃüÁîÓÐCREATE¡¢DROP¡¢ALTER£»Êý¾Ý²Ù×ÝÓïÑÔDML£¨ÓÃÀ´ÌṩÊý¾ÝµÄ²éѯ¡¢ÅÅÐòÒÔ¼°É¸Ñ¡Êý¾ÝµÈ¹¦ÄÜ£©°üº¬µÄÃüÁîÓÐSELECT¡¢INSERT¡¢UPDATE¡¢DELETE¡£
Ò»¡¢SQLÓï¾ä
£¨1£©Select ²éѯÓï¾ä
Óï ......
ORACLE 10GµÄ¼¯ºÏAPI
¼¯ºÏAPI·½·¨×îÔçÊÇÔÚORACLE 8IÖÐÒýÈëµÄ¡£¼¯ºÏAPIÌṩÁ˼ò»¯·ÃÎʼ¯ºÏµÄ·½·¨¡£ÔÚORACLE 10GÒÔÇ°£¬ÕâЩ·½·¨È·Êµ¼ò»¯Á˶Լ¯ºÏµÄ·ÃÎÊ¡£µ«ÊÇ£¬²¢²»ÊÇ·ÇÒªÇóÕÆÎÕÕâЩ·½·¨²»¿É¡£´ÓORACLE 9IµÄINDEX-BY±íµ½ORACLE 10GµÄÁªºÏÊý×éµÄת»»£¬Ê¹ËüÃdzÉΪ±ØÐëÕÆÎյķ½·¨¡£
ÏÂÃæÊÇÎÒ´ÓÊéÉÏժ¼ÏµÄһР......
SQLÓï¾äÏÈǰдµÄʱºò£¬ºÜÈÝÒ×°ÑһЩÌØÊâµÄÓ÷¨Íü¼Ç£¬ÎÒÌØ´ËÕûÀíÁËÒ»ÏÂSQLÓï¾ä²Ù×÷£¬·½±ã×Ô¼ºÐ´SQLʱ·½±ãÒ»µã£¬ÏëÌùÉÏÀ´£¬Ò»Æð¿´¿´£¬Í¬Ê±Ï£Íû´ó¼ÒÄܹ²Í¬¶à¶àÌáÒâ¼û£¬Ò²¸øÎÒÁôһЩ¸üºÃµÄ¼Ñ¾ä£¬ÕûÀíÒ»·Ý¡¶¾«ÃîSQLËÙ²éÊֲᡷ£¬²»Áߴͽ̣¡
Ò»¡¢»ù´¡
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE database-name
2¡¢ËµÃ÷£ºÉ¾³ýÊý¾ ......
Êý¾Ý¿âÖÐÖ÷¼üºÍÍâ¼ü
(1)×÷ÓÃ
¼òµ¥ÃèÊö£º
Ö÷¼üÊǶԱíµÄÔ¼Êø£¬±£Ö¤Êý¾ÝµÄΨһÐÔ£¡
Íâ¼üÊǽ¨Á¢±íÓÚ±íÖ®¼äµÄÁªÏµ£¬·½±ã³ÌÐòµÄ±àд£¡
(2)Éè¼ÆÔÔò
Ö÷¼üºÍÍâ¼üÊǰѶà¸ö±í×é֯Ϊһ¸öÓÐЧµÄ¹ØϵÊý¾Ý¿âµÄÕ³ºÏ¼Á¡£Ö÷¼üºÍÍâ¼üµÄÉè¼Æ¶ÔÎïÀíÊý¾Ý¿âµÄÐÔÄܺͿÉÓÃÐÔ¶¼ÓÐמö¶¨ÐÔµÄÓ°Ïì¡£
±ØÐ뽫Êý¾Ý¿âÄ£Ê ......
winform주
//´æ´¢
private void MemoryImage()
{
string sql = "";
&nbs ......