1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
| CREATE DATABASE '..\..\Data\Base.fdb' page_size 4096 DEFAULT CHARACTER SET WIN1252;
-- ===========================
-- Création de la table 'temp'
-- ===========================
CREATE TABLE temp
( id INTEGER NOT NULL PRIMARY KEY,
lib VARCHAR(255) NOT NULL
);
-- =====================
-- Insertion dans 'temp'
-- =====================
insert into temp (id, lib) values (1, 'rouge');
insert into temp (id, lib) values (2, 'jaune');
insert into temp (id, lib) values (3, 'bleu');
insert into temp (id, lib) values (4, 'orange');
insert into temp (id, lib) values (5, 'vert');
-- ================
-- Vidage de 'temp'
-- ================
select * from temp;
ID LIB
============ ===============================================================================
1 rouge
2 jaune
3 bleu
4 orange
5 vert
commit;
-- ================
-- Vidage de 'temp'
-- ================
select * from temp;
ID LIB
============ ===============================================================================
1 rouge
2 jaune
3 bleu
4 orange
5 vert
commit;
-- ==================
-- Création Procédure
-- ==================
SET TERM #;
CREATE PROCEDURE proc ()
AS
BEGIN
execute statement 'drop table temp;';
END#
SET TERM ;#
-- =========
-- exécution
-- =========
execute procedure proc;
commit;
-- ================
-- Vidage de 'temp'
-- ================
select * from temp;
Statement failed, SQLSTATE = 42S02
Dynamic SQL Error
-SQL error code = -204
-Table unknown
-TEMP
-At line 1, column 15
At line 61 in file Base_2.sql
quit;
Appuyez sur une touche pour continuer... |
Partager