[PHP-DB] Oracle/PHP question...

2002-12-17 Thread Anthony Carlos
Yes, you need to recompile PHP: ./configure --with-oci8=[your_oracle_home]

-Original Message-
From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 16, 2002 1:58 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP-DB] Oracle/PHP question...


I am now trying to setup connectivity to a remote Oracle database
for my PHP/Apache web server.  I am attempting to verify connectivity to the
database by:

?php
$connection = OCILogon(user, password) or die (Unable to logon to
database.);
?

I have installed the Oracle client on the system, and I have also
setup the ORACLE_HOME and ORACLE_SID environment variables.  Unfortunately
at this point I am not even able to make a successful connection to the
Oracle database.  I am currently receiving the following error:

Fatal error: Call to undefined function: ocilogon() in /www/DW/oratest.php
on line 10

Do I need to recompile PHP to be Oracle aware or something?  What is
it I am missing at this point?  Thanks in advance.
Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com


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




Re: [PHP-DB] Oracle problem

2002-10-16 Thread Anthony Carlos

Perhaps it would be easier to use bind variables instead. For example,

$empno = 1234;
$ename = O'Reilly;

$conn = OCILogon('scott', 'tiger');
$sql = 'INSERT INTO emp (empno, ename) VALUES (:empno, :ename)';
$stmt = OCIParse($conn, $sql);
OCIBindByName(':empno', $empno, -1);
OCIBindByName(':ename', $ename, -1);
OCIExecute($stmt);

Check out Thies' presentation:
http://conf.php.net/pres/index.php?p=slides%2Fociid=oci2

If you have questions, let us know.

-Anthony

 From: Ford, Mike   [LSS] [EMAIL PROTECTED]
 Date: Wed, 16 Oct 2002 12:14:58 +0100
 To: '[EMAIL PROTECTED]' [EMAIL PROTECTED],  [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] Oracle problem
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: 16 October 2002 08:51
 To: [EMAIL PROTECTED]
 
 Has anyone out there using PHP and Oracle come across this
 problem?  I have
 a text area that allows free-form text that I store in a
 varchar2 column.  I
 have problems with apostrophes in the free-form text.
 
 Uh-oh!  Standard can of worms no. 3!
 
 When 
 users put in an
 apostrophe the SQL fails.  If I force 3 apostrophes (the
 
 Shouldn't that be *two* apostrophes?  That's how it works here, anyway!
 
 usual Oracle method
 of embedding apostrophes) the SQL fails.  The only way to get
 round the
 problem is to strip them out (which I consider a work-around
 not a fix).
 
 You may also want to investigate the php.ini settings magic_quotes_gpc,
 magic_quotes_runtime and magic_quotes_sybase -- although personally I prefer
 not to use these as I'm averse to magic (well, other people's, anyway!).
 
 Cheers!
 
 Mike
 
 -
 Mike Ford,  Electronic Information Services Adviser,
 Learning Support Services, Learning  Information Services,
 JG125, James Graham Building, Leeds Metropolitan University,
 Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
 Email: [EMAIL PROTECTED]
 Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211
 


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




[PHP-DB] Updating a CLOB-- OCI_INVALID_HANDLE

2002-07-15 Thread Anthony Carlos

Hello,

Has anyone come across difficulty updating a CLOB in Oracle? I have been
able to follow the documentation to insert a new clob by first inserting an
EMPTY_CLOB() into the row, and then calling the save method of the
OCINewDescriptor/CLOB locator:

$conn = OCILogon(username, password, connect_string);
$clob_loc = OCINewDescriptor($conn, OCI_D_LOB);
$sql = INSERT INTO emp (empno, name, life_story) VALUES (emp_seq.NEXTVAL,
:name, EMPTY(CLOB)) RETURNING life_story INTO :clob_loc;
$stmt = OCIParse($conn, $sql);
OCIBindByName($stmt, :name, $name, -1);
OCIBindByName($stmt, :life_story, $clob_loc, -1, OCI_B_CLOB);
OCIExecute($stmt, OCI_DEFAULT);
$clob_loc-save($new_life_story);

However, attempts to SELECT life_story INTO :clob_loc FROM emp WHERE empno
= 123 FOR UPDATE have failed. Similarly, UPDATE emp SET name = 'NEW_NAME'
WHERE empno = 123 RETURNING life_story INTO :clob_loc have also failed. The
error message is the same:

Warning: OCILobWrite: OCI_INVALID_HANDLE in /home/acarlos/update.php on line
16.

However, if I update the row and set the CLOB column to anything new
(including EMPTY_CLOB()), no error occurs.

When it fails, I've checked the class of the OCINewDescriptor and it is
indeed an object with 6 class methods (as it should be).

Has anyone run into this? Is this a bug in PHP's implementation of OCI?

Also, is there a limit to the amount of data that can be stored in the CLOB
using this method? My uploads have been truncated to a little less than 32K.
And I thought using a CLOB was supposed to give me access to 4GB...

Thanks for any insight!

Anthony Carlos


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




Re: [PHP-DB] Oracle client on linux

2002-01-25 Thread Anthony Carlos

There's a bunch of requirements that have to be met in order for the
software installer to work. In case you're installing onto a remote machine,
do you have XWindows running on your Linux machine? Does your terminal
program support XWindows?

 From: aiQa [EMAIL PROTECTED]
 Date: Fri, 25 Jan 2002 14:03:54 +0200
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Oracle client on linux
 
 Hi,
 ..and Has anyone installed oracle 8i client on linux? When I start
 ./runInstaller, It says that it installs x.jde and hangs.
 
 Thanks,
 aiQa
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Oracle Database procedures

2002-01-25 Thread Anthony Carlos

Sridhar,

Take a look at this documentation from Thies Arntzen. It's required reading
for anyone using Oracle and PHP! I hope it gets you started. If not, ask for
more help!

Good luck,

Anthony Carlos

PS: It shows how to bind PHP variables to Oracle variables...

 From: Sridhar Moparthy [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Fri, 25 Jan 2002 09:03:21 -0500
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Oracle Database procedures
 
 Hi All,
 
 Could you please help me on how to call Oracle stored procedures from
 PHP4.X. Also how to get the returned data in PHP from Oracle stored
 procedure?
 
 Thanks In advance.
 Sridhar Moparthy.
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Oracle Database procedures

2002-01-25 Thread Anthony Carlos

Sridhar,

Sorry, it's available at:

http://conf.php.net/pres/index.php?p=slides%2Fociid=oci2

Good luck!

--Anthony

 From: Anthony Carlos [EMAIL PROTECTED]
 Date: Fri, 25 Jan 2002 09:50:26 -0500
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Oracle Database procedures
 
 Sridhar,
 
 Take a look at this documentation from Thies Arntzen. It's required reading
 for anyone using Oracle and PHP! I hope it gets you started. If not, ask for
 more help!
 
 Good luck,
 
 Anthony Carlos
 
 PS: It shows how to bind PHP variables to Oracle variables...
 
 From: Sridhar Moparthy [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Fri, 25 Jan 2002 09:03:21 -0500
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Oracle Database procedures
 
 Hi All,
 
 Could you please help me on how to call Oracle stored procedures from
 PHP4.X. Also how to get the returned data in PHP from Oracle stored
 procedure?
 
 Thanks In advance.
 Sridhar Moparthy.
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Re: Unable to Open ORACLE

2001-12-03 Thread Anthony Carlos

John:

Yes, CLOBs are a little more difficult to access. The best way I've used
them is to use the DBMS_LOB package in Oracle. Here's a link on
technet.oracle.com to some documentation.

http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/appdev.
817/a76940/adl03pr4.htm#146661

I suggest using this with stored procedures and bind variables. php.net has
more info on using stored procedures bind variables.

Good luck,

Anthony Carlos

 From: John Kolvereid [EMAIL PROTECTED]
 Date: Mon, 03 Dec 2001 22:17:44 -0800
 To: [EMAIL PROTECTED], John Kolvereid [EMAIL PROTECTED]
 Subject: [PHP-DB] Re: Unable to Open ORACLE
 
 Hi,
 Me again,  My table has a CLOB in it.  When I tried the same querry w/
 another table w/o a CLOB it succeeded.  Are CLOBs an issue?  Please
 advise.  Thanks.
 
 John Kolvereid wrote:
 
 Hi,
 I tried the following snippet from
 http://www.php.net/manual/en/ref.oracle.php
 $query = Select * from patients where clientid = 'DEMO';
 ora_parse($curs, $query);
 ora_exec($curs);
 ora_fetch($curs);
 The parse executed successfully, but the exec complained that
 Ora_Exec failed (ORA-00932: inconsistent datatypes -- while
 processing OCI function
 OEXEC/OEXN)
 Earlier I had taken an example from Thies Arntzen's conf notes and
 successfully opened, parsed and fetehed, using the same query and the
 same db, only w/ OCI commands.
 
 Is there a problem w/ the ordinary Oracle functions, possibly w/ a
 mismatch between them and the undelying OCI codes?
 Please advise.  Thank you.
 
 --
 John Kolvereid
 http://www.odinfo.com
 http://www.kolvereid.com
 [EMAIL PROTECTED]
 1.610.296.4485
 
 --
 John Kolvereid
 http://www.odinfo.com
 http://www.kolvereid.com
 [EMAIL PROTECTED]
 1.610.296.4485
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] ORA-24365

2001-11-19 Thread Anthony Carlos

This might help...

24365, 0, error in character conversion
// *Cause:  This usually occurs during conversion of a multibyte
//  character data when the source data is abnormally terminated
//  in the middle of a multibyte character.
// *Action: Make sure that all multibyte character data is properly
terminated.


 From: Alex [EMAIL PROTECTED]
 Reply-To: Alex [EMAIL PROTECTED]
 Date: Mon, 19 Nov 2001 15:37:01 +0100
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] ORA-24365
 
 I have following problem when I moved my PHP scripts from Windows IIS
 hosting to Linux Apache.
 
 Scripts are unchanged, all connections to database are working but when I
 try to execute simple StoreProcedure on Oracle, I'm getting this error:
 
 Warning: OCIStmtExecute: ORA-24365: error in character conversion in
 /usr/local/apache-novi/htdocs/broadcast.php on line 32
 
 This is what I'm trying to execute.
 begin :ret_val := PKAccount.AlterAccount( 1, '|LOGIN|avarga|PASSWORD|b|',
 :outstr ); end;
 
 Thnx,
 Alex
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] php and Oracle database

2001-09-27 Thread Anthony Carlos

Georgina:

Based on your 2 enclosures, it appears that you have an html file called
search1.html. When the user hits the submit button, it calls search1.php4.
My question, therefore, is do you have output from search1.php4? Do you see
any error messages?

Thanks,

Anthony Carlos

 From: GEORGINA ELAINE BAILEY [EMAIL PROTECTED]
 Date: Thu, 27 Sep 2001 12:20:17 +0100
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] php and Oracle database
 
 I am very new to PHP and databases and have not really had very much
 programming practice. However, I am trying to create a Web page that
 retrieves data from an Oracle database and uses php to display the content
 in a HTML format. For some reason though my script just doesn't seem to
 work, despite the fact that I know there is data in teh database that
 matches the criteria, and only prints the final three HTML links at the
 bottom of the script.
 
 Any ideas? But please make them easy enough for a 3 year old to understand.
 
 Georgina Bailey
 
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] USA Attacks

2001-09-11 Thread Anthony Carlos

Hello, Steve. Thank you for your sentiments. As an American who drives past
the Pentagon everyday to work, it means a lot.

Anthony Carlos

 From: Steve Farmer [EMAIL PROTECTED]
 Date: Wed, 12 Sep 2001 12:28:28 +1000
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] USA Attacks
 
 Hi,
 
 My heart goes out to all our American cousins in their time of tragedy.
 
 Steve Farmer
 -- 
 ---
 Minds are like parachutes, they work best when open
 Support free speech; visit http://www.efa.org.au/
 
 Heads Together Systems Pty Ltd http://www.hts.com.au
 Email: [EMAIL PROTECTED] Tel: 612 9982 6767 Fax: 612 9981 3081
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] creating an Oracle variable...

2001-09-10 Thread Anthony Carlos

Bona:

You're using OCIParse incorrectly. It's used to parse SQL commands. The var
statement that you quoted is a SQL*Plus command. That is, you're defining a
variable in SQL*Plus. That's why you're getting an Invalid SQL Command
error.

Use the OCIBindByName to bind a PHP variable (you're using test) to an
Oracle placeholder, which is denoted by a preceding colon.

e.g., 

$sql = INSERT INTO emp (ename) VALUES (:ename_placeholder);;
$stmt = OCIParse($conn, $sql);

OCIBindByName($stmt,:ename_placeholder,$empno,32);

$empno = Bona;

OCIExecute($stmt, OCI_DEFAULT);


Please let me know if this makes sense,


Anthony Carlos


 From: [EMAIL PROTECTED]
 Date: Mon, 10 Sep 2001 11:10:04 -0800
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] creating an Oracle variable...
 
 Hi,
 
 I creat the variable test using the sql  plus:
 
 var test varchar2(10);
 
 I´ve been trying to do it wiht PHP:
 
 
 $comando1 = exec var test varchar2(10);;
 
 $controle = OCIParse ($connection, $comando1);
 if ($controle == false){
 echo OCIError($controle).BR;
 }
 
 $result1 = OCIExecute ($controle);
 
 
 I tryed $comando1 using begin and without the exec... with and without the
 ; on the end...
 
 but I allways have the same message: Invalid SQL Command...
 
 can anybody help me???
 
 thanks
 
 Bona
 
 __
 Visite http://www.trama.com.br
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Photo Album Schema

2001-08-21 Thread Anthony Carlos

I vote for one directory to simplify the programming side of things. What do
you guys recommend for the filename convention?

Would you let users determine it or would you force them into something like
a primary key?

Anthony Carlos

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 21, 2001 11:55 AM
To: PHP-DB
Subject: RE: [PHP-DB] Photo Album Schema


I vote for a single directory.  Then use Sheridan's naming suggestion.

Richard Emery
Excel Communications, Inc.
IT Sr. Project Manager
(972) 478-3398
(972) 944-0542 (pager)

There is no trying...
There is only Do or Not Do



-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 21, 2001 10:49 AM
To: PHP-DB
Subject: RE: [PHP-DB] Photo Album Schema


I should have said photo_filename. That was what I intended to do.
Would you suggest one directory for all photos or separate directories
for each user?
Jeff Oien

 Rick: I don't see any .php tags there... plus just because someone
 else has done it doesn't mean he can't do it as well  =)

 Jeff: The only critique I would give from the description you have
 given us thus far is the fact that you appear to be storing the photo
 in the DB.

 The biggest bottleneck in a server-side script is usually the DB calls.
 With this in mind, you want to limit these calls as much as possible.

 I would suggest setting up a naming and/or directory scheme to store
 the pictures on the website, and then store the URL of the picture in the
 DB, rather than the image itself.

 Then when outputing the page just do something like

 echo Img src=\$queryresult['location']\;

 Sheridan Saint-Michel
 Website Administrator
 FoxJet, an ITW Company
 www.foxjet.com

 - Original Message -
 From: Rick Emery [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; PHP-DB [EMAIL PROTECTED]
 Sent: Tuesday, August 21, 2001 10:19 AM
 Subject: RE: [PHP-DB] Photo Album Schema


  This has been done.  see http://www.photopoint.com
 
  This is a free service available to the public.
 
  rick
 
  Richard Emery
  Excel Communications, Inc.
  IT Sr. Project Manager
  (972) 478-3398
  (972) 944-0542 (pager)
 
  There is no trying...
  There is only Do or Not Do
 
 
 
  -Original Message-
  From: Jeff Oien [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, August 21, 2001 10:12 AM
  To: PHP-DB
  Subject: [PHP-DB] Photo Album Schema
 
 
  I want to make a photo album that will have users who sign up
  to create an album and then have the albums open to the public.
  I was thinking of doing it like this but I've never done a relational
  database before so if anyone thinks of anything I should change
  please let me know. Thanks.
  Jeff Oien
 
  Table1:
  -username
  -password
  -album_title
  -creation_date
  -id
 
  Table2:
  -id (from Table1)
  -photo (jpg or gif)
  -date
  -photo_title
  -description (limited length)



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] oracle (oci8) intro

2001-08-21 Thread Anthony Carlos

That's interesting. I haven't had to do too many queries with lots of
computed columns. I'll defer to you and double check my queries. On the
other hand, I have not run into any problems with truncated column data.

With regards to the server side cursors, why not send an anonymous PL/SQL
block? I don't suppose that it has to be a stored procedure...

Perhaps you're talking about the ability to output the result set from a
PL/SQL block to PHP. That's a curious puzzle. I haven't given it much
thought, mainly because I'm not too good at writing dynamic SQL in PL/SQL
(which is even less arbitrary, I believe, than the code I wrote below), but
what would happen if you built a PL/SQL table or array and bound that to a
PHP variable? Have you ever tried this?

It's nice to see someone with a lot of Oracle experience-- sometimes I think
that this is only for MySQL users!

Thanks,

Anthony Carlos

-Original Message-
From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 21, 2001 3:03 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] oracle (oci8) intro


Hello,

Anthony Carlos wrote:

 Here's what I'm using to do paged queries in Oracle:

 $min = minimum of range of records
 $max = maximum of range of records
 $field_list = the fields from the table separated by commas
 $table = the table from where you're selecting
 $where_clause and $order_by should be self-explanatory

 SELECT linenum, $field_list
   FROM (SELECT rownum AS linenum, $field_list
   FROM (SELECT $field_list
   FROM $table
  WHERE $where_clause
  ORDER BY $order_by))
  WHERE linenum BETWEEN $min AND $max;

I afraid that this doesn't work well with arbitrary queries. I tried
this before and I recall there are problems with computed columns
(COUNT(), SUM(), etc...). If I am not mistaken there is also the problem
that Oracle truncates column names that are qualified with the table
names.

The right way to do that is using server side cursors, but I could not
figure how to return to the client side, a server side cursor that I
could use skip rows and get only those that I want.

Regards,
Manuel Lemos

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] oracle (oci8) intro

2001-08-20 Thread Anthony Carlos

Here's what I'm using to do paged queries in Oracle:

$min = minimum of range of records
$max = maximum of range of records
$field_list = the fields from the table separated by commas
$table = the table from where you're selecting
$where_clause and $order_by should be self-explanatory

SELECT linenum, $field_list
  FROM (SELECT rownum AS linenum, $field_list
  FROM (SELECT $field_list
  FROM $table
 WHERE $where_clause
 ORDER BY $order_by))
 WHERE linenum BETWEEN $min AND $max;

I hope it helps,

Anthony Carlos

-Original Message-
From: Graeme Merrall [mailto:[EMAIL PROTECTED]]
Sent: Sunday, August 19, 2001 7:34 PM
To: Cynic
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] oracle (oci8) intro


Quoting Cynic [EMAIL PROTECTED]:

 Hi there,

 I'm in a situation where I need to produce a small app
 on top of an Oracle server really quickly. I'm quite a
 seasoned developer, but have only experience with MySQL
 so far. It's my understanding that Oracle lacks the
 MySQL's LIMIT feature. Looking at the OCI section of
 the PHP manual, it also looks like there's no
 OCIDataSeek() or some equivalent. Since the app I need
 to build will be a standard report builder with paging,
 I need this functionality. What is the common way to
 achieve this? Always fetch all rows, cycling through the
 resultset, discarding the records that preceed the one
 I want to start displaying with, and quit when I reach
 the one where the page should end?

 Is there a PHP + OCI tutorial somewhere?

 I need an intro to Oracle, and I need it now. :(

Thies has an Oracle/PHP tutorial online at http://conf.php.net/ which may be
of
some assitance.
The LIMIT problem is a real bitch is Oracle. There are a few ways to get
around
it, the most obvious people use being ROWNUM. However, ROWNUM does not
listen
to sorting which makes life amusing.
One option is to try a query like the following:
SELECT * FROM (SELECT field1, field2 FROM table WHERE id10 ORDER BY field1
DESC) WHERE ROWNUM11

which gives you 10 rows, but still leaves the question of paging behind
unless
you use between values. I can't say I've tried paging record sets though.

Cheers,
 Graeme

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Oracle CLOBs and carriage returns

2001-08-09 Thread Anthony Carlos

Tom:

I suspect that your problem is with the HTML, not the CLOB itself. Have you
tried echoing $lob_data in between PRE tags or using the nl2br function in
PHP? It converts nl's to BR tags.

Hope it helps,

Anthony

-Original Message-
From: Tom Tsongas [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 09, 2001 2:09 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Oracle CLOBs and carriage returns


Hi folks.

I have an interesting problem with regards to data I am retrieving from
a CLOB stored in my database.

The data consists of several paragraphs of information with multiple
carriage returns and other formatting mechanisms.

Now when I attempt to retrieve the data and display it on the web page,
it comes out as one giant line and all carriage returns and tabbing
seems to have been obliterated.

Here is the code I am using:

$sql_comments = OCIParse($connection,SELECT COMMENTS FROM INCIDENT
WHERE INCIDENT='$incident');
OCIExecute($sql_comments);
while ( OCIFetchInto($sql_comments, $row, OCI_ASSOC+OCI_RETURN_NULLS)) {

$lob_data = $row[COMMENTS]-load();
echo $lob_data;
}

I know the information is stored correctly since a SQL query from the
command line works properly and all formatting is displayed.

Any thoughts?

Tom



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] long or LOBs in oracle ???

2001-08-01 Thread Anthony Carlos

Andy:

Go with the CLOB. As you stated, you can have more than one CLOB defined in
a table. Also, you can pull out data randomly instead of sequentially. Plus,
the data can reside inline (for less than 4KB) or out of line for bigger
values.

The key to making it work is using the DBMS_LOB package. See the Oracle
documentation on this to get an idea, then ask a more specific question.

If you're a member of technet, you'll be able to read this:

http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/appdev.
817/a76936/toc.htm

If not, join up ASAP! (It's free).

Good luck,

Anthony

 From: Andreas Eckhoff [EMAIL PROTECTED]
 Date: Tue, 31 Jul 2001 15:09:52 +0200
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] long or LOBs in oracle ???
 
 Hi everybody,
 
 I have a little question. What is the best datatype to put large character
 data into (more than 5.000-20.000 letters). Maybe a CLOB or a long ? I am
 quiet new to oracle so I don't know so much about the LOBs and how Oracle
 handles it. On thing is, that I have to use more than one large field in one
 table, this means that I cannot use the long type, because only one is
 allowed, right. OK Then I think there is only a LOB Type (maybe the CLOB is
 the best for my stuff).
 I tried it, but I cannot put the data in the normal way into the field, like I
 am used to with MYSQL longtext type.
 
 How can I put LOB data into the DB via PHP or is there an other method to put
 large character data into the DB, can anybody help me
 
 thanx in advance,
 
 Andy
 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] problems connecting to remote oracle database

2001-07-02 Thread Anthony Carlos

Phil,

Perhaps I'm being nit-picky, but shouldn't it be OCILogon($user,
$PASSWORD, $connect_string); ?

Anthony

 From: [EMAIL PROTECTED]
 Date: Sat, 30 Jun 2001 09:39:11 -0700
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] problems connecting to remote oracle database
 
 Hi folks,
 
 I'm having difficulties getting php4 to connect to a remote oracle
 database.
 
 I have an entry in tnsnames.ora, along the lines of
 
 shorthostname = (etc, etc)
 
 and I can use sqlplus user/name@shorthostname to connect just fine, as
 a regular user. Even without ORACLE_SID set, since I have it set in
 tnsnames.ora for that entry
 
 But when I try
 ocilogin(user,name,shorthostname);
 
 on a php page, I get a printout of oracle error 01017: authentication
 failed. 
 The listener log on that oracle machine confirms that I am actually
 attempting to connect. But no details on what's going wrong.
 
 Any suggestions?
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Oracle Client to connect to remote DB

2001-06-30 Thread Anthony Carlos

Yes, it can be installed via command line. There is mention of it in the
installation guide. I've never been able to make it work, however, and I
don't believe that Oracle is supporting it as much as its GUI Universal
Installer.

On the other hand, I have used the Universal Installer over an ssh
connection that forwards X-Windows packets. Therefore, I was able to use it
remotely via an X-Windows terminal on my PC.

Anthony
-Original Message-
From: Mindblender [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 27, 2001 10:58 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Oracle Client to connect to remote DB


Do you know if the Oracle client can beinstalled via the command line?  I
don't have access to the box itself, only telnet access.

Jeff

Brian S. Dunworth [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Jeff,

   As far as I know, you cannot get *only* the Oracle client for Linux.
  When I called Oracle Worldwide Support and asked for one, they sent me
the
 whole Oracle 8i installation package for Linux.  No problem, though --
when
 you start the install on your Linux machine, you can choose to install
only
 the client.   That's what I did, and it's working fine connecting to the
 Oracle 8i database on our Sun.


 -Original Message-
 From: Mindblender [SMTP:[EMAIL PROTECTED]]
 Sent: Tuesday, June 26, 2001 12:35 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Oracle Client to connect to remote DB

 I read a post on faqt.com that said that I could connect to a remote
Oracle
 DB if I had the Oracle client installed.  Does anyone know where I can get
 a
 copy of only the client for Linux?  I don't want to install the whole
 Oracle
 package, I use MySQL on the server, but have a client that is needing to
 connect to an Oracle DB on their server from mine.

 Any suggestions?

 Thanks,
 Jeff
 

 -
Brian S. Dunworth
Sr. Software Development Engineer
Oracle Database Administrator
The Printing House, Ltd.

(850) 875-1500  x225
[EMAIL PROTECTED]
  -



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] error ORA-12699

2001-06-29 Thread Anthony Carlos

Sang,

Your tnsnames file appears to be misconfigured. It should look like this:

ORCL =
  (DESCRIPTION=
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.1)(PORT = 1521))
(CONNECT_DATA = (SID = ORCL)))

The first line, ORCL =, lets you know what to use as your connect string.
In this case, you're calling your connect string ORCL. When you try to
login, you should use username/password@ORCL.

In PHP, you set the third argument to OCILogon to ORCL.

Here's what happens. When Oracle sees a connect string during a login
attempt, it checks the tnsnames.ora file to resolve it into a protocol,
address, and sid. In other words, ORCL is shorthand notation for all of the
TCP/IP info and then some.

I hope this makes sense,

Anthony
-Original Message-
From: sang [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 27, 2001 9:32 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] error ORA-12699


I have read some doc.
 $connect_string  is set to equal from tnsnames.ora.

 $connect_string=(DESCRIPTION=(ADDRESS = (PROTOCOL = TCP)(HOST =
192.168.1.1)(PORT = 1521))(CONNECT_DATA = (SID = ORCL)));

I can connect my local oracle server  before when using
OCILogon(system,manager);

But now , i cannot connect local oracle server!!
It is always said the ORA-12699 error!

I donot know what is wrong.

sang

Anthony Carlos [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Sang,

 Since you're trying to connect from another computer to the Oracle server,
 you probably need to specify a connect string in the OCILogon command.

 OCILogon('system', 'manager', $connect_string);

 What's the value for $connect_string? It depends on how you've set-up your
 Oracle networking. If you can access your DB from that client machine with
 SQL*Plus, then you must be loging in via the following format:

 sqlplus system/manager@connect_string

 Use the value of connect_string for $connect_string. It should be
defined
 in your tnsnames.ora file on your client, and have a corresponding entry
in
 your listern.ora file on your server.

 I suspect that your client machine is trying to access an Oracle database
on
 itself, because no connect string was specified.

 Lemme know if this helps,

 Anthony

  From: sang [EMAIL PROTECTED]
  Date: Wed, 27 Jun 2001 18:59:31 +0900
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] error ORA-12699
 
  I have installed NT4+PHP+ORACLE8.0.4+APACHE in my computer.
  I want to access ORACLE server to another computer from web server.
  It is ok to access ORACLE SERVER with PERL, but i cannot access using
PHP.
 
  The first error is ora-12514 , but i change, change and change, now it
is
  always
  ORA-12699 Native service internal error .
 
 
  ?php
  ocilogon(system,manager,);
  ?
 
  Warning: _oci_open_server: ORA-12699:Native service internal error
 
 
  Thanks in advance.
 
  sang
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]


 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] error ORA-12699

2001-06-27 Thread Anthony Carlos

Sang,

Since you're trying to connect from another computer to the Oracle server,
you probably need to specify a connect string in the OCILogon command.

OCILogon('system', 'manager', $connect_string);

What's the value for $connect_string? It depends on how you've set-up your
Oracle networking. If you can access your DB from that client machine with
SQL*Plus, then you must be loging in via the following format:

sqlplus system/manager@connect_string

Use the value of connect_string for $connect_string. It should be defined
in your tnsnames.ora file on your client, and have a corresponding entry in
your listern.ora file on your server.

I suspect that your client machine is trying to access an Oracle database on
itself, because no connect string was specified.

Lemme know if this helps,

Anthony

 From: sang [EMAIL PROTECTED]
 Date: Wed, 27 Jun 2001 18:59:31 +0900
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] error ORA-12699
 
 I have installed NT4+PHP+ORACLE8.0.4+APACHE in my computer.
 I want to access ORACLE server to another computer from web server.
 It is ok to access ORACLE SERVER with PERL, but i cannot access using PHP.
 
 The first error is ora-12514 , but i change, change and change, now it is
 always
 ORA-12699 Native service internal error .
 
 
 ?php
 ocilogon(system,manager,);
 ?
 
 Warning: _oci_open_server: ORA-12699:Native service internal error
 
 
 Thanks in advance.
 
 sang
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Oracle and PHP

2001-06-26 Thread Anthony Carlos

TathitSA,

You'll need to have the Oracle networking software (Net8) installed on your
Web server. Then, compile PHP with the Oracle directive turned on. These are
just general concepts, but if this is incomprehensible, then please ask more
questions before proceeding. For more details, see the installation manual ,
and if you don't understand what they say, ask a more specific question.
I'll be happy to help translate whatever I can.

Anthony

-Original Message-
From: TathitSA [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 26, 2001 1:47 AM
To: PHP General; PHP DB
Subject: [PHP-DB] Oracle and PHP


Hi,

I'm a newbie in PHP, what should I do to connect to Oracle Database.
Do I have to install a library to do that?
Please anyone, help.

Thanks,
TathitSA


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Oracle Client to connect to remote DB

2001-06-26 Thread Anthony Carlos

Jeff,

When you run the graphical Oracle Installer program (require X-Windows), you
can choose a custom installation and specify what you want to install. I
don't know if you can get just the client for Linux, but the server software
includes the client software. You can demo the software from
technet.oracle.com. I have no idea how much it costs by itself.

Anthony

-Original Message-
From: Mindblender [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 26, 2001 12:35 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Oracle Client to connect to remote DB


I read a post on faqt.com that said that I could connect to a remote Oracle
DB if I had the Oracle client installed.  Does anyone know where I can get a
copy of only the client for Linux?  I don't want to install the whole Oracle
package, I use MySQL on the server, but have a client that is needing to
connect to an Oracle DB on their server from mine.

Any suggestions?

Thanks,
Jeff



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]