inserting data into Oracle tables
am 09.12.2005 11:00:16 von David Skyers
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=20
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
!"=A3$%^&*()_+{}@~<>?|\,./;'#][=3D-=A6abcdefghijklmnopqrstuvwxyzA=20
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@ucl.ac.uk
020 7679 1849 (internal 41849)=20
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: inserting data into Oracle tables
am 09.12.2005 15:22:27 von Falk Sauer
Hi David,
Am Fr 9.Dezember 2005 11:00 schrieb David Skyers:
> Is there a standard for inserting data into Oracle tables from a user inp=
ut
> 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
>
> !"=A3$%^&*()_+{}@~<>?|\,./;'#][=3D-=A6abcdefghijklmnopqrstuvwxyzA
>
> 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.
your problem description sounds to me as you use a character encoding that=
=20
uses for 4 of your test chars a 2byte code and for the other chars a 1 byte=
=20
encoding.=20
I don't know a standard way, i think you can look into your encoding table=
=20
that you use into your oracle db (nls_language parameter) and count the byt=
es=20
in a selfmade procedure before you sent to oracle ...
afair if you use a utf8 or similiar international encoding the newer versio=
ns=20
of oracle count a charachter as 1 element in your VARCHAR2 definition and n=
ot=20
as bytes.
regards,
Falk
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php