Home » Developer & Programmer » Forms » how to call database package , after saving the Data
how to call database package , after saving the Data [message #629185] Thu, 04 December 2014 04:09 Go to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Hi all,

I am inserting data into the Table through Form , i have one flag called Update_flag, i am checking and clicking on the SAVE menu from menu option.

After need to fire Database package,for that i called in the key-comit trigger on database block

Ex:

Inserting data into the Table through form and also checking the Update_flag and clicking on the SAVE Menu ,but i am not getting any messages like
'1 record is inserted ' , i am getting only after closing the Form

and also my package is not firing

Can you please help me?

Thanks
Re: how to call database package , after saving the Data [message #629188 is a reply to message #629185] Thu, 04 December 2014 04:17 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
How does the KEY-COMMIT trigger look like?
Re: how to call database package , after saving the Data [message #629189 is a reply to message #629188] Thu, 04 December 2014 04:20 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Quote:
How does the KEY-COMMIT trigger look like?

Thanks for reply Littlefoot , i am just calling packagename.proname
Begin
  Package.proc1;
end;
Re: how to call database package , after saving the Data [message #629192 is a reply to message #629189] Thu, 04 December 2014 04:25 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It looks OK - I believe that such a code really calls the PROC1 that belongs to the PACKAGE.

However, there's no COMMIT in that trigger; that might be a reason why you don't see any message ("1 record is inserted", as you put it).
Re: how to call database package , after saving the Data [message #629194 is a reply to message #629192] Thu, 04 December 2014 04:29 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Quote:

It looks OK - I believe that such a code really calls the PROC1 that belongs to the PACKAGE.

However, there's no COMMIT in that trigger; that might be a reason why you don't see any message ("1 record is inserted", as you put it).

Thanks ,what is the process to do this?

My Requirement is

1) i am inserting Records into the Table with checking Flag and clicking on the SAVE from the Menu , then after need to Fire "Package.proc"

If i did any wrong,please correct me.. Smile
Re: how to call database package , after saving the Data [message #629195 is a reply to message #629194] Thu, 04 December 2014 04:32 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
The process is to follow (i.e. turn English into PL/SQL) what you have just described. Among all the things you want to do, you only called a procedure. Nothing else.
Re: how to call database package , after saving the Data [message #629196 is a reply to message #629195] Thu, 04 December 2014 04:45 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Hi Littlefoot,

Got the point ,but i don't know how to write code , and i am not getting any messages like 'Transaction completed 1 record is Inserted'on the Tool Bar , but before adding key-commit trigger it shows 'Transaction completed 1 record is Inserted'on the Tool Bar
Re: how to call database package , after saving the Data [message #629197 is a reply to message #629196] Thu, 04 December 2014 04:47 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
There's nothing I'd like to add to my previous messages.
Re: how to call database package , after saving the Data [message #629198 is a reply to message #629197] Thu, 04 December 2014 04:51 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Quote:

The process is to follow (i.e. turn English into PL/SQL) what you have just described. Among all the things you want to do, you only called a procedure. Nothing else.

Means??

can you please give me sample code on this?
Re: how to call database package , after saving the Data [message #629201 is a reply to message #629198] Thu, 04 December 2014 05:12 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
key-coomit on Block Level

begin
    do_key('commit_form');
    pakg.proc1;
end;

But it is not firing
Re: how to call database package , after saving the Data [message #629202 is a reply to message #629201] Thu, 04 December 2014 06:43 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
do_key('commit_form') fires the key-commit trigger. So that wouldn't be a good idea.
Just use commit_form.
However, there are ways of saving data that bypass key-commit (exit the form and it'll ask if you want to save changes. If you click on yes it'll save the changes without using key-commit). So you shouldn't use it at all.

What is procedure for?
Re: how to call database package , after saving the Data [message #629204 is a reply to message #629202] Thu, 04 December 2014 06:50 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Quote:
do_key('commit_form') fires the key-commit trigger. So that wouldn't be a good idea.
Just use commit_form.
However, there are ways of saving data that bypass key-commit (exit the form and it'll ask if you want to save changes. If you click on yes it'll save the changes without using key-commit). So you shouldn't use it at all.

What is procedure for?

Thanks for reply cookiemonster,

Ex:

After Inserting the Data in the Form , i am clicking on the SAVE(from The Menu), then after need to fire that Package..

Re: how to call database package , after saving the Data [message #629205 is a reply to message #629204] Thu, 04 December 2014 07:24 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Quote:
However, there's no COMMIT in that trigger; that might be a reason

Yes that is problem, before committing the procedure is firing that's i changed my code ,now it is fine

Thanks
Re: how to call database package , after saving the Data [message #629215 is a reply to message #629204] Thu, 04 December 2014 08:23 Go to previous message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
mist598 wrote on Thu, 04 December 2014 12:50

After Inserting the Data in the Form , i am clicking on the SAVE(from The Menu), then after need to fire that Package..



Do you really think that tells any of us what the package does?

[Updated on: Thu, 04 December 2014 08:23]

Report message to a moderator

Previous Topic: How to sort and query on non database column
Next Topic: When check box changed trigger not working
Goto Forum:
  


Current Time: Fri Apr 19 18:32:14 CDT 2024