[DUG] Interbase Stored Proc

Jeremy Coulter jscoulter at gmail.com
Wed Sep 22 10:44:17 NZST 2010


I did forget to mention we are constrained to IB 7 at the moment, but I will
try the above :-)

Jeremy

On Wed, Sep 22, 2010 at 10:36 AM, Willie Juson <willie.juson at satara.co.nz>wrote:

>  Hi,
>
>
>
> From the Interbase (2007) Language reference manual ......
>
>
>
> “The stored procedure and trigger language does not include many of the
> statement types
>
> available in DSQL or *gpre*. The following statement types are not
> supported in triggers or
>
> stored procedures:
>
> • Data definition language statements: CREATE, ALTER, DROP, DECLARE
> EXTERNAL...” etc etc
>
>
>
>
>
> So I’d say you can’t do it from within a Stored procedure.  You might have
> to do it via  DSQL from your code.
>
>
>
> Firebird would let you do something along the lines of....
>
>
>
> DECLARE VARIABLE SQLSTR VARCHAR(2000);
>
>
>
> BEGIN
>
>   SQLStr = 'Create Table DAR_RESULTS (PATIENTID char(7), TEST_NAME
> varchar(30), WHENRECEIVED date, RESULT varchar(16));';
>
>   EXECUTE STATEMENT SQLStr;
>
> END
>
>
>
> But I take it you’re not using Firebird.....
>
>
>
>
>
> *From:* delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz]
> *On Behalf Of *Jeremy Coulter
> *Sent:* Wednesday, 22 September 2010 9:32 a.m.
> *To:* NZ Borland Developers Group - Delphi List
> *Subject:* [DUG] Interbase Stored Proc
>
>
>
> Hi all.
> I know a few of you out there work with Interbase so I thought I might ask
> the following question here.
>
> I want to create a stored procedure that creates a table. So I am doing :-
>
>
> CREATE PROCEDURE MySP_ AS
> begin
>  create table DAR_RESULTS
> (
> PATIENTID    char(7),
> TEST_NAME    varchar(30),
> WHENRECEIVED date,
> RESULT       varchar(16)
> );
> END
>
>
> However, it doesnt like this and complains avout the "("  althought when I
> removed this it still gave the same error :-)
>
> can someone who knows IB a bit better point me in the right direction?
>
>
> Jeremy
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
> unsubscribe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20100922/36b8e79b/attachment-0001.html 


More information about the Delphi mailing list