Informatics Forum

Posts Tagged ‘Database

Very simple to create RSS feed. You just add header of XML file on your page header, and select from table and loop your data into xml format.

$query = “select address, cat, desc, title from `category` limit 15″;
$result = mysql_query($query, $link);

while ($line = mysql_fetch_assoc($result))
$return[] = $line;

$now = date(”D, d M Y H:i:s T”);

$output = “<?xml version=\”1.0\”?>
<rss version=\”2.0\”
<title>Judul RSS FEED</title>
<description>Deskripsi RSS</description>

foreach ($return as $line)
$output .= “<item><title>”.htmlentities($line[’title’]).”</title>

$output .= “</channel></rss>”;
header(”Content-Type: application/rss+xml”);
echo $output;

Tags: , ,

Anda pasti kenal Oracle, database paling bandel. Dan PHP web programming, program paling gampang dan mudah dipelajari. Ciri khas PHP adalah program berbasis fungsi. Untuk membuat koneksi PHP dengan database Oracle, PHP telah menyediakan beberapa fungsi yang tersedia di dalam komponen. Berikut step by step cara untuk melakukan setup :

  1. Buka file di Path PHP/PHP.INI, file ini adalah setting applikasi php, tentang komponen apa aja yang enable dan disable, setting timeout dll. Coba anda cek dulu webserver anda. Coba cari file di dalam path PATH_PATH/php/php.ini. Buka file itu dan cari kata dengan “ORA” atau “OCI”, jika ketemu coba cek.Hilangkan tanda “;” di depan kata extention=php_oci8.dll, php_oci8.dll adalah komponen untuk menghandle koneksi transaksi database PHP dengan oracle. Path PHP.INIComponent
  2. Cek apakah sudah komponen available dengan perintah <?=phpinfo()?>, tuliskan satu baris ini di sebuah file dot php kemudian running dengan browser.

  3. Fungsi – Fungsi Primer Oracle Database di PHP, berikut fungsi – fungsi under oci untuk melakukan transaksi command ke oracle :
    1. ocilogon($username,$passwd[,$db]), fungsi ini untuk melakukan koneksi ke server, pada umumnya fungsi ini diletakkan di atas coding sebuah page, sehingga perintah2 oracle di bawahnya menggunakan resource koneksi itu.
    2. ocilogoff(), untuk memutuskan koneksi database
    3. ocierror(), untuk menangkap error yang dilempar oleh oracle atas perintah sebelumnya.
    4. ociparse($conn, $query), fungsi ini adalah untuk melakukan eksekusi sebuah perintah QUERY, return value dari fungsi ini adalah sebuah recordset atau biasa dikenal statement.
    5. ociexecute($statement), fungsi ini untuk melakukan eksekusi sebuah statement hasil dari ociparse.
  4. Membuat Koneksi dengan Database Server
  5. Melakukan Query
  6. Retrieve Data


Tags: , ,
What is Application Express?
Oracle Application Express (Oracle APEX), formerly called HTML DB, is a rapid web application development tool for the Oracle database. Using only a web browser and limited programming experience, you can develop and deploy professional applications that are both fast and secure. Oracle application express combines the qualities of a personal database, productivity, ease of use, and flexibility with the qualities of an enterprise database, security, integrity, scalability, availability and built for the web. Application Express is a tool to build web-based applications and the application development environment is also conveniently web-based. You can try Application Express simply by signing up for an account at

Application Express Home Page
No client software is required to develop, deploy, or run Application Express applications. Application Express provides three primary tools:

  • Application Builder – to create dynamic database driven web applications
  • SQL Workshop – to browse your database objects, run ad-hoc SQL queries, as well as a graphical query builder
  • Utilities – allows for data to be loaded and unloaded from both flat files and spreadsheets
What types of applications can you build with Application Express?
Application Express is a productive tool to build applications that report on database data. Reports are typically hyper text linked with other reports allowing users to navigate through database data in the same way they navigate web sites. Columns in reports can be easily linked to other reports, charts, and data entry forms and it is all done declaratively. An extensive charting engine allows SQL queries to be represented graphically and that allows data to be more effectively communicated. Application Express is also very adept at editing database data and supports a large number of declarative form controls including radio groups, checkboxes, select lists, shuttles, text editors, and date pickers.

Hyper Text Linked Report

Hyper Text Linked Chart

Data Entry Form
When to use Application Express?
Due to its ease of use, Application Express is designed to build opportunistic and departmental applications quickly. These application are deployed on the web with superior performance. Historically, departments, prototypes, and small projects have relied on desktop databases to provide an agile development tool for these smaller scale SMB or departmental application development needs. Desktop databases can become very fragmented because they keep data in too many places, they can be vulnerable or inappropriate for use with sensitive information, and they are typically not web friendly. The browser based design time interface, the declarative programming framework, and simple wizards make Application Express a natural replacement for multi-user desktop databases applications such as Microsoft Access.SQL Savvy application developers also appreciate the ease with which you can create database applications with little or no web experience. You don’t need to learn scripting languages or complex deployment frameworks, you simply write a few queries and choose from ready built user interface themes and form controls to create highly professional, secure, and scalable applications.
Declarative Programming
With Application Express, coding is declarative. That means that no code is generated, no code is compiled, and you interact with wizards and property sheets. The SQL language is used to define reports and charts, so some knowledge of SQL is very helpful. You can optionally write snippets of code using PL/SQL, if procedural logic is needed. Declarative code yields fewer differences between developers and this consistency makes Application Express applications easy to maintain and manage.
The Application Express engine renders applications in real time from data stored in database tables. When you create or extend an application, Oracle Application Express creates or modifies metadata stored in database tables. When the application is run, the Application Express engine then reads the metadata and displays the application. Application Express lives completely within your Oracle database. It is comprised of nothing more than data in tables and large amounts of PL/SQL code. The essence of Oracle Application Express is approximately 215 tables and 200 PL/SQL objects containing 300,000+ lines of code.To provide stateful behavior within an application, Oracle Application Express transparently manages session state in the database. Application developers can get and set session state using simple substitutions as well as standard SQL bind variable syntax.

Application Express Architecture Diagram
Key Features
The sections that follow describe key features of Oracle Application Express.Reporting
With Oracle Application Express, you can quickly generate HTML reports that display the results of SQL queries. You can also download and print reports in HTML, PDF, RTF (compatible with Microsoft Word), and XLS (compatible with Microsoft Excel) formats.

You can declaratively link reports together to provide drill-down reporting and use bind variables to pass information from session state to a report. Reports support declarative column heading sorting, control breaks, sums, and pagination. Report sorting and pagination can use Partial Page Refresh (PPR) technology to avoid refreshing the entire page. You can also add declarative links to a report to download the report data to CSV or XML formats. Plus, you can customize the report appearance using templates.

Using wizards, you can easily create forms on tables or on a stored procedure. When creating a form on a table, these wizards provide automatic management of insert, update, and delete as well as lost update detection. Once you create a form, you can rearrange form fields (called form items) using a visual representation, enabling you to quickly achieve the layout you want. Form items offer a variety of display options including text fields, text areas, radio groups, select lists, check boxes, date pickers, and popup list of values.
Run Download
You can also use wizards to create HTML, SVG, or Flash charts. You can create charts that enable users to drill down from one chart to another chart or report. Charts can also be refreshed using Partial Page Refresh (PPR) technology, avoiding the need to refresh an entire page. You can also configure a chart to refresh at defined intervals. Additionally, you can take advantage of report column templates to add simple HTML bar charts to any report.
Run Download
PDF Printing
As of Application Express 3.0, you can include the ability to export a report region to PDF – essentially, printing a report. A custom link or button can be added to any report region. You can also define Report Queries and Report Layouts under Shared Components. These are custom reports that can be linked anywhere within an application.
Run Download
Web Services
The Application Express Web services engine supports loosely defined types and document style Web services. This makes it possible to support JDeveloper created Web services and Oracle BPEL synchronous Web services. It is also possible to interact with Web services over SSL (HTTPS) and Web services that require basic authentication. Finally, there is also support for manually creating a Web service reference if the Application Express engine cannot correctly parse the WSDL document for a particular service. You supply the SOAP request envelope and the URL endpoint among other information about the Web service.Spreadsheet Upload
Use the Create Application from Spreadsheet Wizard to quickly upload spreadsheet data directly into the database. You can choose to store the data in a new database table or add it to an existing database table. Once the data is uploaded, you can quickly create an application. This handy wizard enables you to go from spreadsheet to a shared application in just a few clicks.

Session State Management
Oracle Application Express transparently manages session state (or application context) in the database. Forms automatically save session state, remembering your application context over your session. Referencing session state within SQL and PL/SQL is as simple as using bind variables. For example, consider the following SELECT statement:


In this example, the value in the item P1_ID is automatically bound when the query is run. You can also reference session state within a static context by prefixing the item name with an ampersand (&) and suffixing it with a period(.), for example:


For management of two dimensional data sets, Oracle Application Express provides a robust collections infrastructure. Best of all, session management is stateless and does not consume any memory.

User Interface Themes
Oracle Application Express separates presentation (or user interface themes) from the application logic. You can design your application in one theme, change to another supplied theme, or create and use your own custom theme. By separating the application logic (such as queries, processes, and branches) from the HTML rendering, your application can take advantage of new designs and other technological advances without an application rewrite.

Flow Control and Navigation
Every Web application needs navigation and dynamic applications need flow control. Oracle Application Express provides built-in components to simplify the development and maintenance of navigational controls. Navigation is controlled using declarative tabs (one or two levels), breadcrumbs, tree controls, and lists of links. Flow control is performed using declarative branches that can take effect at specific events and under certain conditions. The appearance of navigation controls are managed through templates, making it easy to change from one look to another.

Conditionality on All Components
When creating dynamic Web applications, many application components and processing are conditional. In other words, you only show or process certain pieces of information based on the application context, the data, an event, or a privilege. Oracle Application Express enables you to declaratively specify conditionality of all components. This gives you exact control over what users see or do not see on a tab, button, item, list entry, and so on.

External Interfaces and Extensibility
Even though Oracle Application Express provides a robust declarative environment for building applications, you also have the option of developing custom interfaces or controls. For example, if a component does not meet the needs of your environment, you can generate your own custom HTML using PL/SQL. You can also call external services using Web services. Oracle Application Express also includes APIs to easily integrate email alerts into an application. Plus, because Oracle Application Express resides in the Oracle database, you can take advantage of inherent database capabilities, including external tables, PL/SQL, database links, gateways, and database Java to extend the functionality of your application.

With Oracle Application Express, you can create public applications that do not require a user log in, or you can create secure applications that require authentication. Oracle Application Express provides a number of built-in authentication schemes including Single Sign On, Database Account Credentials, and an easy-to-use user management system. You can also use custom schemes that interface with just about any authentication service including Microsoft Active Directory and Oracle Applications.

Additionally, you can customize authorization to meet the needs of your environment and apply authorization selectively to an entire application, a page, or a page component. Finally, you can also take advantage of an innovative session state protection feature to prevent URL tampering and built-in features to protect an application form SQL Injection and cross-site scripting (XSS) attacks.

SQL Workshop Tools
SQL Workshop provides tools to enable you to view and manage database objects from a Web browser. Use SQL Commands to run SQL and PL/SQL statements. Query Builder enables you to define queries by dragging and dropping tables and easily create relationships between objects. Object Browser provides an easy-to-use graphical user interface for viewing, creating, modifying, browsing, and dropping database objects. Finally, you can use SQL Scripts to create, edit, view, run, and delete script files.

Supporting Objects Utility
You can simplify the steps needed to export and install an application in another Oracle Application Express by creating a packaged application. Using the Supporting Objects utility, you can bundle the application definition with scripts for creating the database objects, seed data, images, cascading style sheets, and JavaScript.

Creating a packaged application provides application users with an installer-like experience and automates the process of importing and installing an application in another development, test, or even production instance.

Oracle Application Express provides application developers and application users with an extremely high level of performance. Because Oracle Application Express resides in the Oracle database, it has minimal impact on network traffic. Plus, Application Builder includes a large number of monitoring reports to enable you to identify and tune application performance.

Packaged Applications
Packaged Applications are fully functional applications that you can use and customize. Packaged applications not only illustrate interesting examples of Oracle Application Express applications, but they provide immediately useful tactical business applications. Packaged applications are ready-to-run – they come complete with database schema, seed data, images, application definitions, everything you need and installation is via a simple to use wizard.

Packaged Applications
Hosted Development
Oracle Application Express enables a single database to host large numbers of users. Users work in a dedicated work area called a workspace. This flexible architecture enables a single database instance to manage thousands of applications.You determine how the process of provisioning (or creating) a workspace works. In request provision mode, users request a workspace using a link on the login page. After the workspace request has been granted, users receive an email containing a link that they must click to verify the validity of their email address. Then they receive an email with their login credentials.

Jika anda mempunyai data yang ratusan atau bahkan ribuan record, bagaimana cara cepat utuk bisa melakukan entry ke dalam database, atau melakukan perubahan data yang kita nggak tau perbedaan data mana saja. Kejadian ini sering kali terjadi di perkantoran atau malah di tingkat admin data. Jika anda melakukan entry satu-satu, wah waktu anda pasti akan habis terbuang.

Dalam kesempatan ini, saya ujicoba melakukan entry ke dalam sebuah table dan melakukan perubahan di dalam satu table. Database servernya : MS SQL Server 2000, asal data dari Excel. Trik ini adalah sebagai berikut :

  • Siapkan MS Access 2000/3, dan buat file database baru.
  • Buat koneksi database SQL Server dari ODBC local komputer andaodbcad32.jpgodbcad324.jpgodbcad323.jpg
  • Select semua data yang ada di dalam excel anda dan copy paste (Import) ke dalam menu table file MS Access yang telah anda buat.                                      append4.jpg
  • Buat Query Append                                         join.jpgfieldrelasi1.jpgappend1.jpgappend2.jpgappend3.jpg
  • Buat Query Update
  • Sukses !!

SQL Server replication allows database administrators to distribute data to various servers throughout an organization. You may wish to implement replication in your organization for a number of reasons, such as:

  • Load balancing. Replication allows you to disseminate your data to a number of servers and then distribute the query load among those servers.
  • Offline processing. You may wish to manipulate data from your database on a machine that is not always connected to the network.
  • Redundancy. Replication allows you to build a fail-over database server that’s ready to pick up the processing load at a moment’s notice.

In any replication scenario, there are two main components:

  • Publishers have data to offer to other servers. Any given replication scheme may have one or more publishers.
  • Subscribers are database servers that wish to receive updates from the Publisher when data is modified.

There’s nothing preventing a single system from acting in both of these capacities. In fact, this is often done in large-scale distributed database systems. Microsoft SQL Server supports three types of database replication. This article provides a brief introduction to each of these models, while future articles will explore them in further detail. They are:

  • Snapshot replication acts in the manner its name implies. The publisher simply takes a snapshot of the entire replicated database and shares it with the subscribers. Of course, this is a very time and resource-intensive process. For this reason, most administrators don’t use snapshot replication on a recurring basis for databases that change frequently. There are two scenarios where snapshot replication is commonly used. First, it is used for databases that rarely change. Second, it is used to set a baseline to establish replication between systems while future updates are propagated using transactional or merge replication.
  • Transactional replication offers a more flexible solution for databases that change on a regular basis. With transactional replication, the replication agent monitors the publisher for changes to the database and transmits those changes to the subscribers. This transmission can take place immediately or on a periodic basis.
  • Merge replication allows the publisher and subscriber to independently make changes to the database. Both entities can work without an active network connection. When they are reconnected, the merge replication agent checks for changes on both sets of data and modifies each database accordingly. If changes conflict with each other, it uses a predefined conflict resolution algorithm to determine the appropriate data. Merge replication is commonly used by laptop users and others who can not be constantly connected to the publisher.

Each one of these replication techniques serves a useful purpose and is well-suited to particular database scenarios.

If you’re working with SQL Server 2005, you’ll need to choose your edition based upon your replication needs. Each edition has differing capabilities:

  • Express Edition has extremely limited replication capabilities. It’s able to act as a replication client only.
  • Workgroup Edition adds limited publishing capabilities. It’s able to serve five clients using transactional replication and up to 25 clients usin merge replication. It can also act as a replication client.
  • Standard Edition has full, unlimited replication capabilities with other SQL Server databases.
  • Enterprise Edition adds a powerful tool for those operating in mixed database environments — it’s capable of replication with Oracle databases

As you’ve undoubtedly recognized by this point, SQL Server’s replication capabilities offer database administrators a powerful tool for managing and scaling databases in an enterprise environment.


Blog Stats

  • 138,724 hits



visitor stats
December 2018
« Jan