473,699 Members | 2,431 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"SQL Statement ignored" and "ORA-01733: virtual column not allowed here" errors

1 New Member
Expand|Select|Wrap|Line Numbers
  1. create or replace trigger emp_trigger
  2.    after update or delete on employee 
  3.    for each row
  4. begin
  5.  if updating then
  6.      insert into empupdate(empno,ename,job,mgr,sysdate,sal,comm,deptno) values(:old.empno,:old.ename,:old.job,:old.mgr,:old.hiredate,:old.sal,:old.comm,:old.deptno);
  7. elsif deleting then 
  8.      insert into empdelete(empno,ename,job,mgr,sysdate,sal,comm,deptno) values(:old.empno,:old.ename,:old.job,:old.mgr,:old.hiredate,:old.sal,:old.comm,:old.deptno);
  9. end if;
  10. end;
  11. /
[Please use CODE tags when posting source code. Thanks! --pbmods]

error is

LINE/COL ERROR
-------- -----------------------------------------------------------------
3/6 PL/SQL: SQL Statement ignored
3/48 PL/SQL: ORA-01733: virtual column not allowed here
5/6 PL/SQL: SQL Statement ignored
5/48 PL/SQL: ORA-01733: virtual column not allowed here
Jun 20 '07 #1
2 18901
pbmods
5,821 Recognized Expert Expert
Changed thread title to better describe the problem (did you know that threads whose titles contain phrases such as 'plz help' actually get FEWER responses?).

Moving to the Oracle forum....
Jun 20 '07 #2
debasisdas
8,127 Recognized Expert Expert
Use this code.
It has been tested.

Expand|Select|Wrap|Line Numbers
  1. CREATE OR REPLACE TRIGGER emp_trigger after UPDATE OR DELETE ON emp FOR each row
  2. begin
  3. IF updating then
  4.      INSERT INTO empupdate(empno,ename,job,mgr,hiredate,sal,comm,deptno) VALUES(:old.empno,:old.ename,:old.job,:old.mgr,:old.hiredate,:old.sal,:old.comm,:old.deptno);
  5. elsif deleting then
  6.      INSERT INTO empdelete(empno,ename,job,mgr,hiredate,sal,comm,deptno) VALUES(:old.empno,:old.ename,:old.job,:old.mgr,:old.hiredate,:old.sal,:old.comm,:old.deptno);
  7. end IF;
  8. end;
  9.  

ERROR IN YOUR CODE
----------------------------------------
1.column name can;t be sysdate as it is a PSEUDO COLUMN
Jun 21 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
6079
by: Ralf | last post by:
Hi ! When I insert a new record to a table "table_A" I want to Grant a Role "Role_X" to the User "User_Y". So I made a Trigger who should do this work, but it doesn't: When I write: "GRANT Role_X TO User_Y" in the Trigger: --> my Trigger ist invalid (error = ora-04098) When I declare a varchar-Variable within the trigger, fill it with:
0
2521
by: Robert Bralic | last post by:
Dear, When I try to connect from J.Developer to ORACLE vith SQL+, it returns me a error: "ORA-12203: TNS:unable to connect to destination". Description is: Cause: Invalid TNS address supplied or destination is not listening. This error can also occur because of underlying network transport problems. Action: Verify that the service name you entered on the command line was correct. Ensure that the listener is running at the remote node...
0
2973
by: Frederick Noronha \(FN\) | last post by:
---------- Forwarded message ---------- Solutions to Everyday User Interface and Programming Problems O'Reilly Releases "Access Cookbook, Second Edition" Sebastopol, CA--Neither reference book nor tutorial, "Access Cookbook, Second Edition" (O'Reilly, US $49.95), by Ken Getz, Paul Litwin, and Andy Baron, delivers hundreds of practical examples, up-to-date suggestions, and handy solutions to real-world problems that Access users and...
1
16223
by: DJ DIGI | last post by:
Hello Everyone, I'm attempting to design a small web app to obtain customer feedback. The issue is when a user inputs >4000 characters in the COMMENTS section I get the following Err Msg: ORA-01704: string literal too long. I am using Visual Studio.Net 2003 (vb as language), SQL+ to create tables in Oracle 9i, and Access to just link and veiw the tables.
16
9184
by: network-admin | last post by:
We have Problems with Access query on Oracle 10g Database with ODBC Connection. The Query_1 is such as select * from xtable where ycolumn <"S" Result = ODBC Faild ----------------------------------------------------
0
1906
by: sangam56 | last post by:
Hi world. I am trying to add Get method in an asp.net dataset (.xsd) file. I am using oledb provider and my select statement supplies a parameter using a colon (:). e.g. :parameter1 It does not accept @ or ?. It works fine when run from query builder but gives problem when i try to preview data in the dataset. The error is: ORA-01008: not all variables bound
7
4440
vikas251074
by: vikas251074 | last post by:
I am getting error above in following code since few days giving tension day and night. How can I solve this? I am facing since Oct.25. in line no. 362 After doing a lot of homework, I am surrendered to you. <%@ Language=VBScript%> <%Option Explicit%>
6
8550
by: viny2cool | last post by:
Hey guys I am trying to create an trigger, but getting this error. My code is as follows CREATE OR REPLACE TRIGGER vendorpricingTR BEFORE UPDATE OF pricing ON vendors FOR EACH ROW DECLARE ActionVar char(6); BEGIN IF UPDATING THEN
0
8615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9034
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8883
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7750
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6534
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5874
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.