MySQL 5.0 Stored Procedures : Part 3
SO far we have looked at creating a simple procedure, then we added a couple of more lines to make it into a multiline procedure, but after all that our procedure is still a little useless. So let's look at how to make it a little more dynamic by passing in a value (or values) via a parameter.
Again I'll keep things simple, if you want to know more about parameters in programming in general pretty much any book on the subject of programming will have some sort of explanation so I'll leave you to do the research on that. But in essence parameters allow us to pass information in (and in the case of procedures, out) of our stored routines. "Hey, hold on" you all say.... "What's all this routine buisness". I suppose now is as good a time as any to introduce the word routine, so far we have been using the term "Stored Procedure" to mean program elements stored permanently in MySQL. But it's possible to use both functions and procedures, therefore it's good to have a term which covers both and make a distinction when talking explicitly about a procdure rather than routines in general.
...anyway back to parameters. So let's take our "hello world" example a stage further , lets say we wanted to say hello to anybody we chose. We could of course create a procedure for all our users, but a much better solution would be to pass in the name of the person we want to say hello to. I glossed over the () placed at the end of the procedure name in the first part, but it's this that we use to pass the parameters in and out of our routine. By default parameters are classed as IN parameters, this means the procedure will accept values into them, but we can also define them as OUT or even INOUT.
All we need to do is give the parameter a name and a datatype, the datatype can be any valid MySQL datatype that you would use for a column datatype in a table. Once it's defined we can then reference the parameter in our procedure using it's name.
mysql> delimiter //
mysql> create procedure
-> testParam(p_name varchar(30))
-> begin
-> select concat('Hello ',p_name);
-> end
-> //
Query OK, 0 rows affected (0.06 sec)
mysql> call testParam('Bob')//
+-------------------------+
| concat('Hello ',p_name) |
+-------------------------+
| Hello Bob |
+-------------------------+
1 row in set (0.01 sec)
Query OK, 0 rows affected (0.01 sec)
That's all there is to it. We can now just call the procedure using any name we like.
mysql> call testParam('Sue')//
+-------------------------+
| concat('Hello ',p_name) |
+-------------------------+
| Hello Sue |
+-------------------------+
1 row in set (0.00 sec)
Query OK, 0 rows affected (0.00 sec) OK, now for your home work.... This page has information on the different types of parameters.
http://mysql.gilfster.com/page.php?parent_id=1.1&page_id=1.1.6
In the next blog entry I'll be looking at interacting with the database using SQL inside the procedure. I promise that this is going somewhere usefull :)
94 Comments:
reseller hosting package Web Hosting Ecommerce Your source for the latest in the reseller hosting package industry, reseller hosting package News, links and latest reseller hosting package developments.
I am very impressed by your blog, It is full of great information. I found it by searching for " seo promotion " on Google.
I have started a blog directory and would like to personally invite you to post your blog. Its free and will help you in your search rankings.
if you have any questions email me at admin@big3post.com and I will get back to you within a 24 hrs.
Hey, you have a great blog here! I'm definitely going to bookmark you!
I have a hosting canada site/blog. It pretty much covers hosting canada related stuff.
Come and check it out if you get time :-)
Hey, you have a great blog here! I'm definitely going to bookmark you!
I have a counter php script web site/blog. It pretty much covers counter php script web related stuff.
Come and check it out if you get time :-)
Your blog contained issues relating to domain hosting name web
which I found quite absorbing. I would argue that domain hosting name web
matters are best left to the professionals in most cases.
Thanks for the information. I'm always
on the look out for people's opinions. I
run a website about music hosting
so being informed is important to me.
If you ever want to check out my site
about music hosting feel free
everyones welcome.
Yo, This blog is pretty neat. You should check out mine sometime. It pretty much covers make money at home on the internet related stuff.
nice blog enjoyed it :)
Keep up the excellent work! and i bookmarked u!
so cant wait for ur next post! :)
Thanks!!
Hello gilf, I've just been playing Serious Sam 2 before getting down to do some research into cheap web hosting package; on the whole I'd rather continue playing. First place I came to was MySQL 5.0 Stored Procedures : Part 3 so I've been having a good time reading your blog. There are some ideas that I could maybe incorporate into cheap web hosting package to make it more useful. Thank you!
Greetings gilf, I'm looking for information and chat about dns hosting and came across your site. There are some views in MySQL 5.0 Stored Procedures : Part 3 that I can take on board. I used dns hosting as one of my search terms which is how I came to visit your site. Enjoyed the read, I'll make note to come back again.
Hi gilf, this is my last visit on the 'net for now - I'm tired. I found MySQL 5.0 Stored Procedures : Part 3 by accident as I'm searching on cheap web hosting package but I got fed up with that and I've been roaming about just reading what takes my fancy. Good blog you have here, I enjoyed my visit. Have a great day and it's back to cheap web hosting package searches for me tomorrow.
Hi gilf, this is my last visit on the 'net for now - I'm tired. I found MySQL 5.0 Stored Procedures : Part 3 by accident as I'm searching on reseller hosting package but I got fed up with that and I've been roaming about just reading what takes my fancy. Good blog you have here, I enjoyed my visit. Have a great day and it's back to reseller hosting package searches for me tomorrow.
Hello gilf, I've just been playing Serious Sam 2 before getting down to do some research into cold fusion hosting; on the whole I'd rather continue playing. First place I came to was MySQL 5.0 Stored Procedures : Part 3 so I've been having a good time reading your blog. There are some ideas that I could maybe incorporate into cold fusion hosting to make it more useful. Thank you!
Hi gilf, this is my last visit on the 'net for now - I'm tired. I found MySQL 5.0 Stored Procedures : Part 3 by accident as I'm searching on shared hosting plan but I got fed up with that and I've been roaming about just reading what takes my fancy. Good blog you have here, I enjoyed my visit. Have a great day and it's back to shared hosting plan searches for me tomorrow.
G'day gilf, what a great blog you have here, been entertained by the read. Just noticed that my brief time visiting blogs looking for canadian web hosting items has run into a couple of hours. Easily done when you get engrossed in what people write about. I should really use canadian web hosting as a search term but then I might miss places such as MySQL 5.0 Stored Procedures : Part 3. Besides which working all the time is boring.
Hi,
I've put up a site related to window web hosting its only been up a couple of days. and i'm still scouting around for information and articles that may be suitable for some of my window web hosting pages. Your window web hostingblog seems to be a good idea, I doubt if my window web hosting site will become as popular... but I suppose that depends on me finding those window web hosting articles.... A well, on with my journey - thanks for reading, hope to see you on my window web hosting site.
Take care
Steward.
Hello,
Just thought I would check out your blog.
I am new to blogging. I hope you don't mind me posting to your blog. If you are interested in checking out my blog and making a post that would be great.
I have a cart hosting shopping web site/blog. It pretty much covers ##WEB HOSTING## related stuff.
Thanks,
Ed
Aloha gilf, I'm in Hawaiian mood as I'm listening to Ki ho'alu music (If you've not heared this type of guitar music then you are in for a treat!) so I'm not really concentrating very hard but I came across MySQL 5.0 Stored Procedures : Part 3 looking up gen on cold fusion hosting. Anything to do with cold fusion hosting I always look at, though I do have a tendency to wander about in blogs just reading generally.
Hi gilf, oh dear, I'm getting square eyed here - must have been spending too much time reading blogs and cheap web hosting package information. I'm supposed to be looking for cheap web hosting package items but I find it all too easy just to click 'Next' and just see anything which is how I came to MySQL 5.0 Stored Procedures : Part 3. Some blogs I just skip through but I spent a while here. Ciao.
Greetings gilf, I'm looking for information and chat about imageshack hosting and came across your site. There are some views in MySQL 5.0 Stored Procedures : Part 3 that I can take on board. I used imageshack hosting as one of my search terms which is how I came to visit your site. Enjoyed the read, I'll make note to come back again.
Aloha gilf, I'm in Hawaiian mood as I'm listening to Ki ho'alu music (If you've not heared this type of guitar music then you are in for a treat!) so I'm not really concentrating very hard but I came across MySQL 5.0 Stored Procedures : Part 3 looking up gen on cold fusion hosting. Anything to do with cold fusion hosting I always look at, though I do have a tendency to wander about in blogs just reading generally.
Hey Fellow, you have a great blog here! I have a web
site & blog about website hosting providers.
Yours is top-notch!
If you have a moment, please visit my site
website hosting providers
I wish you all the best!
Hi! since you posted about it, I'm looking everywhere for information about Portable Solar Power . I was told that its possible to find out about Portable Solar Power ...and do well. I'll keep reading , I guess.thanks.
Hey how are you doing? just letting you know that someone from Central America read your blog!
If you feel like visiting mine:
php web hosting
Regards,
Charles
I honestly must say this is one of the most useful blogs I have ever come across. I am not just saying that to butter you up! I am doing my thesis paper for my master degrees and spent the last 12 hours (and 10 cups of coffee) researching this area topic. So many blogs have generic information but yours is different. I can actually apply some of this information to my works. No worries I will give you credit in my references. I took it upon myself to add you to my favorites and will visit back to let you know how my grade ends up. Many thanks!best web page hosting.
I was searching the web and found your entry MySQL 5.0 Stored Procedures : Part 3 I really like your site and found it worth while reading through the posts. I am looking to publish a comprehensive site reviewing many different articles and blogg. Please feel free to take a look at my blog at free web hosting mysql and add anything your want.
A lot of interest for your blog and a great deal of discussion. Great sites to surf home based business, domain name, domain reseller, au domain, free website, online business, home based business, electric scooter, xbox360!
A lot of interest for your blog and a great deal of discussion. Great sites to surf domain name resale, domain name, domain reseller, au domain, free website, online business, home based business, electric scooter, xbox360!
Hi There! Really cool site . Ok so I'm always searching for this kind of stuff.
I have this fascination thing. Keep up the good work!
All Blessings,Solar Power Energy
Hello! Blog surfing(as usual) and I found you guys. Nice feeling here. I'll come back . Keep up more stuff about Alternate Energy Sources, please.
All the best, Alternate Energy Sources
Hi All! Like your site. found it surfing for my favorite topic!! Keep sharing!
All the best,Solar Power Energy
Greetings, I was reading some blogs and happened on your blog. I'm quite impressed , with how it has a good feel.
Look forward to reading more.
Regards,
Degree MSN online
Hi my friends! I'm writing to you because I just came across a business that I think has great potential. It lets you save money on almost everything. Make money from almost everything, Including home loans- plus... help lower your taxes--best of all--it requires absolutely no investment. I thought you might be interested and like to check it out...
Here I have a money making internet business site/blog. It successfully covers money making internet business related stuff and almost everything else!
Come and check it out if you get time, Scott.
Hi my friends! I'm writing to you because I just came across a business that I think has great potential. It lets you save money on almost everything. Make money from almost everything, Including home loans- plus... help lower your taxes--best of all--it requires absolutely no investment. I thought you might be interested and like to check it out...
Here I have a multi-level marketing site/blog. It successfully covers multi-level marketing related stuff and almost everything else!
Come and check it out if you get time, Scott.
If you want to save 20 to 30 cents a gallon at the pump check this site out. I mean really check it out. This is backed by the goverment and some very big company's.http://www.gasclubusa.net/go/gcmmello/
It is always a pleasure to visit sites like yours. I was searching for some info on make money online at home and arrived at your site. I found it very informative though I was really interested in make money online at home related information.
Drop by my site one of those days if you care to http://www.freemoney.ebizempires.com/
I recently came accross your site site while searching for information on how to make money online. Did not find the info on how to make money online which is what I was really searching for, but found your site to be rather informative.
Great if you can pop over to my site some day http://www.freemoney.ebizempires.com/
Hi ##name##, I've been working with different work at home businesses for 5 yearsfrom home worklooking for something to keep me at home and be my own boss. All help is appreciatedfrom home work
CALIFORNIA WEB HOSTING
Can I Help You.. Yes If you want to get on the web. If you want to start learning about creating a web site of your own.. go to http://webhost11.com. to find out more about corporate webhosting ... We can help find a web host for you.
What in the world is the world...Some people believe that to create is great but build is like changing the past forever... If you want to create a beautiful home Visit Temeculacontractors and you can see what a little change can create..
Thanks for your blog...
http://best-casino-online.t35.com
Best Online Casino
I just came across your blog and wanted to
drop you, Blogger, a note telling you how impressed I was with
the information you have posted here.
If you have a moment, please visit my site:
make money
It covers make money related contents.
I send you warm regards and wish you continued success.
Congratulations Friend for your excellent blog on make money!Keep up the good work!
If you have a moment, please visit my site:
make money
I send you my warm regards and wish you continued success.
Have a nice day! :-)
Good work I liked your posting about server crash
You can find a fantastic database backup tool at http://www.databasebackup.co.uk
backup your database before it is to late......
I just came across your blog and wanted to
drop you a note telling you, Friend, how impressed I was with it.
I give you my best wishes for your future endeavors.
If you have a moment, please visit my site:
make money
It covers make money related contents.
All the best!
Great online casino Gold is pure so win more at the Golden Internet Casino
I just came across your blog and wanted to
drop you a note telling you, Friend, how impressed I was with it.
I give you my best wishes for your future endeavors.
If you have a moment, please visit my site:
make money
It covers make money related contents.
All the best!
Hi, Fellow!I like your blog!
I just came across your blog and wanted to
drop you a note telling you how impressed I was with
the information you have posted here.
I have a make money
site. It pretty much covers make money related subjects.
Come and check it out if you get time :-)
Best regards!
Hello Friend! I just came across your blog and wanted to
drop you a note telling you how impressed I was with
the information you have posted here.
I also have a web site & blog about make money so I know I'm talking
about when I say yours is top-notch! Keep up the
great work, you are providing a great resource on the Internet here!
If you have a moment, please visit my site make money
Best success!
I was searching blogs,and I found your site.Please,
accept my congratulations for your excellent work!
If you have a moment, please visit my site:
make money
It pretty much covers make money related issues.
Have a good day!
Hi Fellow! I was just searching blogs,and I found your site! I like it!
If you have a moment, please visit my site:
domain names
It covers domain names related contents.
All the best!
I just came across your blog and wanted to
drop you a note telling you, Friend, how impressed I was with it.
I give you my best wishes for your future endeavors.
If you have a moment, please visit my site:
domain names
It covers domain names related contents.
All the best!
I was searching blogs,and I found your site.Please,
accept my congratulations for your excellent work!
If you have a moment, please visit my site:
domain names
It pretty much covers domain names related issues.
Have a good day!
Hi Blogger! I like your blog! Keep up the
good work, you are providing a great resource on the Internet here!
If you have a moment, please take a look at my site:
domain names
It pretty much covers domain names related issues.
Best regards!
Sure, making money online is possible! Take www.richin2006.com. This guy will show you how to work from home and earn cash. It belongs to a marketer who wants to help you succeed online. Check it out! Become Rich in 2006!
Your blog I found to be very interesting!
I just came across your blog and wanted to
drop you a note telling you how impressed I was with
the information you have posted here.
I have a photography starting a home business
site.
Come and check it out if you get time :-)
Best regards!
Hey Fellow, you have a top-notch blog here!
If you have a moment, please have a look at my online home based business opportunity site.
Good luck!
Your blog I found to be very interesting!
I just came across your blog and wanted to
drop you a note telling you how impressed I was with
the information you have posted here.
I have a nevada home business opportunity
site.
Come and check it out if you get time :-)
Best regards!
Hi there Blogger, a real useful blog.Keep with the good work.
If you have a moment, please visit my most successful home business site.
I send you warm regards and wishes of continued success.
A fantastic blog yours. Keep it up.
If you have a moment, please visit my money do you make site.
I send you warm regards and wish you continued success.
Hey Fellow, you have a top-notch blog here!
If you have a moment, please have a look at my mlm home business site.
Good luck!
What a nice blog you have here. Amazing. I just came from a foxwoods casino blog online. And, I actually won money online! Check this internet casino site.
We have a huge choice of real money tables so you don't have to hang around for hours waiting to get a game. Online Poker Tables like PartyPoker PacificPoker TitanPoker FultitPoker and so on
http://blog.myspace.com/pokerings
Hey Fellow, you have a top-notch blog here!
If you have a moment, please have a look at my make real money online site.
Good luck!
Join with us and receive all the FreeRolls from teh second they appear on the web. Practice for free and later play for real money liek a Pro!!! free poker http://blog.myspace.com/pokerings
Debt Consolidation
Debt Help can help you reduce your interest burden by charging an interest rate lower than the rate on your existing loans. Debt consolidation loan can also allow you to make small monthly payments by extending the loan period
http://www.debt1consolidation.com
Hi Friend! You have a great blog over here!
Please accept my compliments and wishes for your happiness and success!
If you have a moment, please take a look at my make money using the internet site.
Have a great day!
Hi Blogger, I found your blog quite informative.
I just came across your blog and wanted to
drop you a note telling you how impressed I was with it.
I give you my best wishes for your future endeavors.
If you have a moment, please visit my make money web site.
Have a great week!
Hey, you have a great blog here! I'm definitely going to bookmark you!
I have a make money using the internet site.
Come and check it out if you get time :-)
Greetings.
a great opportunity, no selling, no phoning, no recruiting PERIOD!
What are you looking for today?
Hello Friend! I just came across your blog and wanted to
drop you a note telling you how impressed I was with
the information you have posted here.
Keep up the great work, you are providing a great resource on the Internet here!
If you have a moment, please make a visit to my .net domain names for site.
Good luck in your endeavors!
Hey, you have a great blog here! I'm definitely going to bookmark you!
I have a .art domain names site.
Come and check it out if you get time :-)
Greetings.
I am here because of search results for blogs with a related topic to mine.
Please,accept my congratulations for your excellent work!
I have a .travel domain registration site.
Come and check it out if you get time :-)
Best regards!
Hello Friend! I just came across your blog and wanted to
drop you a note telling you how impressed I was with
the information you have posted here.
Keep up the great work, you are providing a great resource on the Internet here!
If you have a moment, please make a visit to my make money taking survey site.
Good luck in your endeavors!
I was searching blogs,and I found yours.Please,
accept my congratulations for your excellent work!
If you have a moment, please visit my make money survey take site.
Have a good day!
Your blog I found to be very interesting!
I just came across your blog and wanted to
drop you a note telling you how impressed I was with
the information you have posted here.
I have a absolutely free domain names
site.
Come and check it out if you get time :-)
Best regards!
Hi there Blogger, a real useful blog.Keep with the good work.
If you have a moment, please visit my 1 cheap domain hosting site.
I send you warm regards and wishes of continued success.
Hi there Blogger, a real useful blog.Keep with the good work.
If you have a moment, please visit my 1xrtt internet address site.
I send you warm regards and wishes of continued success.
Hi Blogger, I found your blog quite informative.
I just came across your blog and wanted to
drop you a note telling you how impressed I was with it.
I give you my best wishes for your future endeavors.
If you have a moment, please visit my cheap domain registration and hosting site.
Have a great week!
Dear friends, here is a really cool site that gives you a lot of FREE information that you can really use. Get FREE Daily and Weekly Foreign Exchange Outlook, Rates, Trends and Currency Shifts. Click here: FOREX
Check this out for FREE...
This opportunity says:
"Your Ad" Will Be Instantly Displayed on Thousands of Websites and Read By Over 10 Million People Per Week For FREE, and It Only Takes 60 Seconds To Get Started!
To find out more visit: idea for home-based businesses site. It successfully exposes FREE information covering Traffic and idea for home-based businesses related stuff.
Interesting stuff... I'm going to have to bookmark this and come back later to check it out. Off to work for now. I know, I work late, but there's no traffic!
My first site - download mp3 song
Here it is... FREE advertising, FREE download. No cost to you! Get your FREE download NOW! Make money and get FREE advertising! This is a great program for you to take advantage of... Check this out now for FREE!
To find out more visit: low cost mlm site. It successfully exposes FREE information covering traffic and low cost mlm related stuff. Don't forget, FREE, FREE, FREE!!!
Check this out for FREE...
This opportunity says:
"Your Ad" Will Be Instantly Displayed on Thousands of Websites and Read By Over 10 Million People Per Week For FREE, and It Only Takes 60 Seconds To Get Started!
To find out more visit: PROMOTIONAL site. It successfully exposes FREE information covering Traffic and related stuff.
Your blog I found to be very interesting!
I just came across your blog and wanted to
drop you a note telling you how impressed I was with
the information you have posted here.
I have a bellevue hosting
site.
Come and check it out if you get time :-)
Best regards!
Hello Friend! I just came across your blog and wanted to
drop you a note telling you how impressed I was with
the information you have posted here.
Keep up the great work, you are providing a great resource on the Internet here!
If you have a moment, please make a visit to my check name site site.
Good luck in your endeavors!
http://www.idesirefreedom.com/new home based business opportunity
***Hi, this is Paul. I found this great way of getting phone verified leads FREE.
Discover how you can use the same Million Dollar Recruiting System that I use at NO-CHARGE ,
for the first 30 days! Plus, get a FREE 23-Page Report Called:
�My Million Dollar MLM Recruiting System!�***
http://www.idesirefreedom.com/
Debt Consolidation
Debt Help can help you reduce your interest burden by charging an interest rate lower than the rate on your existing loans. Debt consolidation loan can also allow you to make small monthly payments by extending the loan period
http://www.debt1consolidation.com
Here it is... FREE advertising, FREE download. No cost to you! Get your FREE download NOW! Make money and get FREE advertising! This is a great program for you to take advantage of... Check this out now for FREE!
To find out more visit: residual income opportunities site. It successfully exposes FREE information covering traffic and residual income opportunities related stuff. Don't forget, FREE, FREE, FREE!!!
Debt Consolidation entails taking out one loan to pay off many others. This is often done to secure a lower interest rate, secure a fixed interest rate or for the convenience of servicing only one loan.
Debt consolidation can simply be from a number of unsecured loans into another unsecured loan, but more often it involves a secured loan against an asset that serves as collateral, which is most commonly a house (in this case a mortgage is secured against the house.) The collateralization of the loan allows a lower interest rate than without it, because by collateralizing, the asset owner agrees to allow the forced sale (foreclosure) of the asset in order to pay back the loan. The risk to the lender is reduced so the interest rate offered is lower.
Sometimes, debt consolidation companies can discount the amount of the loan. When the debtor is in danger of bankruptcy, the debt consolidator will buy the loan at a discount. A prudent debtor can shop around for consolidators who will pass along some of the savings. Consolidation can affect the ability of the debtor to discharge debts in bankruptcy, so the decision to consolidate must be weighed carefully.
Debt consolidation is often advisable in theory when someone is paying credit card debt. Credit cards can carry a much larger interest rate than even an unsecured loan from a bank. Debtors with property such as a home or car may get a lower rate through a secured loan using their property as collateral. Then the total interest and the total cash flow paid towards the debt is lower allowing the debt to be paid off sooner, incurring less interest. In practice, many people are in credit card debt because they spend more than their income. If that habit continues, the consolidation will not benefit them much because they will simply increase their credit card balances again.
Because of the theoretical advantage that debt consolidation offers a consumer that has high interest debt balances, companies can take advantage of that benefit of refinancing to charge very high fees in the debt consolidation loan. Sometimes these fees are near the state maximum for mortgage fees. In addition, some unscrupulous companies will knowingly wait until a client has backed themselves into a corner and must refinance in order to consolidate and pay off bills that they are behind on the payments. If the client does not refinance they may lose their house, so they are willing to pay any allowable fee to complete the debt consolidation. In some cases the situation is that the client does not have enough time to shop for another lender with lower fees and may not even be fully aware of them. This practice is known as predatory lending. Certainly many, if not most, debt consolidation transactions do not involve predatory lending.
Student Loan Consolidation
In the United States, federal student loans are consolidated somewhat differently, as federal student loans are guaranteed by the U.S. government. In a federal student loan consolidation, existing loans are purchased and closed by a loan consolidation company or by the Department of Education (depending on what type of federal student loan the borrower holds). Interest rates for the consolidation are based on that year's student loan rate, which is in turn based on the 91-day Treasury bill rate at the last auction in May of each calendar year.
Student loan rates can fluctuate from the current low of 4.70% to a maximum of 8.25% for federal Stafford loans, 9% for PLUS loans. The current consolidation program allows students to consolidate once with a private lender, and reconsolidate again only with the Department of Education. Upon consolidation, a fixed interest rate is set based on the then-current interest rate. Reconsolidating does not change that rate. If the student combines loans of different types and rates into one new consolidation loan, a weighted average calculation will establish the appropriate rate based on the then-current interest rates of the different loans being consolidated together.
Federal student loan consolidation is often referred to as refinancing, which is incorrect because the loan rates are not changed, merely locked in. Unlike private sector debt consolidation, student loan consolidation does not incur any fees for the borrower; private companies make money on student loan consolidation by reaping subsidies from the federal government.
Student loan consolidation can be beneficial to students' credit rating, but it's important to note that not all federal student loan consolidation companies report their loans to all credit bureaus; Experian or Transunion, which means that students will have differing credit scores at Equifax Transunion, and Experian.
Mortgage Loan Types
There are many types of mortgage loans. The two basic types of amortized loans are the fixed rate mortgage (FRM) and adjustable rate mortgage.
In a FRM, the interest rate, and hence monthly payment, remains fixed for the life (or term) of the loan. In the U.S., the term is usually for 10, 15, 20, or 30 years. The only increase a consumer might see in their monthly payments would result from an increase in their property taxes or insurance rates (paid using an escrow account, if they've opted to use an escrow). But payments for principal and interest will be consistent throughout the life of the loan using an FRM.
In an ARM, the interest rate is fixed for a period of time, after which it will periodically (annually or monthly) adjust up or down to some market index. Common indices in the U.S. include the Prime Rate, the London Interbank Offered Rate (LIBOR), and the Treasury Index ("T-Bill"). Other indexes like 11th District Cost of Funds Index, COSI, and MTA, are also available but are less popular.
Adjustable rates transfer part of the interest rate risk from the lender to the borrower, and thus are widely used where unpredictable interest rates make fixed rate loans difficult to obtain. Since the risk is transferred, lenders will usually make the initial interest rate of the ARM's note anywhere from 0.5% to 2% lower than the average 30-year fixed rate.
In most scenarios, the savings from an ARM outweigh its risks, making them an attractive option for people who are planning to keep a mortgage for ten years or less.
Additionally, lenders rely on credit reports and credit scores derived from them. The higher the score, the more creditworthy the borrower is assumed to be. Favorable interest rates are offered to buyers with high scores. Lower scores indicate higher risk to the lender, and lenders require higher interest rates in such scenarios to compensate for increased risk.
A partial amortization or balloon loan is one where the amount of monthly payments due are calculated (amortized) over a certain term, but the outstanding principal balance is due at some point short of that term. This payment is sometimes referred to as a "balloon payment". A balloon loan can be either a Fixed or Adjustable in terms of the Interest Rate. Many Second Trust mortgages use this feature. The most common way of describing a ''balloon loan'' uses the terminology X due in Y, where X is the number of years over which the loan is amortized, and Y is the year in which the principal balance is due. A contract could be written up so there would be more than one "balloon payment" required to be paid during the life of the loan.
Other loan types
Assumed mortgage
Blanket loan
Bridge loan
Budget loan
Commercial Loan
Deed of trust
Equity loan
Hard money loan
Jumbo mortgages
Package loan
Participation mortgage
Reverse mortgage
Repayment mortgage
Seasoned mortgage
Term loan or Interest-only loan
Wraparound mortgage
Negative amortization loan
Non-Conforming Mortgage
Debt Consolidation entails taking out one loan to pay off many others. This is often done to secure a lower interest rate, secure a fixed interest rate or for the convenience of servicing only one loan.
Debt consolidation can simply be from a number of unsecured loans into another unsecured loan, but more often it involves a secured loan against an asset that serves as collateral, which is most commonly a house (in this case a mortgage is secured against the house.) The collateralization of the loan allows a lower interest rate than without it, because by collateralizing, the asset owner agrees to allow the forced sale (foreclosure) of the asset in order to pay back the loan. The risk to the lender is reduced so the interest rate offered is lower.
Sometimes, debt consolidation companies can discount the amount of the loan. When the debtor is in danger of bankruptcy, the debt consolidator will buy the loan at a discount. A prudent debtor can shop around for consolidators who will pass along some of the savings. Consolidation can affect the ability of the debtor to discharge debts in bankruptcy, so the decision to consolidate must be weighed carefully.
Debt consolidation is often advisable in theory when someone is paying credit card debt. Credit cards can carry a much larger interest rate than even an unsecured loan from a bank. Debtors with property such as a home or car may get a lower rate through a secured loan using their property as collateral. Then the total interest and the total cash flow paid towards the debt is lower allowing the debt to be paid off sooner, incurring less interest. In practice, many people are in credit card debt because they spend more than their income. If that habit continues, the consolidation will not benefit them much because they will simply increase their credit card balances again.
Because of the theoretical advantage that debt consolidation offers a consumer that has high interest debt balances, companies can take advantage of that benefit of refinancing to charge very high fees in the debt consolidation loan. Sometimes these fees are near the state maximum for mortgage fees. In addition, some unscrupulous companies will knowingly wait until a client has backed themselves into a corner and must refinance in order to consolidate and pay off bills that they are behind on the payments. If the client does not refinance they may lose their house, so they are willing to pay any allowable fee to complete the debt consolidation. In some cases the situation is that the client does not have enough time to shop for another lender with lower fees and may not even be fully aware of them. This practice is known as predatory lending. Certainly many, if not most, debt consolidation transactions do not involve predatory lending.
Student Loan Consolidation
In the United States, federal student loans are consolidated somewhat differently, as federal student loans are guaranteed by the U.S. government. In a federal student loan consolidation, existing loans are purchased and closed by a loan consolidation company or by the Department of Education (depending on what type of federal student loan the borrower holds). Interest rates for the consolidation are based on that year's student loan rate, which is in turn based on the 91-day Treasury bill rate at the last auction in May of each calendar year.
Student loan rates can fluctuate from the current low of 4.70% to a maximum of 8.25% for federal Stafford loans, 9% for PLUS loans. The current consolidation program allows students to consolidate once with a private lender, and reconsolidate again only with the Department of Education. Upon consolidation, a fixed interest rate is set based on the then-current interest rate. Reconsolidating does not change that rate. If the student combines loans of different types and rates into one new consolidation loan, a weighted average calculation will establish the appropriate ra