You are in Home page » Products » Opensource » WebGUI » SQLExt WebGUI Macro

Soluzione integrata di telefonia su internet a banda larga.
Search on this site:  

Are you interested to be updated about all things happens to me day by day?
Visit my new blog

SQLExt.pm - A macro to execute SQL statements to external database.

Current version: 00.00.02/2004-05-26

This macro extends SQL.pm macro to execute query to an external database. You can also execute not-returning query like delete, insert and update.

It's forward compatible with SQL macro, so you can write something like this

^SQLExt("select count(*) from users","There are ^0; users on this system.");

 

But you can also write something like this

^SQLExt("select * from table1","^0;-^1;","external_database","db_username","db_password","remote_host");

 

If you have defined some databaseLink, you can use them too like this:

^SQLExt("select * from table1","^0;-^1;",1000)

 

where 1000 is the databaseLinkId.

The complete syntax of this macro is:

^SQLExt($sql_statement,[$format],[$databaseLink])

 

or

^SQLExt($sql_statement,[$format],$db_name,$db_user,$db_pass,[$db_host])

 

where

  • $sql_statement: is a standard SQL query to execute
  • $format: is the format for output result
  • $databaseLink: is the id of the databaseLink to use
  • $db_name: is the database name where to execute query
  • $db_user: is the username with permission to execute query
  • $db_pass: is the password related to username
  • $db_host: is the remote host where the database is located. If omitted, "localhost" is assumed.

To install it copy SQLExt-xx.yy.zz.pm into lib/WebGUI/Macro/SQLExt.pm. Then open WebGUI.conf and append

    SQLExt => SQLExt

 

at the end of the macro section. If, as an example, last line is

    u => u_companyUrl

 

replace this with

    u => u_companyUrl, \
      SQLExt => SQLExt
JavaScript Menu Courtesy of Milonic.com







 Copyright© 1997-2006 Emiliano Bruni Online from 16/08/1998 with visitors Write me to: