Hello and welcome to the gold and polygamy language course in the previous session.
We could define connect function to communicate to the MySchool database.
And in this time, we want to perform crowd operations by writing different functions.
First, you start by writing the queries related to the select statement, so create the function to
select all the student records and return a student at a
function.
Select all the students.
And return type is a right off model that a student modern, that student
now cutting iconic function for initializing my school driver named on datasource name.
This function returns a DBI object from a school package, which gives us access to the metals contained
in the package to perform craft operations.
So first, define a variable like DB call equals connect.
After creating a DB object from a school package, be invoked query method that it executes a query
that acts it, a school query statement as a string parameter and returns rows and road objects so defined
to variables like rows and rows and column query methods.
Rows and rows.
Column equals DB dots query.
In this case, we want to see all the students in student data, so we should use select queries statement.
So we write select query as a student parameter.
Double quotation mark ends, right?
Select a song from a student.
Now catch Aurora status, if at all
like that.
That's all.
A.
F.
We use the author for closing a created VB object.
The author DV Don Close notes.
We create a list of student strive to act each new, a student that is read from the database, from
the student state ID and at the end of fetching data from the database.
The student list is displayed by the mentors return value, so define the value of like student's column
he calls all day of modern
student
now put the return value of the query inside the full loop to access each of the rows by the next function.
So we write four rows dots next.
Next, function prepares the next result role for Reading with the scan method.
It returns true on success or false if there is no next resolve, and that all happened while preparing
it, so we create an object from a student instruction.
Student calling equals modern art student.
And calling it skin metal on Rose Resort to read records, one by one is scanned copies the colors in
the current roll into the values pointed at by destination.
The number of values in destination must be the same as the number of the columns in rows defiant or
variable and invoke a scan function at all.
He calls Rose the scanner set a student I.D. as pointer.
Student I.D. So the student name the student's name and sits a student page.
Eskom, Converse, Collins read from the database into the following common go times and special time
provided by the issuer package, so check every status.
And continue.
Now at each read that record that contains a student of the least of his students by the app and function,
the app built in function Athens elements to the end of its life, the students he calls upon in the
students, the student.
Now, return as student lease has returned values of function due to its students.
Now we could define the function name, select all as students that fit all students of a student table
in person database by the select the statement.
In order not to prolong the time of decision, we will finish it and we will continue the content in
the next session.
Goodbye.