Making HTML from Tables
Building DayCart Interfaces with Perl, OCI and XML |
Several ways of acquiring and presenting DayCart data is discussed. Perl is easy to program and OCI makes quick connections. XML abstracts the presentation layer from the acquisition layer.
Methods
CGI Code:
SERVER_PROTOCOL=HTTP/1.0
REMOTE_ADDR=192.168.1.33
REQUEST_METHOD=POST
export REQUEST_METHOD SERVER_PROTOCOL REMOTE_ADDR
cat <<__EOF__ | ./acd.xml
POST /oracgi/mick/acd.xml HTTP/1.0
Content-length: 25
insmi=CCO%0aCCCO
query=0.8
__EOF__
Bourne Shell Code:
#!/bin/sh
. ./dcgi_env.sh
eval `./post4eval`
echo "Content-type: text/html"
echo ""
(./acd_startup) 2>&1
Interfaces
Comments
Perl
Perl with XML
OCI
OCI Code:
OCIHandleAlloc(envhp,(void**)&stmthp,OCI_HTYPE_STMT,0,(void*)0);
OCIStmtPrepare(stmthp,errhp, (unsigned char *)buffer, (int)strlen(buffer), OCI_NTV_SYNTAX,OCI_DEFAULT);
OCIDefineByPos(stmthp, &(defnp[i]), errhp, (ub4)i + 1, (dvoid *)data[i], (sb4)MAX_VARCHAR, (ub2)SQLT_STR, (dvoid *)&(ind[i]), (ub2 *)0, (ub2 *)0, (ub4)OCI_DEFAULT));
OCIStmtExecute(svchp, stmthp, errhp, 0, 0, (void*)0, (void*)0,OCI_DEFAULT);
OCIStmtFetch(stmthp,errhp,1,OCI_FETCH_NEXT,OCI_DEFAULT);