Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

oci_bind_by_name

605509Nov 6 2007 — edited Nov 8 2007
Hi to all,

Can anyone explain how to use of oci_bind_by_name in more detail?
for example oci_bind_by_name(":oracle_parameter",$php_var, $maxlength [, int $type])

how do you specify the maxlength? what criteria to consider
what can you specify in $type? how do you use the $type ( actually i m more confused on this part)

what is the advancetage of using the oci_bind_by_name and how do you use these function

in my case oracle statement of mine is
$stmt = "select column1, column2 from (select column1, column2, row_num rnum from (select column1, column2 from table1) where row_num < :lastrow) where rnum> :firstrow";

$connection= oci_connect('hr', 'hr', 'orcl');

$q =oci_parse($connection, $query);

oci_bind_by_name ($q, ":firstrow" , 1); //is this possible?? because the it is bind to a number
oci_bind_by_name ($q, ":lastrow" , 1000); //??

oci_execute($q);

$q will be the array of your table blah blah.........

if you intend have the same page over and over again but just having row number change how would you use the oci_bind_by_name? do your php_page call the oci_connect again and do the binding for the page like the code above? how do you guys do to save some oracle resources...

by the way, i have also notice that if you perform a "order by" in the oracle query it does take some time...how to reduce this time..any recommendation?

thanks...

Message was edited by:
Jo Ee
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 6 2007
Added on Nov 6 2007
1 comment
1,925 views