Error No Current Record For Fetch Operation
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up “No current record for fetch operation” for select insert up vote 4 down vote favorite 1 Can anyone see why I'm getting the "No current record for fetch operation" below? I'm successfully skipping duplicate records by catching and not re-throwing the unique key violation exception below. There is another error however. FOR SELECT ... FROM P_SELECT_CLAIM_FILE cf ORDER BY cf.DATESBM, cf.TIMESBM, cf.TRANSCDE INTO ...variables DO BEGIN INSERT INTO CLAIM_TABLE (...) VALUES (...variables); WHEN GDSCODE unique_key_violation DO TX_ID=0; WHEN GDSCODE no_cur_rec DO /* Why does this happen? -508 335544348 no_cur_rec No current record for fetch operation */ EXCEPTION E 'no_cur_rec ' || TX_ID; END The procedure P_SELECT_CLAIM_FILE contains another FOR SELECT INTO with lots of trimming and finally a SUSPEND command. This reads from a fixed width text file. I'm tempted to change this into a single INSERT SELECT where not exists statement. I prefer to make a minimal fix instead however; the holidays already here. firebird firebird1.5 share|improve this question asked Dec 20 '12 at 20:41 jcalfee314 1,3671537 Update, I found a BEFORE INSERT trigger causing the problem. The cursor exception goes away when I disable it. Strange, it is only selecting a value into a NEW variable. –jcalfee3
Bieniaszewski Votes: 0 Watchers: 3 Operations If you were logged in you would be able to see more operations. Firebird Core "no current record for fetch operation" Created: 07/Dec/11 11:56 AM Updated: 13/Dec/11 09:23 AM Component/s: Engine Affects Version/s: 2.1.5, 2.5.2 Fix Version/s: None Environment: SuperServer Windows XP/Win2003 Server Issue Links: Relate This issue is related to: CORE-2812 Prohibit any improper http://stackoverflow.com/questions/13980136/no-current-record-for-fetch-operation-for-select-insert mixture of explicit and implicit joins Description « Hide when i work on query (not finall) i got error like in subject i simplify situation to this 3 tables and one derived table (in my normal solution there are not derived tables then this is not corelated) CREATE TABLE KAT_OBJ http://tracker.firebirdsql.org/browse/CORE-3693 ( ID INTEGER NOT NULL, ID_KAT INTEGER NOT NULL, ID_OBJ INTEGER NOT NULL, CONSTRAINT PK_KAT_OBJ__ID PRIMARY KEY (ID), CONSTRAINT UK_KAT_OBJ__ID_OBJ__ID_KAT UNIQUE (ID_OBJ,ID_KAT) ); CREATE TABLE ZLEC_SERW ( ID BIGINT NOT NULL, ID_OBJ INTEGER, CONSTRAINT PK_ZLEC_SERW__ID PRIMARY KEY (ID) ); CREATE TABLE ZS_ZALACZNIK ( ID BIGINT NOT NULL, ID_ZLEC_SERW BIGINT, ID_OBJ INTEGER, CONSTRAINT PK_ZS_ZALACZNIK__ID PRIMARY KEY (ID) ); CREATE INDEX IXA_KAT_OBJ__ID_KAT ON KAT_OBJ (ID_KAT); CREATE INDEX IXA_KAT_OBJ__ID_OBJ ON KAT_OBJ (ID_OBJ); CREATE INDEX IXA_ZS_ZALACZNIK__ID_OBJ ON ZS_ZALACZNIK (ID_OBJ); CREATE INDEX IXA_ZS_ZALACZNIK__ID_ZLEC_SERW ON ZS_ZALACZNIK (ID_ZLEC_SERW); INSERT INTO KAT_OBJ (ID, ID_KAT, ID_OBJ) VALUES ('1', '2', '456'); INSERT INTO ZLEC_SERW (ID, ID_OBJ) VALUES ('1', '2'); INSERT INTO ZLEC_SERW (ID, ID_OBJ) VALUES ('2', '456'); INSERT INTO ZS_ZALACZNIK (ID, ID_ZLEC_SERW, ID_OBJ) VALUES ('1', '1', NULL); INSERT INTO ZS_ZALACZNIK (ID, ID_ZLEC_SERW, ID_OBJ) VALUES ('2', '2', NULL); SELECT * FROM (SELECT CAST(1 AS INTEGER) AS KAT FROM RDB$DATABASE ) AS KT INNER JOIN KAT_OBJ KO ON KO.ID_KAT=KT.KAT INNER JOIN
IDX_CONTRATTO, IDX_CONTRANNO, IDX_UNARC, DATA_SCADENZA, DATA_MODIFICA, FASCICOLO_STATO, IDX_SCATOLA, IDX_TIPOLOGIA, IDX_TENDINA1, IDX_TENDINA2, IDX_TENDINA3, DATA, IDX_UTENTE1, IDX_UTENTE2, NOTE) AS select tf.idx_fascicolo, tf.idx_contratto, tf.idx_contranno, tf.idx_unarc, http://www.delphigroups.info/2/8/755635.html tu.data_scadenza, tf.data_modifica, tf.fascicolo_stato, idx_scatola, idx_tipologia, t1.idx_dettendina, t2.idx_dettendina, t3.idx_dettendina, tu.data, tu.idx_utente1, tu.idx_utente2, tu.note from tab_fascicoli tf, tab_unarc tu left join tab_valtendine t1 on t1.idx_unarc = tf.idx_unarc and t1.idx_testendina = http://www.activedelphi.com.br/forum/viewtopic.php?t=87444&sid=c02501cff560e5fb534d9d06db6908c5 1 left join tab_valtendine t2 on t2.idx_unarc = tf.idx_unarc and t2.idx_testendina = 2 left join tab_valtendine t3 on t3.idx_unarc = tf.idx_unarc and t3.idx_testendina = 3 where tf.idx_fascicolo error no = tu.idx_fascicolo and tf.idx_unarc = tu.idx_unarc and tf.idx_unarc is not null but when I use it with "where" parameters that do not exist in the database, (es: select * from view_fascicoli where idx_contratto = -12) the following error happen: The cursor identified in the update or delete statement is not positioned on a row. no current error no current record for fetch operation. If I execute a normal "select" statement with the above body, it works well (simply it returns nothing). I am using Interbase 7.5.1 Craig Stuntz [TeamB] Delphi Developer 2006-03-03 10:01:54 PM Re:Error "no current record for fetch operation" alex writes: Quote from tab_fascicoli tf, tab_unarc tu left join tab_valtendine t1 on t1.idx_unarc = tf.idx_unarc and t1.idx_testendina = 1 Don't mix cartesian products with real JOINs. In fact, don't use cartesian products at all, as theyt end to be optimized poorly. Make TF, TU a proper INNER JOIN. -- Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz All the great TeamB service you've come to expect plus (New!) Irish Tin Whistle tips: learningtowhistle.blogspot.com Craig Stuntz [TeamB] Delphi Developer 2006-03-03 10:35:28 PM Re:Error "no current record for fetch operation" Wayne Niddery [TeamB] writes: Quote If you are actually trying to insert or update then you need to add triggers to this view to make
Banco de Dados Exibir mensagem anterior :: Exibir próxima mensagem Autor Mensagem oneshotbrColaboradorRegistrado: Quarta-Feira, 6 de Mai de 2009Mensagens: 1948Localização: Taubaté - SP Enviada: Qua Out 08, 2014 3:17 pm Assunto: erro ao usar left join no current record for fetch op. RESOL Boa tarde galera, Estou tentando trazer os dados da minha tabela de funcionários mas quando eu coloco o left join o firebird me retorna o seguinte erro. no current record for fetch operation Segue o código. Código: select ecf_vendas.ecfvendasid, ecf_vendas.funcionariosid, ecf_vendas.datahora, ecf_vendas.cancelada, ecf_vendasitens.ecfvendasid, ecf_vendasitens.produtosid, ecf_vendasitens.valorunitario, ecf_vendasitens.quantidade, ecf_vendasitens.valortotal, unidades.sigla, produtos.codigobarra, produtos.nome, ecf_configuracoes.nomecomputador, funcionarios.nome from ecf_vendas, ecf_vendasitens join produtos on (ecf_vendasitens.produtosid = produtos.produtosid) join unidades on (produtos.unidadesid = unidades.unidadesid) join ecf_movimentos on (ecf_vendas.ecfmovimentosid = ecf_movimentos.ecfmovimentosid) join ecf_configuracoes on (ecf_movimentos.ecfconfiguracoesid = ecf_configuracoes.ecfconfiguracoesid) left join funcionarios on (ecf_vendas.funcionariosid = funcionarios.funcionariosid) where ecf_vendas.ecfvendasid = ecf_vendasitens.ecfvendasid and cancelada like :cancelada and datahora between :datainicial and :datafinal _________________AMD Phenom II X4 960T 3.00 GHz - 8 GB DDR III - HD 1000 GB SATA - GeForce GTX 650 TI GDDR 5 - Monitor 21,5" Full HD - Kubuntu 14.04 + Windows 7 Professional x64.Editado pela última vez por oneshotbr em Qui Dez 11, 2014 3:24 pm, num total de 1 vez Voltar ao Topo imexModeradorRegistrado: Sexta-Feira, 7 de Janeiro de 2011Mensagens: 10107 Enviada: Seg Out 13, 2014 11:43 am Assunto: Bom dia, Em que momento essa mensagem é exibida? Você testou essa query através de alguma ferramenta de administração do banco de dados (ex: IBExpert)? Talvez não tenha relação com o erro mas acho que seria melhor alterar a query para utilizar a sintaxe com inner join com a tabela ecf_vendasitens. _________________ Assinatura: http://www.imoveisemexposicao.com.br/imoveis-alugar-guarulhos-residencial-apartamento Voltar ao Topo oneshotbrColabo