Re: [AOLSERVER] SQL placeholders

2008-04-03 Thread Jade Rubick
You can probably just steal the db code from OpenACS.

Jade

On Wed, Apr 2, 2008 at 1:44 PM, Andrew Piskorski [EMAIL PROTECTED] wrote:

 On Wed, Apr 02, 2008 at 02:39:57PM +0100, Xavier Bourguignon wrote:
  Ok, so how do I get this OpenACS db_* AP to work?

 You would have to install OpenACS:  http://openacs.org/

 However, if you are currently using AOLserver stand alone, that's
 probabably not what you want to do, not just in order to use its db
 API anyway (even though it is very nice).

 You may also find these old discussions of interest:

  http://openacs.org/forums/message-view?message_id=206909
  http://openacs.org/forums/message-view?message_id=195785
  http://openacs.org/forums/message-view?message_id=85687

 --
 Andrew Piskorski [EMAIL PROTECTED]
 http://www.piskorski.com/


 --
 AOLserver - http://www.aolserver.com/

 To Remove yourself from this list, simply send an email to 
 [EMAIL PROTECTED] with the
 body of SIGNOFF AOLSERVER in the email message. You can leave the
 Subject: field of your email blank.




-- 
Jade Rubick
Acting Chief Technology Officer
United eWay
[EMAIL PROTECTED]
tel (503)285-4963
fax (707)671-1333

www.UNITEDeWAY.org


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] SQL placeholders

2008-04-03 Thread Xavier Bourguignon
Hi all,

I just want to thank you for the information provided, very useful.

On 03/04/2008, Jade Rubick [EMAIL PROTECTED] wrote:
 You can probably just steal the db code from OpenACS.

 Jade


 On Wed, Apr 2, 2008 at 1:44 PM, Andrew Piskorski [EMAIL PROTECTED] wrote:

 
  On Wed, Apr 02, 2008 at 02:39:57PM +0100, Xavier Bourguignon wrote:
   Ok, so how do I get this OpenACS db_* AP to work?
 
  You would have to install OpenACS:  http://openacs.org/
 
  However, if you are currently using AOLserver stand alone, that's
  probabably not what you want to do, not just in order to use its db
  API anyway (even though it is very nice).
 
  You may also find these old discussions of interest:
 
   http://openacs.org/forums/message-view?message_id=206909
   http://openacs.org/forums/message-view?message_id=195785
   http://openacs.org/forums/message-view?message_id=85687
 
  --
 
 
 
  Andrew Piskorski [EMAIL PROTECTED]
  http://www.piskorski.com/
 
 
  --
  AOLserver - http://www.aolserver.com/
 
  To Remove yourself from this list, simply send an email to
 [EMAIL PROTECTED] with the
  body of SIGNOFF AOLSERVER in the email message. You can leave the
 Subject: field of your email blank.
 



 --
 Jade Rubick
 Acting Chief Technology Officer
 United eWay
 [EMAIL PROTECTED]
 tel (503)285-4963
  fax (707)671-1333

 www.UNITEDeWAY.org



 --
 AOLserver - http://www.aolserver.com/



 To Remove yourself from this list, simply send an email to
 [EMAIL PROTECTED] with the
 body of SIGNOFF AOLSERVER in the email message. You can leave the Subject:
 field of your email blank.






-- 
Xavier Bourguignon


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


[AOLSERVER] SQL placeholders

2008-04-02 Thread Xavier Bourguignon
Hi All,

Is it possible to have an SQL statement pre-written in a Tcl variable like this:

set adminop_sql {select * from tadminop where status = ?}

Then call this [ns_db select $db $adminop_sql 'A'], basically, is it
possible to pass values for SQL to use in place of the (?) ?

Thanks

-- 
Xavier Bourguignon


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] SQL placeholders

2008-04-02 Thread Andrew Piskorski
On Wed, Apr 02, 2008 at 10:18:11AM +0100, Xavier Bourguignon wrote:

 set adminop_sql {select * from tadminop where status = ?}
 
 Then call this [ns_db select $db $adminop_sql 'A'], basically, is it
 possible to pass values for SQL to use in place of the (?) ?

What you're talking about is called a bind variable.  The Oracle
driver (nsoracle) supports them, the PostgreSQL one (last I checked)
emulates them.  The OpenACS db_* API (which is built on top of ns_db)
makes using bind variables easily, and OpenACS uses them extensively.

If I remember right, the AOLserver ns_db API itself does not include
any bind variable support, it is an extension offered by some
AOLserver database drivers and not by others.  That's probably a
historical accident, it would be better, and should be feasible, for
ns_db to include bind variable support for all databases.

-- 
Andrew Piskorski [EMAIL PROTECTED]
http://www.piskorski.com/


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] SQL placeholders

2008-04-02 Thread Xavier Bourguignon
Ok, so how do I get this OpenACS db_* AP to work?

Do I have to add something is my config file?

How do I make the calls, is there some doc somewhere about this?

Thank you

On 02/04/2008, Andrew Piskorski [EMAIL PROTECTED] wrote:
 On Wed, Apr 02, 2008 at 10:18:11AM +0100, Xavier Bourguignon wrote:

   set adminop_sql {select * from tadminop where status = ?}
  
   Then call this [ns_db select $db $adminop_sql 'A'], basically, is it
   possible to pass values for SQL to use in place of the (?) ?


 What you're talking about is called a bind variable.  The Oracle
  driver (nsoracle) supports them, the PostgreSQL one (last I checked)
  emulates them.  The OpenACS db_* API (which is built on top of ns_db)
  makes using bind variables easily, and OpenACS uses them extensively.

  If I remember right, the AOLserver ns_db API itself does not include
  any bind variable support, it is an extension offered by some
  AOLserver database drivers and not by others.  That's probably a
  historical accident, it would be better, and should be feasible, for
  ns_db to include bind variable support for all databases.

  --
  Andrew Piskorski [EMAIL PROTECTED]
  http://www.piskorski.com/



  --
  AOLserver - http://www.aolserver.com/

  To Remove yourself from this list, simply send an email to [EMAIL 
 PROTECTED] with the
  body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
 field of your email blank.



-- 
Xavier Bourguignon


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.


Re: [AOLSERVER] SQL placeholders

2008-04-02 Thread Andrew Piskorski
On Wed, Apr 02, 2008 at 02:39:57PM +0100, Xavier Bourguignon wrote:
 Ok, so how do I get this OpenACS db_* AP to work?

You would have to install OpenACS:  http://openacs.org/

However, if you are currently using AOLserver stand alone, that's
probabably not what you want to do, not just in order to use its db
API anyway (even though it is very nice).

You may also find these old discussions of interest:

  http://openacs.org/forums/message-view?message_id=206909
  http://openacs.org/forums/message-view?message_id=195785
  http://openacs.org/forums/message-view?message_id=85687

-- 
Andrew Piskorski [EMAIL PROTECTED]
http://www.piskorski.com/


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] 
with the
body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: 
field of your email blank.