Re: [PHP-DEV] Re: OCI extension - OCIQuery() ?

2002-10-18 Thread Thies C. Arntzen
On Thu, Oct 17, 2002 at 01:36:26PM +0200, Maxim Maletsky wrote:
 
 Thies C. Arntzen [EMAIL PROTECTED] wrote... :
 
   Hope to see someone to anser, commenting my thoughts on this. I am very 
   much willing contributing to the PHP's Oracle support development. 
  
  that always appreciated. wher do you want to start?
  tc
 
 
 Thies, what do you thik of adding an OCIQuery function?
 
 e.g: 
 
 ?php
 
   $query   = SELECT to_char(sysdate) FROM dual;
 
   // this:
   $stmt= OCIParse($conn, $query);
   $result  = OCIExecute($stmt, OCI_DEFAULT);
 
 
   // can be this:
   $result  = OCIQuery($conn, $query, OCI_DEFAULT);
 
 ?
 
 It could be a nice shortcut for those who use this combo always together
 and, plus, it would be a very elementary thing to implement.
 
 What do you think of it?
 
 I could start from this one, to warm up :) It's been I while I thought
 OCIQuery() could have been implemented.

i don't really think it's a needed function as it won't
support binding of variables and setting the execute mode.
also writing:

$s = ociparse($d, ...); ociexecute($s);

is short enough for most things.

also, cause you loose the statement handle you cannot reuse
it. so adding ociquery will make things less optimal.

re,
tc

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: OCI extension - OCIQuery() ?

2002-10-18 Thread Maxim Maletsky

Thies C. Arntzen [EMAIL PROTECTED] wrote... :

 i don't really think it's a needed function as it won't
 support binding of variables and setting the execute mode.

True, you cannot use it for binding variables. Only these who often do
plain queries would find it useful. 

 also, cause you loose the statement handle you cannot reuse
 it. so adding ociquery will make things less optimal.

Oh yeah? I thought you don't: Statement handle is returned by OCIParse.
Now, if OCIParse is contained within OCIQuery we can still return the
Statement on success or False on failure. Just the way both functions
behave internally.

I agree that OCIQuery would not be a big feature, but could be useful. At
the end, I think some sort of *query() function for Oracle will be needed
in order to look closer to the way other DBs behave.  It might be
something like ora_do(), but ora_do() is also fetching and that is not
very optimal since one still needs to loop through fetched result set,
why doubling the loops?

Just my thoughts.

--
Maxim Maletsky
[EMAIL PROTECTED]


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: OCI extension - OCIQuery() ?

2002-10-17 Thread Maxim Maletsky


Thies C. Arntzen [EMAIL PROTECTED] wrote... :

  Hope to see someone to anser, commenting my thoughts on this. I am very 
  much willing contributing to the PHP's Oracle support development. 
 
 that always appreciated. wher do you want to start?
 tc


Thies, what do you thik of adding an OCIQuery function?

e.g: 

?php

$query   = SELECT to_char(sysdate) FROM dual;

// this:
$stmt= OCIParse($conn, $query);
$result  = OCIExecute($stmt, OCI_DEFAULT);


// can be this:
$result  = OCIQuery($conn, $query, OCI_DEFAULT);

?

It could be a nice shortcut for those who use this combo always together
and, plus, it would be a very elementary thing to implement.

What do you think of it?

I could start from this one, to warm up :) It's been I while I thought
OCIQuery() could have been implemented.


--
Maxim Maletsky
[EMAIL PROTECTED]



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: OCI extension - OCIQuery() ?

2002-10-17 Thread Maxim Maletsky

Thies C. Arntzen [EMAIL PROTECTED] wrote... :

 i don't really think it's a needed function as it won't
 support binding of variables and setting the execute mode.

I just noticed that MSSQL has also a very similar case.  You have
mssql_query() for the queries and mssql_init(), mssql_bind(),
mssql_execute() for stored procs. The difference seems to be that the
queries in MSSQL cannot be binded, while in OCI they can.

-- 
Maxim Maletsky
[EMAIL PROTECTED]

www.PHPBeginner.com  // where PHP Begins


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php