Solved

Oracle && BDE

Posted on 2002-07-12
6
353 Views
Last Modified: 2013-11-23
What component should i use to define new stored procedure (Oracle) with BDE components ?
I try to define the following sql :
CREATE OR REPLACE TRIGGER triggername
BEFORE INSERT
ON my_table  --must exist, create it if not
FOR EACH ROW
BEGIN
 IF ID IS NULL THEN
   SELECT my_seq.nextval  -- must exist, create it if not

     INTO :NEW.ID  -- :NEW missed
     FROM DUAL;
 END IF;
END;

in TQuery.sql property and tQuery.execSql
 and got error :
Query Field NEW is from unknown type ...
0
Comment
Question by:asi
  • 5
6 Comments
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
you can't

use sql+ instead
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
btw.
this
IF ID IS NULL THEN
 
should be
IF :NEW.ID IS NULL THEN
 
meikl ;-)
0
 

Author Comment

by:asi
Comment Utility
Ok, i finally success to do the following steps:

1)
create table try4 (id number,text_col varchar2(80))
2)
    CREATE OR REPLACE TRIGGER Inc_Field_onTry4
    BEFORE INSERT
    ON try4  --must exist, create it if not
    FOR EACH ROW
    BEGIN
    IF :NEW.ID IS NULL THEN
    SELECT my_seq.nextval  -- must exist, create it if not
    INTO :NEW.ID  -- :NEW missed
    FROM DUAL;
    END IF;
    END;

But when i try to execute
INSERT INTO TRY4 (text_col)  VALUES('as111')  
i got ORA-04098
why ?

;-)asi
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
Comment Utility
ORA-04098 trigger 'string.string' is invalid and failed re-validation
Cause: A trigger was attempted to be retrieved for execution and was found to
be invalid. This also means that compilation/authorization failed for the
trigger.
Action: Options are to resolve the compilation/authorization errors, disable
the trigger, or drop the trigger.

---

your trigger isn't valid

check if the sequence exists,
if yes, create a public synonym for the sequence

check if the table exists,
if no, create it

triggercode itself looks good now

do you have any tool, like toad?
(if not, i guess there is a trial version at www.quest.com)

btw. toad is coded with delphi

it makes your life with oracle a bit easier
(is more comfortable as sql+)

meikl ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
here you can download the trial from toad

http://www.quest.com/requests/?RequestDefID=49

if you have it, you can examine
your trigger and find out what is missed

meikl ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
hello?
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now