Solved

Oracle && BDE

Posted on 2002-07-12
6
360 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
6 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7148471
you can't

use sql+ instead
0
 
LVL 27

Expert Comment

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

Author Comment

by:asi
ID: 7148578
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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 7148601
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
ID: 7148606
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
ID: 7179533
hello?
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses
Course of the Month9 days, 13 hours left to enroll

624 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