Home » SQL & PL/SQL » SQL & PL/SQL » computing and inserting values into table??
computing and inserting values into table?? [message #205459] Sat, 25 November 2006 00:29 Go to next message
sispk6
Messages: 164
Registered: November 2006
Location: pakistan
Senior Member
hello

i want to save the data in the data base. except (display items which cannot be stored in data base), first i used formaula items for total_amount( given below) and amount_per_installment) but now realize they cant be stored into thedatabase.
( entries in my form willl look like)

loan_id
loan_name
emp_code
first_name--display item based on emp_code selection
last_name--diplay item based on emp_code selection
father_name--diplay based on emp_code selection
loan_amount
markup
total_amount --( loan_amount + (loan_amount*markup/100))
no_oF_installments
amount per installment --- (tot_amount/no_of_installments)
-----------
my biggest problem is i have 2 items principle_balance and status in data block which are not included in the form,
i want to set principle balance so that with each deduction of loan the amount get decremented.
like principle_balance = principle_balance - amount_per_installment;
but the value of principle balance will be set just once at the first time and then use previous value of principle balance and perform deduction in it.
if before
principle_balance = principle_balance - amount_per_installment
i do
principle_bal=total amount;
then on each insertion it will take the value total value which will always be same.
plz help me out what should i do,
how can i insert the data into datablock the way i want



Re: computing and inserting values into table?? [message #205475 is a reply to message #205459] Sat, 25 November 2006 01:56 Go to previous messageGo to next message
Azfar
Messages: 2
Registered: November 2006
Location: PAKISTAN
Junior Member


Try to use calculation on post change trigger like if you write
your code
principle_balance = principle_balance - amount_per_installment
on post change of amount_per_installment then your principle_balance will get chaged as soon as you will leave the field amount_per_installment after entering amount in it. If principle_balance field is a data base item it will update in database too.
Hope this will answer you question if i have understand it correctly.
Re: computing and inserting values into table?? [message #205479 is a reply to message #205475] Sat, 25 November 2006 02:10 Go to previous messageGo to next message
sispk6
Messages: 164
Registered: November 2006
Location: pakistan
Senior Member
YES IF ON POST CHANGE I WRITHE THE CODE
PRINCIPLE BALANCE :=TOT_AMOUNT;
PRINCIPLE:=PRINCIPLE_BALANCE - AMOUNT PER INSTALLMENT;
BUT EACH TIME IT WILL BE EXECUTED
THE PRINCIPLE BALANCE WILL BE SET TO TOT_AMOUNT WHICH IS ALWAYS THE SAME , SO THE PURPOSE OF WRITIN
(((PRINCIPLE:=PRINCIPLE_BALANCE - AMOUNT PER INSTALLMENT;)))
IS NOT FULFILLED HERE
Re: computing and inserting values into table?? [message #205493 is a reply to message #205479] Sat, 25 November 2006 04:11 Go to previous messageGo to next message
Azfar
Messages: 2
Registered: November 2006
Location: PAKISTAN
Junior Member

I GUESS I COULDN'T GET YOUR POINT CORRECTLY TRY THIS ONE
YOU SAID THAT
i want to save the data in the data base. except (display items which cannot be stored in data base), first i used formaula items for total_amount( given below) and amount_per_installment) but now realize they cant be stored into thedatabase.

FORM THIS I GET THAT.. SAVING THE FOMULA ITEM DATA IN DATABASE CAN SERVE YOUR PURPOSE THEN TRY IT LIKE THAT
THERE MUST BE A COLUM IN WHICH THAT DATA IS REQUIRED TO BE SAVE MAKE SURE THAT FIELD IS AVAILABLE IN DATABLOCK YOU CAN SAVE THE FORMULA COLUMN'S DATA IN THAT FIELD BY WRITING CODE ON PRE-INSERT OR PRE-UPDATE OF DATABLOCK AS PER YOUR REQUIREMENT.
HOPE THIS WILL WORK FOR U

REGARDS,
AZFAR
Re: computing and inserting values into table?? [message #206471 is a reply to message #205493] Thu, 30 November 2006 03:58 Go to previous messageGo to next message
lunate
Messages: 74
Registered: October 2006
Location: Pakistan
Member

Quote:
shah g ,javeed sai poch teri problem ambreen say hal karwa day ga.
kyun yahan pay jahk mar raha hay.

main monday ko uni aun ga ,deptt ki sarii bachion ko mera pyar dayna aur kavn ko speacial pyar.

baqi woh CBA walli bachion ka khass khayal rahkna ,aur zubi par bhi nazar rahk na kahin woh meray stah walli bachi kay sath kuch ullta kam na kar day.hehehe Cool



hope u problem is now solved/ Laughing
Re: computing and inserting values into table?? [message #206482 is a reply to message #206471] Thu, 30 November 2006 04:46 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Keep this forum in English please.
Re: computing and inserting values into table?? [message #206485 is a reply to message #206482] Thu, 30 November 2006 04:58 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
What language is that anyway? My guess is Malay.

MHE
Re: computing and inserting values into table?? [message #206496 is a reply to message #206485] Thu, 30 November 2006 05:20 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I know it is not Hungarian ./fa/1599/0/
Re: computing and inserting values into table?? [message #206504 is a reply to message #206496] Thu, 30 November 2006 06:00 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
My guess is it's a latin transcription of Urdu as both posters are from Pakistan.
icon6.gif  Re: computing and inserting values into table?? [message #206803 is a reply to message #206504] Fri, 01 December 2006 10:25 Go to previous messageGo to next message
lunate
Messages: 74
Registered: October 2006
Location: Pakistan
Member

my dear i m class fellow of sispk6 ,and i gave him a private msg in our language urdu ,
so this is urdu not mallay or latin or any othere language.
Laughing
Re: computing and inserting values into table?? [message #206893 is a reply to message #206803] Sat, 02 December 2006 01:06 Go to previous messageGo to next message
sispk6
Messages: 164
Registered: November 2006
Location: pakistan
Senior Member
i posted the topic to get the solution of my problem,
and u ppl dragged me in other matters lolz.
well it is urdu and lunate is my class fellow, but the soultion lunate has provided is not implementable?
by the way? zubi ki shadi hone wali hai? main ne aaj khud poocha uss se.
Re: computing and inserting values into table?? [message #206924 is a reply to message #206893] Sat, 02 December 2006 05:31 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Once again: please, keep this Forum in English ./fa/1707/0/
icon13.gif  Re: computing and inserting values into table?? [message #206957 is a reply to message #206893] Sat, 02 December 2006 12:31 Go to previous message
lunate
Messages: 74
Registered: October 2006
Location: Pakistan
Member

[Mod-Edit: Again, removed non-english text.]

[Updated on: Sat, 02 December 2006 13:55] by Moderator

Report message to a moderator

Previous Topic: Char search
Next Topic: Help !! Insert into a table using cursor/
Goto Forum:
  


Current Time: Fri Dec 02 18:22:29 CST 2016

Total time taken to generate the page: 0.49938 seconds