Subject | Res: [firebird-support] INSERT Multiple Rows same SQL Statment |
---|---|
Author | Luis Carlos Junges |
Post date | 2008-09-30T15:04:29Z |
Hi,
Just let you guys know that worked fine and i decrease my time drastically as i expected.
So if you use it, just make sure you do no use more than 255 relation because you will get the following error:
SQL Error: [ODBC Firebird Driver][Firebird] Dynamic SQL Error
Too many Contexts of Relation/Procedure/Views. Maximum allowed is 255
I will split my single statement it in more statements respecting the 255. I do not know if the executable block proposed by Anderson Farias has this problem also.
my single SQL statement is something like:
INSERT INTO TBCURRENCYQUOTES(BASECURRENCY,QUOTECURRENCY,CURRENCYQUOTEYEAR,PRICE) SELECT 'AUD','AUD','2006','1' FROM RDB$DATABASE UNION ALL SELECT 'AUD','BRL','2006','1' FROM RDB$DATABASE UNION ALL SELECT 'AUD','CAD','2006','1' FROM RDB$DATABASE UNION ALL.....
---
Luís Carlos Dill Junges
"A realidade de cada lugar e de cada época é uma alucinação coletiva."
Bloom, Howard
----- Mensagem original ----
De: Anderson Farias <peixedragao@...>
Para: firebird-support@yahoogroups.com
Enviadas: Quarta-feira, 24 de Setembro de 2008 12:17:06
Assunto: Re: [firebird-support] INSERT Multiple Rows same SQL Statment
Hi Sasha,
But, while this will work for any FB version, I'd go with execute block (if
targeting only newer FB versions) as I *personally* find it more "clean".
Regards,
Anderson Farias
Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara @... ou @....
http://br.new.mail.yahoo.com/addresses
[Non-text portions of this message have been removed]
Just let you guys know that worked fine and i decrease my time drastically as i expected.
So if you use it, just make sure you do no use more than 255 relation because you will get the following error:
SQL Error: [ODBC Firebird Driver][Firebird] Dynamic SQL Error
Too many Contexts of Relation/Procedure/Views. Maximum allowed is 255
I will split my single statement it in more statements respecting the 255. I do not know if the executable block proposed by Anderson Farias has this problem also.
my single SQL statement is something like:
INSERT INTO TBCURRENCYQUOTES(BASECURRENCY,QUOTECURRENCY,CURRENCYQUOTEYEAR,PRICE) SELECT 'AUD','AUD','2006','1' FROM RDB$DATABASE UNION ALL SELECT 'AUD','BRL','2006','1' FROM RDB$DATABASE UNION ALL SELECT 'AUD','CAD','2006','1' FROM RDB$DATABASE UNION ALL.....
---
Luís Carlos Dill Junges
"A realidade de cada lugar e de cada época é uma alucinação coletiva."
Bloom, Howard
----- Mensagem original ----
De: Anderson Farias <peixedragao@...>
Para: firebird-support@yahoogroups.com
Enviadas: Quarta-feira, 24 de Setembro de 2008 12:17:06
Assunto: Re: [firebird-support] INSERT Multiple Rows same SQL Statment
Hi Sasha,
> Those are constants. Something like this:Ok, understood now. =) This is a nice solution.
>
> insert into ...
> select 'foo', 42 from rdb$database ...
>
But, while this will work for any FB version, I'd go with execute block (if
targeting only newer FB versions) as I *personally* find it more "clean".
Regards,
Anderson Farias
Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara @... ou @....
http://br.new.mail.yahoo.com/addresses
[Non-text portions of this message have been removed]