Problemas ao recuperar generator c#

27 views
Skip to first unread message

Tiago

unread,
Mar 29, 2009, 11:13:48 AM3/29/09
to firebir...@googlegroups.com
Ola a todos,

Quero pegar o generator lá no firebird. O problema é que não vai, este foi criado pelo query designer e se eu testar pelo preview data do mesmo, traz o resultado mais via codigo não. Alguém faz alguma ideia?

Para isto criei uma procedure
CREATE OR ALTER PROCEDURE GET_GENCODPCRI (
INCR_GEN INTEGER)
RETURNS (
GEN_VALOR INTEGER)
AS
BEGIN
/* PROCEDURE TEXT */
SELECT GEN_ID(GEN_CODPCRI, :INCR_GEN) FROM RDB$DATABASE
INTO :GEN_VALOR;
SUSPEND;
END;

Aqui no .Net tento chama-la
GET_GENCODPCRITableAdapter genPcriTA = new GET_GENCODPCRITableAdapter();
int i = 0;
// Assinatura do metodo: DVendasJRSWs.GET_

CODPCRIDataTable GENCODPCRITableAdapter.GetDataGen(int? INCR_GEN)
int teste = genPcriTA.GetDataGen(i).Count; // Aqui já dá erro.

Stack trace:
FirebirdSql.Data.FirebirdClient.FbException: Dynamic SQL Error
SQL error code = -206
Column unknown
INCR_GEN
At line 1, column 32. ---> FirebirdSql.Data.Common.IscException: Exception of type 'FirebirdSql.Data.Common.IscException' was thrown.
at FirebirdSql.Data.Client.Gds.GdsConnection.ReadStatusVector()
at FirebirdSql.Data.Client.Gds.GdsConnection.ReadResponse()
at FirebirdSql.Data.Client.Gds.GdsDatabase.ReadResponse()
at FirebirdSql.Data.Client.Gds.GdsStatement.Prepare(String commandText)
at FirebirdSql.Data.FirebirdClient.FbCommand.Prepare(Boolean returnsSet)
at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteCommand(CommandBehavior behavior, Boolean returnsSet)
at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteReader(CommandBehavior behavior)
--- End of inner exception stack trace ---
at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteReader(CommandBehavior behavior)
at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at VendasJRSWs.DSVendasJRSWsTableAdapters.GET_GENCODPCRI1TableAdapter.FillByGen(GET_GENCODPCRI1DataTable dataTable, Nullable`1 INCR_GEN) in C:\WinJRS\vendasjrs\VendasJRSWs\DSVendasJRSWs.Designer.cs:line 11297
at VendasJRSWs.Pedidos.getGenerator(Campo campo, Int32 incremeto) in C:\WinJRS\vendasjrs\VendasJRSWs\Pedidos.asmx.cs:line 108
at VendasJRSWs.Pedidos.InsereItemPedido(Int32 codpcrc, Int32 genCodpcrc, String codpro, Decimal qtdade, Decimal vrunit) in C:\WinJRS\vendasjrs\VendasJRSWs\Pedidos.asmx.cs:line 210

Jeudí Prando Araújo

unread,
Mar 31, 2009, 9:54:36 PM3/31/09
to firebir...@googlegroups.com
qual é o SELECT SQL que c ta usando no Table adapter?

2009/3/29 Tiago <tijg...@gmail.com>



--
Atenciosamente,
Jeudí Prando

--------------------------------------------------------------
agora melhorou...

Tiago

unread,
Apr 1, 2009, 9:15:48 AM4/1/09
to firebir...@googlegroups.com
SELECT GEN_ID(GEN_CODPCRI, 0) FROM RDB$DATABASE

mas criando na mão (não usando o query designer do visual) deu certo.

obrigado Jeudi.

2009/3/31 Jeudí Prando Araújo <jeudi...@gmail.com>

Jeudí Prando Araújo

unread,
Apr 1, 2009, 10:30:25 AM4/1/09
to firebir...@googlegroups.com
tudo bem, que bom...

mas e agora pra que serve a procedure "GET_GENCODPCRI"
se voce ta usando o SQL da forma que deveria ter cido usado sem criar a procedure?


Atenciosamente,
Jeudí Prando

--------------------------------------------------------------
agora melhorou...



2009/4/1 Tiago <tijg...@gmail.com>

Tiago

unread,
Apr 1, 2009, 3:47:43 PM4/1/09
to firebir...@googlegroups.com
pra mais nada..rsrss

Foi assim a ideia dela foi me livrar do comando por causa da tabela de sistema que o query designer não aceita. Ai surgui um novo problema, criei a procedure pelo desginer normal, mas na hora de executar via comando não ia, ela achava que o parametro de entranda era um campo. não sei se eu que não estava sabendo fazer.
Entao no site achei exemplos de como fazer o lance na mão mesmo..
http://www.firebirdsql.org/dotnetfirebird/sample-code.html

ai fiz esta opção e abandonei as anteriores.

Obrigado,
Tiago.

2009/4/1 Jeudí Prando Araújo <jeudi...@gmail.com>

stefaniak

unread,
Apr 1, 2009, 3:58:00 PM4/1/09
to firebir...@googlegroups.com
boa tarde pessoal,
alguém poderia disponibilizar um exemplo de cadastro com dotnet e firebird?
com um módulo de conexão, pelo menos umas 2 tabelas.
se não for pedir demais é claro.
desde já agradeço

Jeudí Prando Araújo

unread,
Apr 1, 2009, 9:02:35 PM4/1/09
to firebir...@googlegroups.com
Hummm, blz...
é como eu sempre digo e as pessoas nunca me ouvem...
na mao, na raça, fazer a parada na unha é muito melhor...

Boa Sorte pra o c entao...

Jeudí Prando Araújo

unread,
Jun 26, 2009, 7:44:16 AM6/26/09
to firebir...@googlegroups.com
estou trabalhando em um projeto novo, iniciando, quando tiver alguma coisa mando pra voce

2009/4/1 stefaniak <stef...@bol.com.br>



--


--
Atenciosamente, Jeudí Prando
:: se não tá bom, é porque ainda não chegou ao fim ::

Jeudí Prando Araújo

unread,
Jun 26, 2009, 7:44:25 AM6/26/09
to firebir...@googlegroups.com
ou nao precisa mais?!

2009/6/26 Jeudí Prando Araújo <jeudi...@gmail.com>

stefaniak

unread,
Jun 26, 2009, 8:09:55 AM6/26/09
to firebir...@googlegroups.com
ôpa,
manda sim!
vai ser de grande proveito!

obrigado


Jeudí Prando Araújo escreveu:
> estou trabalhando em um projeto novo, iniciando, quando tiver alguma
> coisa mando pra voce
>
> 2009/4/1 stefaniak <stef...@bol.com.br <mailto:stef...@bol.com.br>>

Jeudí Prando

unread,
Jun 26, 2009, 9:58:05 PM6/26/09
to firebir...@googlegroups.com
BLZ! vou organizar aqui e tendo alguma coisa te passo... passo pra todo
mundo aqui do grupo

voce ai que deve estar lendo... gostaria de receber um exemplo ou é melhor
mandar só para o email do(a) "stefaniak" <stef...@bol.com.br>?

democracia no grupo... rsss

Arilmar

unread,
Jun 27, 2009, 2:19:59 PM6/27/09
to firebir...@googlegroups.com
Acho que deve mandar o exemplo pra todos.

2009/6/26 Jeudí Prando <jeudi...@gmail.com>



--
Atenciosamente,
Arilmar Rezende

André Gustavo

unread,
Jun 27, 2009, 7:59:56 PM6/27/09
to firebir...@googlegroups.com
Manda pra todo mundo.. vai ser legal pra muita gente

André Gustavo

-----Mensagem original-----
De: firebir...@googlegroups.com [mailto:firebir...@googlegroups.com]
Em nome de Jeudí Prando
Enviada em: sexta-feira, 26 de junho de 2009 10:58
Para: firebir...@googlegroups.com
Assunto: [FB.NET] Re: exemplo de cadastro
__________ Informação do ESET NOD32 Antivirus, versão da vacina 4193
(20090626) __________

A mensagem foi verificada pelo ESET NOD32 Antivirus.

http://www.eset.com



__________ Informação do ESET NOD32 Antivirus, versão da vacina 4193
(20090626) __________

A mensagem foi verificada pelo ESET NOD32 Antivirus.

http://www.eset.com


Jeudí Prando

unread,
Jun 27, 2009, 10:24:09 PM6/27/09
to firebir...@googlegroups.com
Blz entao...
Reply all
Reply to author
Forward
0 new messages