pro*c ÀïÔõô½«select µÄ·µ»ØÄÚÈݸ³Öµ¸ø±äÁ¿
pro*c ÀïÔõô½«select µÄ·µ»ØÄÚÈݸ³Öµ¸ø±äÁ¿
EXEC SQL BEGIN DECLARE SECTION;
char CALLNO[30];
EXEC SQL END DECLARE SECTION;
EXEC SQL SELECT CALLNO INTO :CALLNO from out_call;
EXEC SQL COMMIT WORK RELEASE;
printf("CALLNO = %s\n intCALLNO = %d\n",CALLNO,intCALLNO);
´òÓ¡½á¹ûΪ¿Õ£¬ÊÇΪɶ£¿
Õâ¸ö²éѯÊÇÒ»¸ö½á¹û»¹ÊǶà¸ö½á¹û,Èç¹û¶à¸ö½á¹ûÇëʹÓÃÓαê,Èç¹ûÒ»¸ö½á¹ûÕâ¾ä»°Ã»Ê²Ã´ÎÊÌâ.
1.Êä³öΪһ¸ö½á¹ûµÄ
exec sql begin declare section;
CS_CHAR id[6];
CS_SMALLINT indic;
CS_CHAR pub_name[41];
exec sql end declare section;
exec sql select pub_id into :id indicator :indic
from titles where title
like "%Stress%";
if (indic == -1)
{
printf("\npub_id is null");
}
else
{
exec sql select pub_name into :pub_name
from publishers where pub_id = :id;
printf("\nPublisher: %s", pub_name);
}
2Êä³öΪ¶à¸ö½á¹ûµÄ
EXEC SQL DECLARE C1 CURSOR FOR
SELECT id, name, dept, job, years, salary, comm from staff;
EXEC SQL OPEN c1;
while (SQLCODE == 0)
{
EXEC SQL FETCH c1 INTO :id, :name, :dept, :job, :years, :salary, :comm;
if (SQLCODE == 0)
printf("%4d %12s %10d %10s %2d %8d %8d",
id, name, dept, job
Ïà¹ØÎÊ´ð£º
ÇëÎÊVFPÖÐÈçºÎµ÷ÓÃC/C++º¯Êý£¿
ÄãÒªµ÷ÓÃʲô¹¦Äܵĺ¯Êý£¿Òª¿´¿´VFPÖÐÓÐûÓжÔÓ¦µÄº¯Êý£¬Èç¹ûÓоÍÊ¡×ÅÔÙµ÷ÓÃÁË¡£Èç¹ûûÓУ¬¿ÉÒÔ½«C/C++º¯Êýд¸öDLL»òFLL£¬È»ºóÔÚVFPµ÷Óü´¿É¡£
Ê®¶¹Èý ÀÏʦ£¬Ôõô²ÅÄÜÐÞ¸Ä×Ô¼ºµÄ ......
±¾ÈËÕýÔÚÓÃJava×öÒ»¸öC/S¼Ü¹¹µÄÏîÄ¿£¬
¿ÉÊÇÓÉÓÚÏîÄ¿±È½Ï´ó£¬Ç°ÆڶԼܹ¹µÄÉè¼ÆÓÈÆäÖØÒª£¬ÒòΪºóÆÚ¿ÉÄÜËæʱ»á¼Ó¸ö¹¦ÄÜ»òÕßÈ¥µôijЩ¹¦ÄÜ¡£
ËùÒÔÌصØÑ°ÇóÈçºÎÉè¼ÆC/SµÄ¼Ü¹¹Ê¹³ÌÐò¸ü¼ÓÃæÏò¶ÔÏó¸ü¼ÓÒ×ÓÚά ......
ÔÚ¸ùĿ¼/libÖдæ·ÅÒ»¸ölog.c£¬log.h£¬²¢ÓÃÏÂÃæµÄÓï¾ä£º
gcc -c log.c
ar crv liblog.a log.o
±àÒë³öÒ»¸öliblog.a¾²Ì¬¿â£¬È»ºóÔÚÎļþ¼Ð£º/testfileÖд´½¨Ò»¸ötest.cºÍtestc.c£¬test.cÖÐÒýÓÃÁËtestc.cÖж¨ÒåµÄ·½·¨ ......
A±í ÓÐÁ½¸ö×Ö¶Î
id ΨһÊý×ÖÓò
InfoTxt text ÀàÐÍ
ÎÒÏÖÔÚÒª°Ñ id ²»ÊÇ14 µÄËùÓÐ InfoTxt×ֶΠÎı¾ºóÃæ ¶¼¼ÓÉÏ 'aaa'
°´ÏÂÃæÖ´ÐÐÏÂÀ´ Ö»Óбí×îºóÒ»ÐмÓÉÏÁË 'aaa' ......
ÎÒˮƽºÜ²Ë£¬ÌáÎʵĹÀ¼ÆÒ²ºÜ¸ãЦ£¬ºÇºÇ£¬¸ßÊÖ¼ûÁ¡£
ÎÒÔÚ´úÂëÀïÃæÌí¼ÓÁËÒ»¸ö.cÎļþA£¬ÀïÃæÓÐÒ»¸öº¯Êýf£¬È»ºóÎÒÔÚÁíÍâÒ»¸ö.cÎļþBÖе÷Óô˺¯Êýf£¬µ«ÊÇ£¬BÎļþÖв¢Ã»Óаüº¬¶Ôº¯ÊýfµÄÉùÃ÷£¬Ò²¾ÍÊÇ˵ûÓаüº¬ÎļþAµÄ.h£ ......