 
 USING: alien alien.c-types alien.strings combinators kernel math
 namespaces oracle.liboci prettyprint sequences
-io.encodings.ascii ;
+io.encodings.ascii accessors ;
 
 IN: oracle
 

! =========================================================

: attach-to-server ( -- )
    srv get err get con get connection-db dup length OCI_DEFAULT
    OCIServerAttach check-result ;

: set-service-attribute ( -- )
    svc get OCI_HTYPE_SVCCTX srv get 0 OCI_ATTR_SERVER err get OCIAttrSet check-result ;

: set-username-attribute ( -- )
    ses get OCI_HTYPE_SESSION con get connection-username dup length swap ascii malloc-string swap 
    OCI_ATTR_USERNAME err get OCIAttrSet check-result ;

: set-password-attribute ( -- )
    ses get OCI_HTYPE_SESSION con get connection-password dup length swap ascii malloc-string swap 
    OCI_ATTR_PASSWORD err get OCIAttrSet check-result ;

: set-attributes ( -- )


: oci-log-on ( -- )
    env get err get svc get 
    con get username>> dup length swap ascii malloc-string swap 
    con get password>> dup length swap ascii malloc-string swap
    con get db>> dup length swap ascii malloc-string swap
    OCILogon check-result ;

! =========================================================
