Home » Other » Training & Certification » Multiple basic questions from sunilcse1 (merged)
Multiple basic questions from sunilcse1 (merged) [message #278457] Sun, 04 November 2007 08:53 Go to next message
sunilcse1
Messages: 23
Registered: June 2007
Location: Bangalore
Junior Member
can we create index without the create statement.......

[Updated on: Sun, 04 November 2007 09:49] by Moderator

Report message to a moderator

exceptions.... [message #278458 is a reply to message #278457] Sun, 04 November 2007 08:56 Go to previous messageGo to next message
sunilcse1
Messages: 23
Registered: June 2007
Location: Bangalore
Junior Member
can we write WHEN OTHERS before NO_DATA_FOUND exception.....
triggers [message #278459 is a reply to message #278457] Sun, 04 November 2007 08:58 Go to previous messageGo to next message
sunilcse1
Messages: 23
Registered: June 2007
Location: Bangalore
Junior Member
Can we write a trigger that will fire when there is a change in column value?
commit in a trigger [message #278460 is a reply to message #278457] Sun, 04 November 2007 08:59 Go to previous messageGo to next message
sunilcse1
Messages: 23
Registered: June 2007
Location: Bangalore
Junior Member
Can we give commit in a trigger?(no compilation error but execution error will occur)
procedures........ [message #278461 is a reply to message #278457] Sun, 04 November 2007 09:00 Go to previous messageGo to next message
sunilcse1
Messages: 23
Registered: June 2007
Location: Bangalore
Junior Member
How to compile more than one procedure?
cursors [message #278462 is a reply to message #278457] Sun, 04 November 2007 09:02 Go to previous messageGo to next message
sunilcse1
Messages: 23
Registered: June 2007
Location: Bangalore
Junior Member
What is in line cursor?
Re: indexes........ [message #278463 is a reply to message #278457] Sun, 04 November 2007 09:23 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Yes, no, maybe. Why do you ask. Have you looked for the answer?

[Updated on: Sun, 04 November 2007 09:24]

Report message to a moderator

Re: exceptions.... [message #278464 is a reply to message #278458] Sun, 04 November 2007 09:25 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Read the documentation. The answer is BLATANTLY obvious
Re: triggers [message #278465 is a reply to message #278459] Sun, 04 November 2007 09:26 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Documentation, read it!
Re: cursors [message #278466 is a reply to message #278462] Sun, 04 November 2007 09:26 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
A cursor on 1 line?
Re: procedures........ [message #278467 is a reply to message #278461] Sun, 04 November 2007 09:27 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Use COMPILE multiple times
Re: commit in a trigger [message #278468 is a reply to message #278460] Sun, 04 November 2007 09:28 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Read the documentation
Re: triggers [message #278469 is a reply to message #278459] Sun, 04 November 2007 09:42 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Yes

Regards
Michel
Re: procedures........ [message #278470 is a reply to message #278461] Sun, 04 November 2007 09:43 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Put them in a package.

Regards
Michel
Re: commit in a trigger [message #278471 is a reply to message #278460] Sun, 04 November 2007 09:44 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Sometimes.

Regards
Michel
Re: commit in a trigger [message #278488 is a reply to message #278468] Sun, 04 November 2007 13:25 Go to previous messageGo to next message
William Robertson
Messages: 1640
Registered: August 2003
Location: London, UK
Senior Member
It may not be obvious where to look in the documentation. CREATE TRIGGER (SQL Reference) says "The PL/SQL block of a trigger cannot contain transaction control SQL statements (COMMIT, ROLLBACK, SAVEPOINT, and SET CONSTRAINT) if the block is executed within the same transaction", which may leave the OP wondering how the bit about transactions works. The PL/SQL Reference doesn't have anything obvious about commits in the small section on Database Triggers either.

For situations such as logging or auditing, you might want to look at Autonomous Transactions (more details and examples here) which allow you to commit or rollback independently of the calling process.

If the requirement is not to do with logging/auditing (i.e. inserting rows in a table regardless of whether the main process succeeds or fails) then autonomous transactions may not be the right approach, hence Michel's "sometimes". Why do you need to commit in a trigger?
Re: commit in a trigger [message #278490 is a reply to message #278488] Sun, 04 November 2007 13:41 Go to previous message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Given the bunch and level of questions OP posted at the same time, I'm not really sure he is able to understand the answer.

About your question "Why do you need to commit in a trigger?" I'm pretty sure he didn't need anything but answer to some homework or interview questions.

Once again, given the bunch of questions, it is better to point him to the whole documentation and start to really answer when he'll have the basics.

Regards
Michel
Previous Topic: Why should we use foreign keys (and several other questions)
Next Topic: OCP or OCA?
Goto Forum:
  


Current Time: Mon Dec 05 21:00:26 CST 2016

Total time taken to generate the page: 0.13101 seconds