Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id E63119FB2A6 for ; Tue, 29 May 2007 07:26:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 13510-09 for ; Tue, 29 May 2007 07:26:40 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from jupiter.marktest.pt (delta.marktest.pt [80.251.174.116]) by postgresql.org (Postfix) with ESMTP id E4C359FB40B for ; Tue, 29 May 2007 07:26:38 -0300 (ADT) Received: from suite (suite.marktest.pt [10.61.90.236]) by jupiter.marktest.pt with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id LBXDSXQP; Tue, 29 May 2007 11:26:36 +0100 Message-ID: <001101c7a1db$d51dd3c0$ec5a3d0a@marktestcr.marktest.pt> From: "Oliveiros Cristina" To: "Francisco Figueiredo Jr." , "Oliveiros Cristina" , References: <344577.28356.qm@web60715.mail.yahoo.com> Subject: Re: Question on NpgsqlParameter object Date: Tue, 29 May 2007 11:26:34 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000E_01C7A1E4.36BE6010" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.32 tagged_above=0 required=5 tests=AWL=0.049, BAYES_50=0.001, FORGED_RCVD_HELO=0.135, HTML_50_60=0.134, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200705/61 X-Sequence-Number: 6568 This is a multi-part message in MIME format. ------=_NextPart_000_000E_01C7A1E4.36BE6010 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Howdy, Francisco. Thank you for your fast reply. I'm gonna check this out. Actually I wasn't aware of the existence of the Npgsql mailing list, = even though I use it exclusively to access the back end ! But, maybe if I am a little more specific you can tell me what I am = (potentially) doing wrong. Can I use parameters to substitute a whole condition?=20 For ex, is it possible to have a query like this? SELECT * FROM t_tabela WHERE @condicao=20 ? My problems started yesterday when I started using parameters in this = way.=20 Before I've just used it in situations like this : SELECT * FROM t_tabela WHERE variacao >=3D @percentagem and it always worked without the smallest problem.=20 I wonder if it is legal to use NpgsqlParameters in the way I do now... Melhores cumprimentos, Oliveiros ----- Original Message -----=20 From: Francisco Figueiredo Jr.=20 To: Oliveiros Cristina ; pgsql-interfaces@postgresql.org=20 Sent: Monday, May 28, 2007 11:32 PM Subject: Res: [INTERFACES] Question on NpgsqlParameter object Hi Oliveiros! Unfortunately it is not possible with current state to get this text. You will have to enable either Npgsql Log or postgresql log. Just add those lines: // Enable logging. NpgsqlEventLog.Level =3D LogLevel.Debug; = NpgsqlEventLog.LogName =3D "NpgsqlTests.LogFile"; It will show you all the commands sent to server. You can also get support from Npgsql mail list and forum. Check out = Npgsql project page: http://npgsql.projects.postgresql.org I hope it helps. -- Regards, Francisco Figueiredo Jr. http://fxjr.blogspot.com Npgsql Lead Developer http://npgsql.projects.postgresql.org MonoBrasil Project Founder Member http://monobrasil.softwarelivre.org "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi ----- Mensagem original ---- De: Oliveiros Cristina Para: pgsql-interfaces@postgresql.org Enviadas: Segunda-feira, 28 de Maio de 2007 14:36:52 Assunto: [INTERFACES] Question on NpgsqlParameter object Hi, List. I am not 100% sure if this is the right list, if it isnt please kindly = re-direct me to the proper list. I would like to see NpgsqlCommand.CommandText value after parameter = substitution. I have a query that is not behaving correctly and I = suspect strongly that it has to do with parameters getting instantiated = in unexpected ways.=20 How can I have access to query SQL text after parameter substitution ? I try to look at CommandText Property immediately before calling = ExecuteReader() method, but I get the text with all parameters = unsubstituted.=20 Any Help/Comments/Advices deeply appreciated Thanks in advance Cheers, Oliveiros __________________________________________________ Fale com seus amigos de gra=E7a com o novo Yahoo! Messenger=20 http://br.messenger.yahoo.com/ ------=_NextPart_000_000E_01C7A1E4.36BE6010 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Howdy, Francisco.
 
Thank you for your fast = reply.
I'm gonna check this out.
Actually I wasn't aware of the = existence of the=20 Npgsql mailing list, even though I use it exclusively to access the back = end=20 !
 
 
But, maybe if I am a little more = specific you can=20 tell me what I am (potentially) doing wrong.
 
Can I use parameters to substitute a = whole=20 condition?
For ex, is it possible to have a query = like=20 this?
 
SELECT *
FROM t_tabela
WHERE = @condicao=20
 
?
 
My problems started yesterday when I = started using=20 parameters in this way.
Before I've just used it in situations = like this=20 :
SELECT *
FROM t_tabela
WHERE variacao >=3D = @percentagem
 
and it always worked without the = smallest problem.=20
I wonder if it is legal to use NpgsqlParameters in the way I do = now...
 
 
Melhores cumprimentos,
 
Oliveiros
 
----- Original Message -----
From:=20 Francisco=20 Figueiredo Jr.
To: Oliveiros Cristina ; = pgsql-interfaces@postgres= ql.org=20
Sent: Monday, May 28, 2007 = 11:32 PM
Subject: Res: [INTERFACES] = Question on=20 NpgsqlParameter object



Hi Oliveiros!

Unfortunately it is not = possible=20 with current state to get this text.

You will have to enable = either=20 Npgsql Log or postgresql log.

Just add those lines:

// Enable logging.
NpgsqlEventLog.Level =3D = LogLevel.Debug;
NpgsqlEventLog.LogName =3D = "NpgsqlTests.LogFile";

It=20 will show you all the commands sent to server.

You can also get = support=20 from Npgsql mail list and forum. Check out Npgsql project=20 page:

http://npgsql.projects.postgresql.org

I= hope=20 it helps.


 
--
Regards,
 
Francisco Figueiredo Jr.
http://fxjr.blogspot.com
 
Npgsql Lead Developer
http://npgsql.projects.postgresql.org
 
MonoBrasil Project Founder Member
http://monobrasil.softwarelivre.org
 
 
"My grandfather once told me that there are two kinds of people:=20 those
who work and those who take the credit. He told me to try to = be in=20 the
first group; there was less competition there."
- Indira = Gandhi

-----=20 Mensagem original ----
De: Oliveiros Cristina=20 <oliveiros.cristina@gmail.com>
Para:=20 pgsql-interfaces@postgresql.org
Enviadas: Segunda-feira, 28 de Maio = de 2007=20 14:36:52
Assunto: [INTERFACES] Question on NpgsqlParameter=20 object

Hi, List.

I am not 100% sure if this is the right = list,=20 if it isnt please kindly re-direct me to the proper list.

I = would like=20 to see NpgsqlCommand.CommandText value after parameter substitution. I = have a=20 query that is not behaving correctly and I suspect strongly that  = it has=20 to do with parameters getting instantiated in unexpected ways. =

How can=20 I have access to query SQL text after parameter substitution = ?

I try to=20 look at CommandText Property immediately before calling = ExecuteReader()=20 method, but I get the text with all parameters unsubstituted. =

Any=20 Help/Comments/Advices deeply appreciated

Thanks in=20 = advance

Cheers,
Oliveiros


__= ________________________________________________
Fale=20 com seus amigos de gra=E7a com o novo Yahoo! Messenger=20
http://br.messenger.yahoo.com/ ------=_NextPart_000_000E_01C7A1E4.36BE6010--