Subject | Re: [firebird-support] Copying records from a table to other table |
---|---|
Author | Martijn Tonies |
Post date | 2007-01-16T16:21:43Z |
Hi,
insert into cpforneced ( CODEMP, CODFILIAL, CODFOR,
RAZFOR, CODEMPTF, CODFILIALTF, CODTIPOFOR, CODEMPBO,
CODFILIALBO, CODBANCO, NOMEFOR, DATAFOR, ATIVOFOR, PESSOAFOR,
CNPJFOR, CPFFOR, INCFOR, RGFOR, ENDFOR, NUMFOR,
COMPLFOR, BAIRFOR, CEPFOR, CIDFOR, UFFOR, CONTFOR,
FONEFOR, FAXFOR, AGENCIAFOR, CONTAFOR, EMAILFOR )
select 99, 1, co1for.cod_for, ... etc etc
from co1for
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
from a DBF to inside the database.
****
***/
> I know that is a simple mistake mine.you're trying to get data from "co1for", but there's no SELECT statement.
>
> My script is:
> INSERT INTO cpforneced ( CODEMP, CODFILIAL, CODFOR,
> RAZFOR, CODEMPTF, CODFILIALTF, CODTIPOFOR, CODEMPBO,
> CODFILIALBO, CODBANCO, NOMEFOR, DATAFOR, ATIVOFOR, PESSOAFOR,
> CNPJFOR, CPFFOR, INCFOR, RGFOR, ENDFOR, NUMFOR,
> COMPLFOR, BAIRFOR, CEPFOR, CIDFOR, UFFOR, CONTFOR,
> FONEFOR, FAXFOR, AGENCIAFOR, CONTAFOR, EMAILFOR )
> values
> ( 99, 1, c01for.cod_for, c01for.raz_soc, 99, 1, 1,Try:
> NULL, NULL,NULL, c01for.nom_fan, NULL, 'N', c01for.tip_pes,
> c01for.nro_cgc,c01for.nro_cpf,null,c01for.des_end, null,
> null, c01for.bai_end, c01for.cep_end, c01for.nom_cid,
> c01for.sig_est, c01for.nom_con, c01for.fon_001,
> c01for.fax_001,null, null, c01for.end_ema )
>
insert into cpforneced ( CODEMP, CODFILIAL, CODFOR,
RAZFOR, CODEMPTF, CODFILIALTF, CODTIPOFOR, CODEMPBO,
CODFILIALBO, CODBANCO, NOMEFOR, DATAFOR, ATIVOFOR, PESSOAFOR,
CNPJFOR, CPFFOR, INCFOR, RGFOR, ENDFOR, NUMFOR,
COMPLFOR, BAIRFOR, CEPFOR, CIDFOR, UFFOR, CONTFOR,
FONEFOR, FAXFOR, AGENCIAFOR, CONTAFOR, EMAILFOR )
select 99, 1, co1for.cod_for, ... etc etc
from co1for
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
> There the two tables, C01FOR and CPFORNED on the same database, theCPFORNED is the destination and C01FOR is the source data, that was migrate
from a DBF to inside the database.
>/***************************************************************************
> The error that I have is:
>
****
> The next statement causes the following error:****************************************************************************
> Column does not belong to referenced table.
> Dynamic SQL Error.
> SQL error code = -206.
> Column unknown.
> C01FOR.COD_FOR.
> At line 8, column 17.
>
***/
>
> There the table C01FOR and the column COD_FOR normaly.
>
> What I'm doing wrong ?