Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 19 of 19 total
Thread PSQL Help
Wed, Jan 3 2007 9:50 PMPermanent Link

Steve Forbes

Team Elevate Team Elevate

Hi Tim,

The PSQL doco is a good start, but currently does not contain any "real"
usage examples. For example the START TRANSACTION example should not only
include the syntax for that statement, but the context in which it is used
i.e. a START TRANSACTION, COMMIT/ROLLBACK block. It also seems that the
START TRANSACTION statement needs a semi-colon at the end, this should be
included in the example as well.

You probably have all this planned, I know the PSQL doco is a work in
progress, but I thought it worthwhile mentioning.

--
Best regards

Steve

"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
news:8F567FF9-A721-4BD8-9FD4-818FA66AD9E7@news.elevatesoft.com...

Wed, Jan 3 2007 9:55 PMPermanent Link

Steve Forbes

Team Elevate Team Elevate

Hi Tim,

> Okay, here's the translation (off the top of my head, not tested):

Pretty close Wink

The following gets an error on the BEGIN (after START TRANSACTION). If I
remove BEGIN, I then get an error at EXCEPTION which is not recognised as
PSQL language element ..

Best regards

Steve

CREATE PROCEDURE PROC_INSERT_BOOK(
 NewName VarChar(60),
 NewId Integer,
 OUT Success Boolean)
BEGIN
 DECLARE NewLeft INTEGER DEFAULT 0;
 DECLARE CategoryCursor SENSITIVE CURSOR FOR CategoryStatement;

 SET Success = FALSE;

 START TRANSACTION;
 BEGIN
   PREPARE CategoryStatement FROM 'SELECT TreeRight FROM Category
WHERE Id = 1';
   OPEN CategoryCursor;

   IF ROWCOUNT(CategoryCursor) > 0 THEN
     FETCH FIRST FROM CategoryCursor (TreeRight) INTO NewLeft;

     UPDATE CategoryCursor SET TreeRight = TreeRight + 2;

     INSERT INTO CategoryCursor (Id, RecordGUID, TreeLeft, TreeRight, Name)
             VALUES (NewId, CURRENT_GUID, NewLeft, NewLeft + 1, NewName);

     COMMIT;

     SET Success = TRUE;
   END IF;
 EXCEPTION
   ROLLBACK;
   RAISE;
 END;
END;

"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
news:210CF137-98EF-4E71-9FC1-97149259F870@news.elevatesoft.com...

Thu, Jan 4 2007 4:32 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Steve,

<< You probably have all this planned, I know the PSQL doco is a work in
progress, but I thought it worthwhile mentioning. >>

Correct, the docs aren't done at all for the SQL/PSM.  The DDL is done if
you want to see what it will look like:

http://www.elevatesoft.com/edb1sql_ddl%20statements.htm

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Jan 4 2007 4:35 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Steve,

<< The following gets an error on the BEGIN (after START TRANSACTION). If I
remove BEGIN, I then get an error at EXCEPTION which is not recognised as
PSQL language element .. >>

Got it.  Fixed.

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Jan 4 2007 4:38 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ole,

<< I understand what you're saying, but IMO this design makes ElevateDB
somewhat awkward to use compared to many RDBMS, and especially so since
regular multi-statement blocks (scripts) are not supported either. >>

Awkward ?  Try Interbase where you can't use DDL at all in a stored
procedure due to the issues with early binding.  Or SQL Server where DDL
causes the stored procedure to be completely re-compiled, thus causing MS to
recommend that all DDL go at the beginning of a stored procedure.  And
forget about how temporary table creation is handled in stored procedures in
these other database engines - major PIA.  None of this is an issue with the
EDB implementation.

<< I fear that Steve (Forbes) and other SQL users might find it hard to port
their SQL routines to dynamic SQL. >>

That's not our main concern - our main concern is to put out the best
implementation that is the easiest to use.  What good is it to put out a
standard implementation that no one wants to use or is a PIA to use ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Jan 4 2007 5:17 PMPermanent Link

Steve Forbes

Team Elevate Team Elevate

Hi Tim

> http://www.elevatesoft.com/edb1sql_ddl%20statements.htm

Cool! You've been a busy boy!
--
Best regards

Steve

"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
news:DABA9B54-BE9C-44B0-9FD6-8EFE92D89FFA@news.elevatesoft.com...
> Steve,
>
> << You probably have all this planned, I know the PSQL doco is a work in
> progress, but I thought it worthwhile mentioning. >>
>
> Correct, the docs aren't done at all for the SQL/PSM.  The DDL is done if
> you want to see what it will look like:
>
> http://www.elevatesoft.com/edb1sql_ddl%20statements.htm
>
> --
> Tim Young
> Elevate Software
> www.elevatesoft.com
>

Fri, Jan 5 2007 4:23 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Steve

I've just had a glance at them. Do you know anyone who gives courses in reading manuals Smiley Its SO different it'll take a while to get used to the stuff.


Roy Lambert
Fri, Jan 5 2007 2:09 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< I've just had a glance at them. Do you know anyone who gives courses in
reading manuals Smiley Its SO different it'll take a while to get used to the
stuff. >>

They've actually been simplified from the notation that is used in the SQL
standards docs. Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com

Sat, Jan 6 2007 5:21 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

><< I've just had a glance at them. Do you know anyone who gives courses in
>reading manuals Smiley Its SO different it'll take a while to get used to the
>stuff. >>
>
>They've actually been simplified from the notation that is used in the SQL
>standards docs. Smiley


OH SHIT    HELP!!!!!!!!

Roy Lambert
« Previous PagePage 2 of 2
Jump to Page:  1 2
Image