Subject RE: [firebird-support] Learning Firebird
Author Alan McDonald
> I have a project that I am planning on using firebird db for hte
> backend. I have a number of questions
>
> 1. MSSQL Primary Keys can autoincrement. What do I do here to get a
> Primary Key. Looks like I need to create a procedure for but would it
> be.
>
> Could someone provide a simple sample of how they solved this problem.

use generators or also called now sequences. Get a copy of the Firebird Book
and read...
Also the Interbase PDF guids, followed by the release notes of the versions
up to and including your chosen version.

>
> 2. Links I see some links but I do not see anything that give concrete
> examples;
> A. How to insert into a table.
> B. How to Update into a table using prcedures.
>
> 3. I am using FlameRobin is there a better IDE?

there are severl around try them - see www.ibphoenix.com for a full list

>
> 4. Here is proc I am attempting to write
>
> CREATE PROCEDURE LAYOUTINSERT
> ( IN_TITLE varchar(50), IN_TABLENAME varchar(50) )
> RETURNS ( OUT_LAYOUTID INT )
> AS
> DECLARE VARIABLE VAR_CURRENT_TIME;
> BEGIN ****This is line 6****
>
> VAR_CURRENT_TIME = current_time;
> OUT_LAYOUTID = (select max(LAYOUTID) from LAYOUT);
>
> INSERT INTO LAYOUT (LAYOUTID, LAYOUTTITLE, CREATEDON, MODIFYON,
> TABLENAME)
> VALUES (OUT_LAYOUTID, IN_TITLE, VAR_CURRENT_TIME, VAR_CURRENT_TIME,
> IN_TABLENAME);
> )
>
> END
>
> I get an error
> Engine Code : 335544569
> Engine Message :
> Dynamic SQL Error
> SQL error code = -104
> Token unknown - line 6, column 1
> BEGIN
>

PSQL doesn't work like this you need to do some reading on who the language
syntax works.

>
> 5. Also how do I a comments
>
>

/* this is a comment inside a procedure or trigger */


Alan