Oracle example

Oracle example

pspencepspence Posts: 7Questions: 0Answers: 0
edited February 2011 in General
Does anyone have an example of connecting DataTables to Oracle for server-side processing. I have been trying to convert the MySQL example to Oracle without much success. TIA.

Replies

  • allanallan Posts: 63,116Questions: 1Answers: 10,397 Site admin
    I'm afraid that I don't, but just wanted to add a quick message to say that if anyone has got such a script, it would be a great addition to the server-side processing scripts which we already have ( http://datatables.net/development/server-side/ )!

    Allan
  • big-dealbig-deal Posts: 38Questions: 0Answers: 0
    Oracle is a a db vendor.
    What platform do you wish to use? jee (java - jsp)? php?

    Do you want to connect from php to an oracle db?

    p.s.
    What version of oracle db? 10g? 11g?
  • pspencepspence Posts: 7Questions: 0Answers: 0
    PHP to Oracle via OCI8. 10g. Thanks.
  • big-dealbig-deal Posts: 38Questions: 0Answers: 0
    Hey there pspence.
    I wrote an example based on one of the server-side processing scripts which Allan already has.
    It is written in php, made for an Oracle 10g via OCI8.
    unfortunately I currently don't have any php server with an Oracle based db.
    Can you (possibaly through Allan) give me access to your server in order for me to test and debug my code?

    big-deal
  • pspencepspence Posts: 7Questions: 0Answers: 0
    Hey Big-deal, unfortunately I do not have a publicly available instance of Oracle. I could try to test the code for you, if Allan sends it to me. Or, there is a 'free' version of Oracle called Oracle XE which is basically oracle 10g with some memory limitations. Thanks for your efforts on this. I think that it will be a great addition to this already great plugin.

    http://www.oracle.com/technetwork/database/express-edition/downloads/index.html
  • big-dealbig-deal Posts: 38Questions: 0Answers: 0
    I'll send you the source code for you to test.
    I will try to help you to get it to work if it doesn't work...
    Where to send it to? it is not yet ready to be published here...(:
  • pspencepspence Posts: 7Questions: 0Answers: 0
    linux70 at comcast
  • big-dealbig-deal Posts: 38Questions: 0Answers: 0
    Well just for the record - I wrote the example and sent it to you.
    If you are having problems (because it is not yet tested) - let me know and I will try to help.
    When the example is complete please let me know so we will send it to Allan to publish along side with all other server side examples.

    big-deal
  • pspencepspence Posts: 7Questions: 0Answers: 0
    Sounds good. Give me a few days and I will get back to you via email. Thanks.
  • chinuchinu Posts: 1Questions: 0Answers: 0
    edited March 2011
    Hi big-deal
    I wanted to achieve the same thing and have oracle and data table setup with me,can you please send the code to saychinu@gmail.com.Will test the code and let you know in case of any issues :)
    thanks !
  • big-dealbig-deal Posts: 38Questions: 0Answers: 0
    The code was sent to you too chinu. please tell me of any problems - I'll try to work them out with you.
    pspence - I havn't got any word from you yet - how are you doing?

    big-deal
  • big-dealbig-deal Posts: 38Questions: 0Answers: 0
    The example worked.

    Allan, where do you want me to send you the example file?

    big-deal
  • allanallan Posts: 63,116Questions: 1Answers: 10,397 Site admin
    Great stuff - thanks for taking the time to do that! If you could use the contact form ( http://datatabes.net/contact ) that would be fantastic.

    Thanks,
    Allan
  • bengalavizbengalaviz Posts: 6Questions: 0Answers: 0
    I had this same issue but I am using jsp and Oracle 10. Finally got it working. I could change the code and post somewhere if anyone wants it.
  • muflomuflo Posts: 11Questions: 0Answers: 0
    Hello there,
    got the same problem. I have to use several hundred records query results to display on the table. I'm newbie with data tables and I will appreciate a lot your example.
  • pspencepspence Posts: 7Questions: 0Answers: 0
    Sorry I have lost this thread. I have been out of commission with a medical issue. Has chinu's code been posted? If not I will continue to test and refine the code. TIA.
  • muflomuflo Posts: 11Questions: 0Answers: 0
    Hi there,
    where should i find the code?
  • allanallan Posts: 63,116Questions: 1Answers: 10,397 Site admin
    Here we go: http://datatables.net/development/server-side/php_oracle - big-deal sent the code over to me a few days ago and I've posted it up in the server-side scripts gallery. Let us know how you get on!

    Thanks for the code big-deal :-)

    Regards,
    Allan
  • dardar Posts: 3Questions: 0Answers: 0
    edited June 2011
    Hi all,
    can you guys help me please?
    I've tried using the php_oracle code and rename it as server_oracle.php and create oracle.html to display the result. Unfortunately when I tried to run it in my localhost it only succeed connecting to my oracle 11G database, displaying database record, and sorting each table, but when I started to type in the search field, suddenly an error appeared : "JSON data from server could not be parsed. This is caused by a JSON formatting error."

    when I execute the server_oracle.php file there are bunch of error warnings:

    Warning: oci_bind_by_name() [function.oci-bind-by-name]: ORA-01036: illegal variable name/number in C:\xampp\htdocs\datatables\examples\server_side\scripts\server_oracle.php on line 233

    Warning: oci_bind_by_name() [function.oci-bind-by-name]: ORA-01036: illegal variable name/number in C:\xampp\htdocs\datatables\examples\server_side\scripts\server_oracle.php on line 234

    Warning: oci_execute() [function.oci-execute]: ORA-30485: missing ORDER BY expression in the window specification in C:\xampp\htdocs\datatables\examples\server_side\scripts\server_oracle.php on line 260

    Warning: oci_fetch_array() [function.oci-fetch-array]: ORA-24374: define not done before fetch or execute and fetch in C:\xampp\htdocs\datatables\examples\server_side\scripts\server_oracle.php on line 262

    Warning: oci_execute() [function.oci-execute]: ORA-30485: missing ORDER BY expression in the window specification in C:\xampp\htdocs\datatables\examples\server_side\scripts\server_oracle.php on line 281

    Warning: oci_fetch_array() [function.oci-fetch-array]: ORA-24374: define not done before fetch or execute and fetch in C:\xampp\htdocs\datatables\examples\server_side\scripts\server_oracle.php on line 284
    {"sEcho":0,"iTotalRecords":"92036","iTotalDisplayRecords":0,"aaData":[]}

    ===================================
    By the way, how to create multi_filter in server-side/php_oracle like in datatables/examples/api/multi_filter.html
    my php version: 5.2.9
    Database: Oracle 11G

    Many many thanks for your help!! :)

    Best regards,
    Dar
  • kelly.blue90kelly.blue90 Posts: 2Questions: 0Answers: 0
    thanks for the post!!!
    I find some very useful oracle example here http://www.php-example.com/2011/06/28-basic-tutorials-to-learn-oracle.html which helps me to learn oracle by ready made sql code examples.
  • gourmetgourmet Posts: 2Questions: 0Answers: 0
    Hi,

    reading the code posted at http://datatables.net/development/server-side/php_oracle I'm trying to "translate" it to JSP (I know that already exists an example with JSP, but it use MySQL)

    I have reached a couple of lines where or I missed something or is dead code what I reading. The lines I talking about are:

    [code]
    //Bind all variables of general search
    for ( $i = 0 ; $i < $nWhereGenearalCount ; $i++ )
    {
    oci_bind_by_name($statmntFinal, ':whereParam'.$i , $sWhereGenearal);
    oci_bind_by_name($statmntFinalCount, ':whereParam'.$i , $sWhereGenearal);
    }
    [/code]

    I can't find in the code a reference to the ":whereParam" string except by that I see above. I have few or null experience with PHP, so I asking here for someone with more experience to clarify if this is an error, omission or really I missing something.

    Any help will be welcome

    PS: sorry by my horrible english...is not my native language
  • gourmetgourmet Posts: 2Questions: 0Answers: 0
    edited July 2011
    Hi,

    Finally I have rewrited the example in java, in a servlet more exactly. I have create a web app file, so if someone need and example of Datatables that works with Oracle and with a servlet download this file and play with it:

    https://sites.google.com/site/cargoarea/devel/Datatables_AJAX_With_Oracle.war

    You need a servlet container (Apache Tomcat i.e) and the Oracle jdbc driver "installed" (ojdbc14.jar) on it.

    The code is inside of the war file, can be reused and posted in the datatables site if this can help to someone else.

    Greetings from Argentina.

    P.S: sorry by my horrible english...is not my native language
This discussion has been closed.