๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: in SQL statement

#4905
From: Carlos
Date: Wed, 29 Aug 2001 11:03
47 lines
1963 bytes
You can try ADOQuery1->ParamCheck = false;


"Yongduk Lee" <ydlee@ssaboo.co.kr> escribi๏ฟฝ en el mensaje
news:3b84c211_2@dnews...
> 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: <3b8ccc08_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!howland.erols.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews
References: <3b84c211_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,45cd64bbd7c0b0e6
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-08-29 04:09:00 PST
From: "Carlos" <shangri-la@teleline.es>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3b84c211_2@dnews>
Subject: Re: in SQL statement
Date: Wed, 29 Aug 2001 13:03:34 +0200
Lines: 49
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
NNTP-Posting-Host: 212.87.195.174
Message-ID: <3b8ccc08_1@dnews>
X-Trace: dnews 999083016 212.87.195.174 (29 Aug 2001 04:03:36 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!howland.erols.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews