🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #5020

: in SQL statement

#5020
From: Yongduk Lee
Date: Thu, 23 Aug 2001 08:46
38 lines
1740 bytes
Using ADOQuery, I am trying to send folloing statement.

CREATE TABLE a (a_id CHAR(32) PRIMARY KEY, time_of_op DATE);
CREATE SEQUENCE a_seq;
CREATE TRIGGER a_tri BEFORE INSERT ON aaa FOR EACH ROW
BEGIN
   SELECT CONCAT (TO_CHAR(:new.time_of_op, 'YYYYMMDD'),
               LPAD(a_seq.NEXTVAL, 12, '0')) into :new.du_id FROM DUAL;
END;

Like

   ...
   ...

   ADOQuery1->SQL->Add("CREATE TRIGGER a_tri BEFORE INSERT ON aaa FOR EACH
ROW");
   ADOQuery1->SQL->Add("BEGIN");
   ADOQuery1->SQL->Add("SELECT CONCAT (TO_CHAR(:new.time_of_op, 'YYYYMMDD'),
");
   ADOQuery1->SQL->Add("LPAD(a_seq.NEXTVAL, 12, '0')) into :new.du_id FROM
DUAL;");
   ADOQuery1->SQL->Add("END");
   ADOQuery1->Open();

   ...
   ...

The problem is that ADO thinks :new is the parameter name while it is not,
and
gives me an exception. What should I do? Please help me.

Thanks.

--

Yongduk Lee
ydlee@ssaboo.co.kr
Technical Details
Message-ID: <3b84c211_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,45cd64bbd7c0b0e6,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-08-23 01:45:57 PST
From: "Yongduk Lee" <ydlee@ssaboo.co.kr>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: : in SQL statement
Date: Thu, 23 Aug 2001 17:46:52 +0900
Lines: 41
Organization: Medique Inc.
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 203.230.217.90
Message-ID: <3b84c211_2@dnews>
X-Trace: dnews 998556177 203.230.217.90 (23 Aug 2001 01:42:57 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews