3 static const char *
_Cn6 =
"senscursor";
4 static const char *
_Cn5 =
"qid2";
5 static const char *
_Cn4 =
"descursor";
6 static const char *
_Cn3 =
"qid1";
7 static const char *
_Cn2 =
"idcursor";
8 static const char *
_Cn1 =
"qid0";
19 #line 1 "/opt/informix/incl/esql/sqlca.h"
101 #define SQLNOTFOUND 100
110 extern int4 * ifx_sqlcode();
111 extern struct sqlca_s * ifx_sqlca();
112 #define SQLCODE (*(ifx_sqlcode()))
113 #define SQLSTATE ((char *)(ifx_sqlstate()))
114 #define sqlca (*(ifx_sqlca()))
123 #line 103 "/opt/informix/incl/esql/sqlca.h"
125 #define STNRECSIZE 100
126 #define SENSRECSIZE 90
130 finder(
char *
name,
char *ch5,
char *plat,
char *state,
int *sqlerrcode)
153 double value, value2;
241 char id[6], pe1[2], pe2[2], dur[2], t[2], s[2], e[2], p[2];
242 char type[2], des[51], det[41];
244 char new_report[2], active[2], ok[2],
rfs[2];
246 char prod[10], prod2ary[10], obsag[7], obsloc[4], prov_avail[2];
247 char final_avail[8], ownag[7], ownloc[4], maintag[7], maintloc[4];
248 char init[9], dbsource[4];
271 char id[6], des[50], stnid1[6], stnid2[6], stnid3[6], stnid4[6], stnid5[6], stnid6[6], stnid7[6], stnid8[6], stnid9[6], stnid10[6];
272 char ped1[8], ped2[8], ped3[8], ped4[8], ped5[8], ped6[8], ped7[8], ped8[8], ped9[8], ped10[8];
273 int hour1, hour2, hour3, hour4, hour5, hour6, hour7, hour8, hour9, hour10;
289 sqli_db_open(
"fastetc", 0);
301 sqli_prep(ESQLINTVERSION, (
char *)
_Cn1,
"select * from stn where id matches ?",(ifx_literal_t *) 0, (ifx_namelist_t *) 0, 2, 0,0 );
313 sqli_curs_decl_dynm(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, (
char *)
_Cn2, 512), (
char *)
_Cn2, sqli_curs_locate(ESQLINTVERSION, (
char *)
_Cn1, 513), 0, 0);
326 sqli_prep(ESQLINTVERSION, (
char *)
_Cn3,
"select * from stn where des matches ?",(ifx_literal_t *) 0, (ifx_namelist_t *) 0, 2, 0,0 );
338 sqli_curs_decl_dynm(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, (
char *)
_Cn4, 512), (
char *)
_Cn4, sqli_curs_locate(ESQLINTVERSION, (
char *)
_Cn3, 513), 0, 0);
351 sqli_prep(ESQLINTVERSION, (
char *)
_Cn5,
"select * from sens where id = ?",(ifx_literal_t *) 0, (ifx_namelist_t *) 0, 2, 0,0 );
363 sqli_curs_decl_dynm(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, (
char *)
_Cn6, 512), (
char *)
_Cn6, sqli_curs_locate(ESQLINTVERSION, (
char *)
_Cn5, 513), 0, 0);
375 printf(
" <CR> for name or ENTER part or all of the 5 ch. id: ");
377 if(toupper(resp[0]) ==
'Q' && resp[1] ==
'\0')
break;
383 printf(
"<CR> for id or ENTER part or all of the station name: ");
387 if(resp[0]==
'\0')
goto GET_INPUT;
390 if(strstr(resp,
"*") == NULL)
393 strcat(hresp,wildcrd);
398 printf(
"searching using the token -> %s \n",hresp);
405 #line 129 "finder.ec"
407 #line 129 "finder.ec"
408 static ifx_sqlvar_t _sqibind[] =
410 { 100, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
411 #line 129 "finder.ec"
413 static ifx_sqlda_t _SD0 = { 1, _sqibind, {0}, 1, 0 };
414 #line 129 "finder.ec"
415 _sqibind[0].sqldata = hresp;
416 #line 129 "finder.ec"
417 sqli_curs_open(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, (
char *)
_Cn2, 768), &_SD0, (
char *) 0, (
struct value *) 0, 1, 0);
418 #line 129 "finder.ec"
427 #line 134 "finder.ec"
429 #line 134 "finder.ec"
430 static ifx_sqlvar_t _sqobind[] =
432 { 100, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
433 { 100, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
434 { 100, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
435 { 100, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
436 { 100, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
437 { 100, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
438 { 100, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
439 { 100, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
440 { 100, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
441 { 102,
sizeof((
stn_rec[
j]).
elev), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
442 { 100, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
443 { 100, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
444 { 100, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
445 { 100, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
446 { 102,
sizeof((
stn_rec[
j]).post), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
447 { 100, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
448 #line 134 "finder.ec"
450 static ifx_sqlda_t _SD0 = { 16, _sqobind, {0}, 16, 0 };
451 static _FetchSpec _FS1 = { 0, 1, 0 };
452 #line 134 "finder.ec"
453 _sqobind[0].sqldata = (
stn_rec[
j]).
id;
454 #line 134 "finder.ec"
455 _sqobind[1].sqldata = (
stn_rec[
j]).plat;
456 #line 134 "finder.ec"
457 _sqobind[2].sqldata = (
stn_rec[
j]).aid;
458 #line 134 "finder.ec"
459 _sqobind[3].sqldata = (
stn_rec[
j]).aid2;
460 #line 134 "finder.ec"
461 _sqobind[4].sqldata = (
stn_rec[
j]).des;
462 #line 134 "finder.ec"
463 _sqobind[5].sqldata = (
stn_rec[
j]).det;
464 #line 134 "finder.ec"
465 _sqobind[6].sqldata = (
stn_rec[
j]).init;
466 #line 134 "finder.ec"
468 #line 134 "finder.ec"
469 _sqobind[8].sqldata = (
stn_rec[
j]).lng;
470 #line 134 "finder.ec"
471 _sqobind[9].sqldata = (
char *) &(
stn_rec[
j]).elev;
472 #line 134 "finder.ec"
473 _sqobind[10].sqldata = (
stn_rec[
j]).stat;
474 #line 134 "finder.ec"
475 _sqobind[11].sqldata = (
stn_rec[
j]).huc;
476 #line 134 "finder.ec"
477 _sqobind[12].sqldata = (
stn_rec[
j]).cou;
478 #line 134 "finder.ec"
479 _sqobind[13].sqldata = (
stn_rec[
j]).zon;
480 #line 134 "finder.ec"
481 _sqobind[14].sqldata = (
char *) &(
stn_rec[
j]).post;
482 #line 134 "finder.ec"
483 _sqobind[15].sqldata = (
stn_rec[
j]).dbsource;
484 #line 134 "finder.ec"
485 sqli_curs_fetch(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, (
char *)
_Cn2, 768), (ifx_sqlda_t *) 0, &_SD0, (
char *) 0, &_FS1);
486 #line 134 "finder.ec"
492 printf(
"that produces lotsa stations... please narrow your query. <CR> to continue");
500 #line 144 "finder.ec"
502 #line 144 "finder.ec"
503 #line 144 "finder.ec"
504 sqli_curs_close(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, (
char *)
_Cn2, 768));
505 #line 144 "finder.ec"
513 #line 148 "finder.ec"
515 #line 148 "finder.ec"
516 static ifx_sqlvar_t _sqibind[] =
518 { 100, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
519 #line 148 "finder.ec"
521 static ifx_sqlda_t _SD0 = { 1, _sqibind, {0}, 1, 0 };
522 #line 148 "finder.ec"
523 _sqibind[0].sqldata = hresp;
524 #line 148 "finder.ec"
525 sqli_curs_open(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, (
char *)
_Cn4, 768), &_SD0, (
char *) 0, (
struct value *) 0, 1, 0);
526 #line 148 "finder.ec"
535 #line 153 "finder.ec"
537 #line 153 "finder.ec"
538 static ifx_sqlvar_t _sqobind[] =
540 { 100, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
541 { 100, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
542 { 100, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
543 { 100, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
544 { 100, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
545 { 100, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
546 { 100, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
547 { 100, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
548 { 100, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
549 { 102,
sizeof((
stn_rec[
j]).
elev), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
550 { 100, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
551 { 100, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
552 { 100, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
553 { 100, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
554 { 102,
sizeof((
stn_rec[
j]).post), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
555 { 100, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
556 #line 153 "finder.ec"
558 static ifx_sqlda_t _SD0 = { 16, _sqobind, {0}, 16, 0 };
559 static _FetchSpec _FS1 = { 0, 1, 0 };
560 #line 153 "finder.ec"
561 _sqobind[0].sqldata = (
stn_rec[
j]).
id;
562 #line 153 "finder.ec"
563 _sqobind[1].sqldata = (
stn_rec[
j]).plat;
564 #line 153 "finder.ec"
565 _sqobind[2].sqldata = (
stn_rec[
j]).aid;
566 #line 153 "finder.ec"
567 _sqobind[3].sqldata = (
stn_rec[
j]).aid2;
568 #line 153 "finder.ec"
569 _sqobind[4].sqldata = (
stn_rec[
j]).des;
570 #line 153 "finder.ec"
571 _sqobind[5].sqldata = (
stn_rec[
j]).det;
572 #line 153 "finder.ec"
573 _sqobind[6].sqldata = (
stn_rec[
j]).init;
574 #line 153 "finder.ec"
576 #line 153 "finder.ec"
577 _sqobind[8].sqldata = (
stn_rec[
j]).lng;
578 #line 153 "finder.ec"
579 _sqobind[9].sqldata = (
char *) &(
stn_rec[
j]).elev;
580 #line 153 "finder.ec"
581 _sqobind[10].sqldata = (
stn_rec[
j]).stat;
582 #line 153 "finder.ec"
583 _sqobind[11].sqldata = (
stn_rec[
j]).huc;
584 #line 153 "finder.ec"
585 _sqobind[12].sqldata = (
stn_rec[
j]).cou;
586 #line 153 "finder.ec"
587 _sqobind[13].sqldata = (
stn_rec[
j]).zon;
588 #line 153 "finder.ec"
589 _sqobind[14].sqldata = (
char *) &(
stn_rec[
j]).post;
590 #line 153 "finder.ec"
591 _sqobind[15].sqldata = (
stn_rec[
j]).dbsource;
592 #line 153 "finder.ec"
593 sqli_curs_fetch(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, (
char *)
_Cn4, 768), (ifx_sqlda_t *) 0, &_SD0, (
char *) 0, &_FS1);
594 #line 153 "finder.ec"
600 printf(
"that produces lotsa stations... please narrow your query <CR> to continue ");
609 #line 164 "finder.ec"
611 #line 164 "finder.ec"
612 #line 164 "finder.ec"
613 sqli_curs_close(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, (
char *)
_Cn4, 768));
614 #line 164 "finder.ec"
620 printf(
"\nENTER the station number: ");
622 if(toupper(resp[0]) ==
'Q')
break;
637 #line 183 "finder.ec"
639 #line 183 "finder.ec"
640 static ifx_sqlvar_t _sqibind[] =
642 { 100, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
643 #line 183 "finder.ec"
645 static ifx_sqlda_t _SD0 = { 1, _sqibind, {0}, 1, 0 };
646 #line 183 "finder.ec"
647 _sqibind[0].sqldata =
stn;
648 #line 183 "finder.ec"
649 sqli_curs_open(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, (
char *)
_Cn6, 768), &_SD0, (
char *) 0, (
struct value *) 0, 1, 0);
650 #line 183 "finder.ec"
659 #line 188 "finder.ec"
661 #line 188 "finder.ec"
662 static ifx_sqlvar_t _sqobind[] =
664 { 100, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
665 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
666 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
667 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
668 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
669 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
670 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
671 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
672 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
673 { 100, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
674 { 100, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
675 { 102,
sizeof((
sens_rec[
j]).post), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
676 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
677 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
678 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
679 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
680 { 102,
sizeof((
sens_rec[
j]).obstime), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
681 { 100, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
682 { 100, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
683 { 100, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
684 { 100, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
685 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
686 { 100, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
687 { 100, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
688 { 100, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
689 { 100, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
690 { 100, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
691 { 100, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
692 { 100, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
693 #line 188 "finder.ec"
695 static ifx_sqlda_t _SD0 = { 29, _sqobind, {0}, 29, 0 };
696 static _FetchSpec _FS1 = { 0, 1, 0 };
697 #line 188 "finder.ec"
699 #line 188 "finder.ec"
701 #line 188 "finder.ec"
703 #line 188 "finder.ec"
705 #line 188 "finder.ec"
707 #line 188 "finder.ec"
709 #line 188 "finder.ec"
711 #line 188 "finder.ec"
713 #line 188 "finder.ec"
714 _sqobind[8].sqldata = (
sens_rec[
j]).type;
715 #line 188 "finder.ec"
717 #line 188 "finder.ec"
718 _sqobind[10].sqldata = (
sens_rec[
j]).det;
719 #line 188 "finder.ec"
720 _sqobind[11].sqldata = (
char *) &(
sens_rec[
j]).post;
721 #line 188 "finder.ec"
722 _sqobind[12].sqldata = (
sens_rec[
j]).new_report;
723 #line 188 "finder.ec"
724 _sqobind[13].sqldata = (
sens_rec[
j]).active;
725 #line 188 "finder.ec"
727 #line 188 "finder.ec"
729 #line 188 "finder.ec"
730 _sqobind[16].sqldata = (
char *) &(
sens_rec[
j]).obstime;
731 #line 188 "finder.ec"
732 _sqobind[17].sqldata = (
sens_rec[
j]).prod;
733 #line 188 "finder.ec"
734 _sqobind[18].sqldata = (
sens_rec[
j]).prod2ary;
735 #line 188 "finder.ec"
736 _sqobind[19].sqldata = (
sens_rec[
j]).obsag;
737 #line 188 "finder.ec"
738 _sqobind[20].sqldata = (
sens_rec[
j]).obsloc;
739 #line 188 "finder.ec"
740 _sqobind[21].sqldata = (
sens_rec[
j]).prov_avail;
741 #line 188 "finder.ec"
742 _sqobind[22].sqldata = (
sens_rec[
j]).final_avail;
743 #line 188 "finder.ec"
744 _sqobind[23].sqldata = (
sens_rec[
j]).ownag;
745 #line 188 "finder.ec"
746 _sqobind[24].sqldata = (
sens_rec[
j]).ownloc;
747 #line 188 "finder.ec"
748 _sqobind[25].sqldata = (
sens_rec[
j]).maintag;
749 #line 188 "finder.ec"
750 _sqobind[26].sqldata = (
sens_rec[
j]).maintloc;
751 #line 188 "finder.ec"
752 _sqobind[27].sqldata = (
sens_rec[
j]).init;
753 #line 188 "finder.ec"
754 _sqobind[28].sqldata = (
sens_rec[
j]).dbsource;
755 #line 188 "finder.ec"
756 sqli_curs_fetch(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, (
char *)
_Cn6, 768), (ifx_sqlda_t *) 0, &_SD0, (
char *) 0, &_FS1);
757 #line 188 "finder.ec"
768 #line 195 "finder.ec"
770 #line 195 "finder.ec"
771 #line 195 "finder.ec"
772 sqli_curs_close(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, (
char *)
_Cn6, 768));
773 #line 195 "finder.ec"
778 printf(
"\nENTER the station/sensor number: ");
780 if(toupper(resp[0]) ==
'Q')
break;
800 strcpy(plat,
stn_rec[numstn].plat);
801 strcpy(state,
stn_rec[numstn].stat);
827 if(thestr[
i] !=
'\0')
828 thestr[
i] = toupper(thestr[
i]);
852 #line 271 "finder.ec"
finder(char *name, char *ch5, char *plat, char *state, int *sqlerrcode)
struct sqlca_s ifx_sqlca_t
printf("fbuf is %s\n", fbuf)
struct sqlca_s::sqlcaw_s sqlwarn