Thread View: cn.bbs.comp.program
1 messages
1 total messages
Started by ���ܵ�Сʨ
Thu, 07 May 1998 00:00
���ORACLE DEVELOPER/2000���������ٶ�
Author: ���ܵ�Сʨ
Date: Thu, 07 May 1998 00:00
Date: Thu, 07 May 1998 00:00
132 lines
6157 bytes
6157 bytes
��������
��ΪOracle��ݿ��һ����������,Developer/2000�ṩ�˽�ǿ
��Ŀ������ܡ�����,�ڶԴ�����ݿ���м�������Ȳ���ʱ,��Derv
loper/2000ֱ�ӱ�д��PL/SQL�������Ч�ʽϵ͡�����,�����µ�Ӧ
����,��һ����Ϊtest�Ļ��,���д洢200���м�¼�������ж���
Ϊ
description char (40)
detail char (12)
��һ�����temp���ж���Ϊ:
description char(40)
detail char(12)
flag number(2)
Ӧ��Ҫ�����ӻ���м���detail��ֵ����ʼ������Ӧֵ��
ͬ�ļ�¼,������������ļ�¼������temp�С�
�����Ӧ��ʵ�ַ���Ϊ,��Developer/2000��Forms�����һ����
ť,����д���°�ť������:
Declare /*�������*/
cursor my_cur is select * from test;/*�����α�*/
pointer my_cur%rowtype; /*ѭ����ָ�롯*/
loop counter number(2);/*ѭ������*/
hit_counter number(2);/*������*/
result char (12)=`012301230123';/*����ʼ*/
Begin
for pointer in my_cur loop
hit_counter:=0;
for loop_counter in l..12 loop
if substr(result,i,l)=substr(pointer.detail,i,l)then
hit_counter:=hit_counter+1;
end if;
end loop;
if hit_counter>4 then /*��4�������ַ��������Ǻϵļ�
¼*/
insert into temp values(pointer.description,pointer.deta
il,hit_counter):
end if;
end loop;
commit_form;
End
ִ�и�Forms�����ʱ��ԼΪ5Сʱ��
һ������Oracle���ڲ�����������Ч��
��������Oracle Forms�б�д��PL/SQL�����дΪһ��Oracle��
�����,Ȼ���Oracl Forms�е��øù��,����ʱ��ֻ��Լ18���ӡ�
��������ݿ�������ϴ����ù��:
create procedure search as
cursor my_cur is select*from test;
pointer my_cur%rowtype;
loop_counter number(2);
hit_coumter number(2);
reeslt char(12):=`012301230123';
Begin
for pointer in my_cur loop
hit_counter:=0;
for loop_counter in 1..12 loop
if substr(result,i,l)=substr(pointer.dtail,i,l)then
hit_counter:-hit)counter+1;
end if;
end loop;
if hit_counter>4 then
hit_counter:13-hit_counter;
insert into temp
valuse(pointer.description,pointer.detail,hit_counter);
end if;
end loop;
commit;
End;
Ȼ��Forms�е�ԭ��������д����:
Begin
search;
End;
�����и�F orms,Լ18����Ӧ��ִ�����,�����ٶ������15��
��
��������C�������������
��Ӧ����ݽ�����ݿ�֮ǰ��������C���Զ�Ӧ���ļ����д���
����������,����Orc le����SQL * Loader��Proc*C���ļ��е���
��װ����ݿ��?����:��������test����е���ݶ�Ӧ���ļ�ΪC
:\test.txt,temp����Ӧ���ļ�ΪC:\temp.txt�������C�������e
sttxt�ļ�,�������������ļ�д��temp.txt�ļ��С�C����ɱ�д��
��:
void main(void)
{char buf[200];
char*description,*detail;
statec char rdsult]={"012301230123"};
int loop)counter,hit)counter;
FILE *reading,*writing;
if ((reading=fopen("c:\test.txt","r"))==null)
{printf("c:\test.txt open error.\");
getch();
return;
}if((writing=fopen("c:\temp.txt","r"))==null)
{printf("c:\temp.txt opern error.\n")
getch();
return;
}
do
{hit_counter=0;
fgets(but,sizeof(buf),reading);
if(strlen*buf)!=53
bread;
description=buf;
detail=description+41;
description[30]=`\0'
deetail[12]=`0';
for(loop)counter=0;loop_counter<12;loop)counter++)
{if(detail[i]==fesult[i])
hit_counter++;
}
if(hit_counter>4
fprintf(writing,"%-30s\t\%s\n",description,detail):
}
while(feof(reading)==0);
fclose(writting);
fclose(reading);
return;
}
��C���������200������¼��test.txt�ļ�ֻ�費��1���ӡ�
��Oracle Forms�������OLE����6������������������,��
����Oracle SQL*Loader��Pro*C���߽�text.x t��temp.txt�ļ��е�
���װ����ݿ��Ӧ�Ļ���С�
����ע:�ڶ��ַ����ƺ������һ��,����ϤOracle Developer/2
000Ӧ�ÿ����Ķ��߶Դ˷������,�������õķ�����
--
________ _____ _____ ______________ _____
___ __ \___(_)________ ___(_) __ ___/___ /_ ___(_)
__ /_/ /__ / ___ __ \__ / _____ \ __ __ \__ /
_ ____/ _ / __ /_/ /_ / ____/ / _ / / /_ /
/_/ /_/ _ .___/ /_/ /____/ /_/ /_/ /_/
/_/
[m[1;36m�� ��Դ:���ϴ�С�ٺ���Ϣ����վ bbs.nju.edu.cn��[FROM: hsia.nju.edu.cn][m
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads