RE: inserting data into Oracle tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




You also need to consider your character set.  VARCHAR2(60 BYTE) means it only allows 60 bytes not 60 characters.  Some character sets use multiple bytes (2 or 3) for some characters.  You could define your table as VARCHAR2(60 CHAR) or set your nls_length_semantics to CHAR.

I would also suggest that you setup a free account at OracleTechnologyNetwork (OTN) ... http://www.oracle.com/technology/index.html ... there is a lot of good information there.


Roy A. Jones


US Pharma Database Administration
GlaxoSmithKline Inc.
US Pharma IT, Data Warehousing Technology
"Remember -   is your friend!"


"Bastien Koert" <bastien_k@xxxxxxxxxxx>

08-Dec-2005 09:25

       
To
d.skyers@xxxxxxxxx, php-db@xxxxxxxxxxxxx
cc
Subject
RE: inserting data into Oracle tables





check the length of your vairables before you insert...if its web based app,
then you should limit the input anyway and validate it that it matches the
desired data

Bastien


>From: "David Skyers" <d.skyers@xxxxxxxxx>
>To: "php-db" <php-db@xxxxxxxxxxxxx>
>Subject: inserting data into Oracle tables
>Date: Thu, 8 Dec 2005 10:31:40 -0000
>
>Is there a standard for inserting data into Oracle tables from a user input
>field in PHP?
>
>Most Oracle tables will have a limit on the amount characters such as
>
>Name VARCHAR2(60 BYTE) - this means the maximum amount of characters
>allowed is 60.
>
>If you use special characters in PHP such as entering the following into a
>input box
>
>¬!"£$%^&*()_+{}@~<>?|\,./;'#][=-¦abcdefghijklmnopqrstuvwxyzA
>
>When this gets passed to Oracle it takes the overall characters in the
>insert statement to 64, which then fails because it is over the Oracle
>table limit. Is there a standard way of dealing with something like this.
>
>Regards,
>David
>
>----------------------------------
>David Skyers
>Support Analyst
>Management Systems, UCL
>d.skyers@xxxxxxxxx
>020 7679 1849 (internal 41849)
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

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




[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux