I Love PHPMaker

... because it gets even more powerful and flexible!!

  • About
  • Terms and Conditions
  • Membership Options
  • Sitemap
  • Downloads
    • PHPMaker Extensions Download
    • PHPMaker Projects Download
    • PHP Report Maker Extensions Download
I Love PHPMaker » Tips and Trick » Solutions for Some Issues in Using Oracle Database with PHPMaker 10
How to Insert A New Link Near by Export Options in Web Applications that Generated by PHPMaker 10
How to Change Redirect to Default Page in Web Applications that Generated by PHPMaker 10.0.2

November 4, 2013

Solutions for Some Issues in Using Oracle Database with PHPMaker 10

I have been working with Oracle database with PHPMaker 10 to generate some web applications. There are actually some basic issues that need the quick solution. Started from the notice message Use of undefined constant OCI_COMMIT_ON_SUCCESS, how to use the certain data type in Oracle (such as ENUM in MySQL), how to overcome the error message from Oracle Error: ORA-00984: column not allowed here, and many others (in future). I found those three issues while using Oracle11g database with PHPMaker 10.

This post/article will give you the solutions to handle all the possibilities issue in using Oracle11g database with PHPMaker 10 (as this is the latest version I have been using). I found this solutions after doing some investigation and implementing the proper step while I was using Oracle database with PHPMaker 10 for the very fist time. The good news is all the solutions are working properly.

Of course, I will add another solutions for another issues in this post, if I find another in future. I am really sure that this will be helpful for those of you who have been working with Oracle database in PHPMaker 10. You may come back to this article at anytime you want. You can also add another issue(s) including the solution(s) by leaving your comment below.

[hidepost]

Issue #1, Notice: Use of undefined constant OCI_COMMIT_ON_SUCCESS

Usually, this will be happened for the PHP service that has never used Oracle extension.

Solution #1: If you are using Oracle11g (the most popular Oracle version), then simply enable php_oci8_11g extension in your php.ini file.

Find the following code in php.ini file:

;extension=php_oci8_11g.dll

then change it become:

extension=php_oci8_11g.dll

This change will enable the extension, save the file, and then make sure you restart your web server.

Issue #2, Implementing ENUM Data Type in MySQL Into Oracle

Most of the time, we usually use ENUM data type in MySQL database for the field which need the simple value, such "Y" and "N", "1" and "0", etc. Unfortunately, Oracle does not have this data type. However, we can use the similar data type with some additional steps.

Solution #2: In Oracle, you can use VARCHAR2 data type, afterwards, you have to add CHECK to insert the allowed value.

For simplicity, try to use the following SQL to generate a simple table named TESTTABLE which contain two fields named TEST_ID and TEST_OPTION which has that ENUM data type:

CREATE TABLE "TESTTABLE" 
("TEST_ID" VARCHAR2(5), 
"TEST_OPTION" VARCHAR2(1), 
 CHECK ("TEST_ID" IS NOT NULL ) ENABLE, 
 CHECK ("TEST_OPTION" IN ('Y','N') ) ENABLE, 
 PRIMARY KEY ("TEST_ID") );

As you can see, the allowed values in that TEST_OPTION field is Y and N.

Issue #3, Error: ORA-00984: column not allowed here

From the second issue above, if you set OPTION_TEST become Checkbox from the Fields setup of PHPMaker, then this error will be happened while user adding a new record into a table which has such ENUM field type in a web application that generated by PHPMaker 10. The same error also will be shown up while user editing a record.

As we can see, we have been using "Y" and "N" values in that such ENUM data type. This error happened, since PHPMaker 10 will generate the incomplete value that related to the value of such ENUM data type.

Let's say we use TESTDB database which contains the TESTTABLE table above, we want to insert a new record which contain such ENUM data type value.

So here is the SQL that generated by PHPMaker 10:

INSERT INTO "TESTDB"."TESTTABLE" ("TEST_ID","TEST_OPTION") VALUES ('00001',Y)

As you can see the value of "Y" is not enclosed by the single quote. This will raise an error column not allowed here since there is a value which does not match to TEST_OPTION field which should be a string value.

Solution #3: You have to enclose the value of that ENUM data type both for Row_Inserting and Row_Updating server events by using the following code:

$rsnew["TEST_OPTION"] = "'".$rsnew["TEST_OPTION"]."'"; // enclose it with single quote

by adding that code both in the server event, then the value for such ENUM data type will be converted correctly, and the Error ORA-00984 will be gone.
[/hidepost]

Article by Masino Sinaga / Tips and Trick / CHECK, database, ENUM, OCI_COMMIT_ON_SUCCESS, ORA-00984, Oracle, Oracle11g, php_oci8_11g, php.ini, PHPMaker 10.0.2, PHPMaker 10.0.3, PHPMaker 10.0.4, solution Leave a Comment

How to Insert A New Link Near by Export Options in Web Applications that Generated by PHPMaker 10
How to Change Redirect to Default Page in Web Applications that Generated by PHPMaker 10.0.2

Leave a Reply Cancel reply

You must be logged in to post a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • A New PHPMaker 2025 Project File Is Released
  • PHPMaker 2025 Demo Project File Is Released
  • Masino Extensions for PHPMaker 2025 Is Released!
  • A New PHPMaker 2024 Project File Is Released
  • PHPMaker 2024 Demo Project File Is Released
  • Masino Extensions for PHPMaker 2024 Is Released!
  • PHPMakerProjects.com, For Those Who Need PHPMaker Project Sample
  • A New PHPMaker 2023 Project File Is Released
  • PHPMaker 2023 Demo Project File Is Released
  • Masino Extensions for PHPMaker 2023 Is Released!

Search

Recent Comments

  • Masino Sinaga on Masino Extensions for PHPMaker 2024 Is Released!
  • Masino Sinaga on A New PHPMaker 2024 Project File Is Released
  • Masino Sinaga on PHPMaker 2023 Demo Project File Is Released
  • Edward Babatunde on PHPMaker 2023 Demo Project File Is Released
  • Edward Babatunde on Masino Extensions for PHPMaker 2024 Is Released!

Demo Website

  • Demo of I Love PHPMaker 2025 (MasinoExtensions).
  • Stock Inventory Management for PHPMaker 2025.

Another Demo

The following template are not available in this site (must be purchased separately)

  • PHPMaker v2018 Horizontal Vertical Template.
  • PHPMaker v2017 Horizontal Vertical Template.

Demo Explanation

Stock Inventory Management is the good project for your reference, since it uses the real example in the real world. Many useful features you can use from this project, such as how to add the Thousand and Decimal separator character, and also how to calculate multiple row in Grid-Add when End-Users are entering data into the Grid-Add mode.

Categories

  • Customize Template (103)
  • General (4)
  • PHP Report Maker (17)
  • PHP Report Maker Extensions (2)
  • PHPMaker Extensions (84)
  • PHPMaker Projects (7)
  • Tips and Trick (72)

Articles based on version

  • PHPMaker 2025
  • PHPMaker 2024
  • PHPMaker 2023
  • PHPMaker 2022
  • PHPMaker 2021
  • PHPMaker 2020
  • PHPMaker 2019
  • PHPMaker 2018
  • PHPMaker 2017.0.7
  • PHPMaker 12.0.7
  • PHPMaker 11.0.6
  • PHPMaker 10.0.5
  • PHPMaker 9.2.0
  • PHPMaker 8.0.3
  • PHP Report Maker 12

(c) I Love PHPMaker 2010 - 2025 by Masino Sinaga | WordPress | Log in | Back to top