Subject | Learning Firebird |
---|---|
Author | scottremiger |
Post date | 2009-06-27T02:22:52Z |
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.
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?
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
5. Also how do I a comments
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.
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?
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
5. Also how do I a comments