You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_dtcl@tcl.apache.org by uma rani <um...@provillage.com> on 2001/02/21 03:00:07 UTC

problems regarding using libpgtcl.so for database interaction while using mod_dtcl

i have installed mod_dtcl and wants to  connect with oracle.is it possible,if yes then how 
Also
   As per your suggestion in mod_dtcl documentation for using libpgtcl.so , i have installed PostgrepSQL containig libpgtcl.so
  but i am not able to connect with database in PostgrepSQL in .ttml files,i m using pgtclsh commands in .ttml files
Then what else should be done besides this pls tell

Here is my code 

<+ 
    # datnames is the list to be result
    set conn [pg_connect test]
    set res [pg_exec $conn "SELECT * FROM test "]
    set ntups [pg_result $res -numTuples]
    for {set i 0} {$i < $ntups} {incr i} {
 lappend datnames [pg_result $res -getTuple $i]
    }
    
set res [lrange $datnames 0 2]
hputs $res

+>
 
 
invalid command name "pg_connect"

    while executing

   "pg_connect test"

    (in namespace eval "::request" script line 5)

    invoked from within

     "namespace eval request {

    buffer_add ""

      # datnames is the list to be result

  set conn [pg_connect test]

   set res [pg_exec $conn "SELECT * ..."

 





Re: problems regarding using libpgtcl.so for database interaction while using mod_dtcl

Posted by "David N. Welton" <da...@apache.org>.
"uma rani" <um...@provillage.com> writes:

> i have installed mod_dtcl and wants to  connect with oracle.is it possible,if yes then how

Yes.  Like you normally would in a Tcl script.
 
> Also

>    As per your suggestion in mod_dtcl documentation for using
> libpgtcl.so , i have installed PostgrepSQL containig libpgtcl.so  
> but i am not able to connect with database in PostgrepSQL in .ttml
> files,i m using pgtclsh commands in .ttml files

> Here is my code


> <+ 
>     # datnames is the list to be result
>     set conn [pg_connect test]
>     set res [pg_exec $conn "SELECT * FROM test "]
>     set ntups [pg_result $res -numTuples]
>     for {set i 0} {$i < $ntups} {incr i} {
>  lappend datnames [pg_result $res -getTuple $i]
>     }

> set res [lrange $datnames 0 2]
> hputs $res

Well, I don't see you loading libpgtcl.so anywhere...

-- 
David N. Welton
     Personal:           http://www.efn.org/~davidw/  
Free Software:           http://people.debian.org/~davidw/
   Apache Tcl:           http://tcl.apache.org