CanaimaSoft
f90SQL
Search
Contents
f90ADO
Links
f90VB
 
 
 

F90SQL-Wizard: RAD for f90SQL/Fortran Applications

Module Wizard

The Module Wizard is Canaima Software's answer to suggestions made by many of our customers. You wanted an easier way to use f90SQL, we are giving you a tool that makes it so easy that you don't even have to read the f90SQL manuals to create simple Fortran/f90SQL applications. The Module Wizard generates Fortran modules that make executing and retrieving queries from your Fortran program as simple as writing a few lines of code (about 15, in fact).

With the Module Wizard, you enter a query you want your application to execute. Click one button and you'll get the column and parameter bindings of your query. Click a second button and a Fortran Data Access Module is generated.

The Data Access Module takes care of all the details of accessing the database. You USE this module in your Fortran application, which only needs a few lines of code. The screen shots below show you a simple session demonstrating how easy the whole process is.

Here you enter the query that you'll use in your main application. In this case it is a simple SELECT query, but the Module Wizard can handle all types of queries, including INSERT, UPDATE and DELETE. If you are not proficient with the SQL language, you can use the Query Assistant to generate the SQL statement of your query. Once you have entered your query, you ask the Module Wizard to generate a set of column and parameter bindings that you can customize.
You can now request the Module Wizard to generate a Data Access Module. The Data Access Module is ready to be used in your main application, it exposes a set of functions and subroutines that encapsulate the complexity of accessing and changing data in your database. The query columns are exposed as normal Fortran vvariables, ready for you to use.
Here is an example of the main program you would write to access your data through the Data Access module. The whole process could take only a few minutes. Now, this is Rapid Application Development (RAD) for Fortran!
program WizardExample

!load f90SQL definitions
use f90SQLConstants
use f90SQLStructures
!load Wizard-generated module
use f90SQLWzrd

implicit none

!Used to store return arguments of f90SQLWzrd subroutines
integer(SQLRETURN_KIND)::iRet

!Initialize module f90SQLWzrd
call f90SQLWzrd_Init(iRet)

!Open the connection to the database
call f90SQLWzrd_OpenConn(iRet)

!Execute the query
call f90SQLWzrd_ExecQuery(iRet)

!Fetch first row of the result set returned by the query
call f90SQLWzrd_Fetch(iRet)

do while (iRet.eq.SQL_SUCCESS .or. iRet.eq.SQL_SUCCESS_WITH_INFO)

!Print book title and ISBN number
write (*,'(a40,3x,a5,a13)') trim(f90SQLWzrd_Title), 'ISBN:', trim(f90SQLWzrd_ISBN)
!Fetch next row of the result set
call f90SQLWzrd_Fetch(iRet)

enddo


!Close the connection to the database
call f90SQLWzrd_CloseConn(iRet)

!Terminate the f90SQLWzrd module
call f90SQLWzrd_Terminate(iRet)

stop
end

Copyright © 1998-2000 Canaima Software
For questions regarding this site, send an e-mail to
webmaster@canaimasoft.com