Re: Feature Request for Debugging SQL in PGAdmin3 when SQL contains variables - Mailing list pgadmin-support

From Dan Shoubridge
Subject Re: Feature Request for Debugging SQL in PGAdmin3 when SQL contains variables
Date
Msg-id 000901cb858c$bef3b770$3cdb2650$@autovhc.co.uk
Whole thread Raw
In response to Feature Request for Debugging SQL in PGAdmin3 when SQL contains variables  ("Dan Shoubridge" <dan.shoubridge@autovhc.co.uk>)
Responses Re: Feature Request for Debugging SQL in PGAdmin3 when SQL contains variables
List pgadmin-support
> > Le 16/11/2010 13:14, Dan Shoubridge a écrit :
> > > Originally from SQL Server background, there is one feature that I
> > > am missing and would save developers hours of time.
> > >
> > > In SQL Server I could copy sql code out of an application and paste
> > > it into SSMS, declare & assign vars that exist in the sql and run -
> > > great debugging scenario.
> > > e.g. (please note I am rusty and syntax may be incorrect)
> > >
> > > declare @x as varchar(10)
> > > set @x = 'abc'
> > > select * from sometable where somefield = @x
> > >
> > > It would be amazing if simular functionality could be built into in
> > > pgadmin3 (NpgSQL uses : instead of @) where I can just drop my sql
> > > (params & all) into the query window.
> > >
> > > I realise you can create pgscript, but it doesn't achieve the above...
> > > Currently I have a peice of sql someone has written that has 3
> > > unique varibles in it which are used around 7 times each...

> > And? I don't see why pgscript can't do that. The example you give is
certainly doable with pgscript.

> > Just for the record, the above script looks like this in pgscript:

> > declare @x;
> > set @x = 'abc';
> > select * from sometable where somefield = '@x';

> > And it works.

> Ok, I tried it - I think I must have missed of the quotes in my version,
but that still defeats the point - It's easy to replace @ with :, but having
to put quotes around all the vars makes it less efficient. Is there anything
that can be done about this?

And I don't get any output in the 'Data Output tab' - this is the most
important bit.



pgadmin-support by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re: Feature Request for Debugging SQL in PGAdmin3 when SQL contains variables
Next
From: "Dan Shoubridge"
Date:
Subject: Re: Feature Request for Debugging SQL in PGAdmin3 when SQL contains variables