On 2013-04-25, Mauricio Cruz wrote:
> declare
>
> aCad
> text[][]
>
> begin
>
> ...
>
> execute 'aCad:=aCad
> array[['||var1||','||var2||']]'
execute 'select array[['||var1||','||var2||']]' into acad;
--
⚂⚃ 100% natural
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
T
On Thu, Apr 25, 2013 at 9:17 AM, Mauricio Cruz wrote:
> execute 'aCad:=aCad array[['||var1||','||var2||']]'
What are you going to do using this construction
aCad:=aCad array[['||var1||','||var2||']]
?
I can not understand the meaning.
--
Kind regards,
Sergey Konoplev
Database and Software Con
Hi every one,
I'm trying to do the follow:
declare
aCad
text[][]
begin
...
execute 'aCad:=aCad
array[['||var1||','||var2||']]'
...
end; language plpgsql
but I get
the follow error:
sintax erro near to "aCad"
aCad := aCad ||
array[rCad.cmp,rSql.codfor]
^
I guess I sho
"sergey kapustin" writes:
> The thing is, that if i one of the parameters is NULL, then string s becomes
> NULL also ( because NULL||"any string" = NULL) and as a result i get this
> error -
> ERROR: cannot EXECUTE a null querystring
quote_nullable() might help.
regards,
Hello!
I'm trying to run this code in one of my stored procedures
s := 'execute prepared_plan( ' || id_engine || ',' || id_search || ',' ||
id_rsite || ')';
execute s;
where "prepared_plan" is a statement defined before with PREPARE.
The thing is, that if i one of the parameters is NULL, then
2008/11/25 Tk421 <[EMAIL PROTECTED]>:
> I've got a problem with a function: It receives two parameters, the first,
> the table name, and the second, a where condition. The function looks like
> this:
>
> DECLARE
> cod bigint;
> query TEXT;
>
> BEGIN
> query = 'SELECT codigo FRO
Tk421 <[EMAIL PROTECTED]> schrieb:
>I've got a problem with a function: It receives two parameters, the
> first, the table name, and the second, a where condition. The function
> looks like this:
>
>DECLARE
> cod bigint;
> query TEXT;
>
>BEGIN
> query = 'SELECT co
I've got a problem with a function: It receives two parameters, the
first, the table name, and the second, a where condition. The function
looks like this:
DECLARE
cod bigint;
query TEXT;
BEGIN
query = 'SELECT codigo FROM ' || $1 || ' WHERE ' || $2;
EXECUTE qu
Thanks!
Chris
Original-Nachricht
> Datum: Fri, 9 May 2008 23:14:44 +1000
> Von: imad <[EMAIL PROTECTED]>
> An: "Christian Kindler" <[EMAIL PROTECTED]>
> Betreff: Re: [SQL] execute plpgsl like "normal" sql
> Anonymous blocks are n
Hi
Is there a possibility to execute pl/pgsql syntax like normal sql simmilar to
sql+ from oracle?
The question is: if I want to execute soemthing like this:
--File foo.sql:
begin
for id in select id from mytable loop
update myothertable set payed = true where fk_id = id;
end loop;
end;
Do
Sabin Coanda <[EMAIL PROTECTED]> schrieb:
> Hi there,
>
> Is it possible to execute a system command from a function ? (e.g. bash )
Yes, of course, but you need an untrusted language like pl/perlU oder
plsh. http://plsh.projects.postgresql.org/
Andreas
--
Really, I'm not out to destroy Micros
On Dec 6, 2007, at 10:32 AM, Sabin Coanda wrote:
Hi there,
Is it possible to execute a system command from a function ? (e.g.
bash )
If you use one of the untrusted procedural languages (e.g. plperlu,
plpythonu, ...) you can.
Erik Jones
Software Developer | Emma®
[EMAIL PROTECTED]
800
Hi there,
Is it possible to execute a system command from a function ? (e.g. bash )
TIA,
Sabin
---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
Hello Dirk,
I have to disagree.
Your first update query is very low. It probably implies to run the sub
select statement for each row to be updated.
Following update statement is already much faster: (using UPDATE FROM)
update test_table
set mygroup= t.mygroup
from test_table as t
Hello Marc,
at first I tried to solve your update of the tables. The example you
gave should be done with an update statement like the following:
update test_table
set mygroup=(select t.mygroup
from test_table as t
where t.family = test_table.family
Hello,
I have a large upddate to perform on tables which are dynamically
generated (dynamic names).
In this simplified example, the operation should replace in each family
the "mygroup" of each item of rang=0 with the "mygroup" value of the
element of rang=1 :
(the * indicate the modified valu
...
> When you say use rules to inject constants, how would I go about
> doing this? Could you maybe give a brief example?
create view tab1_dml as select * from tab1;
-- note:
-- CONSTANT1 = 8
-- CONSTANT2 = 15
create or replace rule tab1_insert as
on insert
to tab1_dml
do instead(
ins
> I was wondering if it is possible to set the 'context' for running an
> sql command
Oracle has a Context('varname') that returns the value of varname for
the session. to best of my knowledge pg has nothing like this.
> I guess bottom line, is it possible to execute a bunch of SQL
> statements
I was wondering if it is possible to set the 'context' for running an
sql command:
For example, say you have a rule which upon update to table TEST of
type [a int, b varchar(10), c varchar(50)]:
INSERT INTO Log(a * 5, substring(b,0,2), randomize(c))
So an update of (5, 'hello', 'world') will add
Hi there,
I have tried many ideas to get this working but no luck.
Can some show me or explain what is happening
EXAMPLE
==
I am trying to read to 2 text fields to combine them togther to form the
name of a
VIEW. example
SELECT * FROM ( 'april'||'may') ;
I have tried the EXECUTE i
On Fri, Sep 30, 2005 at 03:59:06PM -0500, Thomas F. O'Connell wrote:
> Per the docs:
>
> "The results from SELECT commands are discarded by EXECUTE, and
> SELECT INTO is not currently supported within EXECUTE. So there is no
> way to extract a result from a dynamically-created SELECT using the
Per the docs:
"The results from SELECT commands are discarded by EXECUTE, and
SELECT INTO is not currently supported within EXECUTE. So there is no
way to extract a result from a dynamically-created SELECT using the
plain EXECUTE command. There are two other ways to do it, however:
one is
On Fri, 2005-09-30 at 02:34 -0600, Michael Fuhr wrote:
> On Fri, Sep 30, 2005 at 10:00:35AM +0200, Mario Splivalo wrote:
> > PgSql8.1beta2 gives me this:
> >
> > ERROR: EXECUTE of SELECT ... INTO is not implemented yet
> > CONTEXT: PL/pgSQL function "_rndbroj" line 5 at execute statement
>
> Co
On Fri, Sep 30, 2005 at 10:00:35AM +0200, Mario Splivalo wrote:
> PgSql8.1beta2 gives me this:
>
> ERROR: EXECUTE of SELECT ... INTO is not implemented yet
> CONTEXT: PL/pgSQL function "_rndbroj" line 5 at execute statement
Could you post a simple example of what you're trying to do? The
follo
PgSql8.1beta2 gives me this:
ERROR: EXECUTE of SELECT ... INTO is not implemented yet
CONTEXT: PL/pgSQL function "_rndbroj" line 5 at execute statement
Shall I forget about this once and for all (and use FOR construct), or
there is a chance that will be 'fixed'?
Mario
--
Mario Splival
I can assign a value to a variable in several ways:
myVar := (SELECT col FROM table WHERE somecondition...)
myVar := col FROM table WHERE somecondtition...
SELECT col INTO myVar FROM table WHERE somecondition
How do I do any of the above using EXECUTE? I need to be able to assign
the value to a v
How do we execute a Query String in Postgresql function?
Or what is the equivalent of the following Code in MSSQL Stored
Procedure:
SET @QueryToPopulateTemp = "INSERT INTO
#Tmp_ConferenceDetail(ConferenceType, ConnectTime,
DisconnectTime,DestConversationId, Duration, AppConfId, OrigDevice
Paul Hart <[EMAIL PROTECTED]> writes:
> In RDBMSs such as Oracle, stored PL/SQL functions run with the
> permissions of the user that creates the function. Users who are given
> EXECUTE privileges then call the function with the permissions of the
> creator of the function.
Use "SECURITY DEFINE
Hi all,
From what I've seen in the archives, questions like this have kind of
been answered in the past, but I was wondering if there have been any
changes in this area, or if anyone has good ideas on how to do what I'm
about to ask :)
In RDBMSs such as Oracle, stored PL/SQL functions run with
Hi, all
postgreSQL v7.3.3
I found EXECUTE on pl/pgsql doesn't support schema. When I specify a table
such as "public.tablename", it reported "not such a relation object". The
only SQL statement I used is "update". Don't know wether other statements
have the same problem.
Jack
-
LR wrote:
Thank you for your answer.
Do you know the name of this package ?
Thx
Lilian
see contrib/dblink.
I'd highly recommend using 7.3 (finishing beta, soon to be a release
candidate) if you can. It is much better than the one in 7.2 and the syntax
has changed some.
Joe
---
> > Hi,
> >
> > When I'm connected to a postgreSQL db ( e.g. myDB ), how could I execute
> > "select * from myTable;" in an other db (e.g. myOtherDB).
> >
> > In other words, what is the postgreSQL equivalent of the MS SQL Server
> > statement "USE myOtherDB SELECT * FROM myTable" ?
>
> Stock postg
On Sat, Nov 09, 2002 at 17:51:40 +0100,
LR <[EMAIL PROTECTED]> wrote:
> Hi,
>
> When I'm connected to a postgreSQL db ( e.g. myDB ), how could I execute
> "select * from myTable;" in an other db (e.g. myOtherDB).
>
> In other words, what is the postgreSQL equivalent of the MS SQL Server
> state
Hi,
When I'm connected to a postgreSQL db ( e.g. myDB ), how could I execute
"select * from myTable;" in an other db (e.g. myOtherDB).
In other words, what is the postgreSQL equivalent of the MS SQL Server
statement "USE myOtherDB SELECT * FROM myTable" ?
Thanks
Lilian
---
"Josh Berkus" wrote:
>Folks,
>
>Can anybody tell me the syntax for sending the result of an EXECUTE to a
>variable within a PL/pgSQL function again? Jan Wieck posted it to the
>list this summer, but the "searchable list archives" are bogging down.
FOR variable IN EXECUTE ''SELECT ...''
Folks,
Can anybody tell me the syntax for sending the result of an EXECUTE to a
variable within a PL/pgSQL function again? Jan Wieck posted it to the
list this summer, but the "searchable list archives" are bogging down.
-Josh
__AGLIO DATABASE SOLUTIONS___
On Sat, 25 Aug 2001 16:42, Zot O'Connor wrote:
> Christopher Sawtell wrote:
> > On Fri, 24 Aug 2001 06:52, Zot O'Connor wrote:
> > > Other SQL servers have the concept of stored procedures having
> > > different permissions.
> > >
> > > For instance a procedure that can update a table.
> > >
> > >
23 Aug 2001 11:52:25 -0700, Zot O'Connor
> Other SQL servers have the concept of stored procedures having different
> permissions.
>
> For instance a procedure that can update a table.
>
> Since a web site typically connects as the webuser (or equiv postgres
> user), I do not want to offer
Christopher Sawtell wrote:
>
> On Fri, 24 Aug 2001 06:52, Zot O'Connor wrote:
> > Other SQL servers have the concept of stored procedures having different
> > permissions.
> >
> > For instance a procedure that can update a table.
> >
> > Since a web site typically connects as the webuser (or equi
Other SQL servers have the concept of stored procedures having different
permissions.
For instance a procedure that can update a table.
Since a web site typically connects as the webuser (or equiv postgres
user), I do not want to offer update to the webuser.
The way I have done this elsewhere i
12 May 2001, datactrl wrote:
>
> > Date: Sat, 12 May 2001 10:23:39 +1000
> > From: datactrl <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Subject: Re: [SQL] execute client application from PL/pgSql
> >
> > Thank You Jeff,
> > What is phpPgAdmin
CTED]
> Subject: Re: [SQL] execute client application from PL/pgSql
>
> Thank You Jeff,
> What is phpPgAdmin and where can get it?
>
> Jack
>
> - Original Message -
> From: "Jeff MacDonald" <[EMAIL PROTECTED]>
> To: "Jack" <[EMAIL
Thank You Jeff,
What is phpPgAdmin and where can get it?
Jack
- Original Message -
From: "Jeff MacDonald" <[EMAIL PROTECTED]>
To: "Jack" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, May 12, 2001 2:28 AM
Subject: Re: [SQL] execute cl
Jack wrote:
>
> Is that possible to execute a client application from server site by
> PL/Pgsql, such as pg_dump? Because my client sites are running Windows OS,
> or is there any Windows version of all Client Applications come from
> PostGreSQL V7.1?
>
> Jack
>
> ---(e
you could hack the pg_dump bit out of phpPgAdmin
i think the license permits it.
just my 2 cents.
jeff
On Wed, 9 May 2001, Jack wrote:
> Date: Wed, 9 May 2001 09:45:46 +1000
> From: Jack <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: [SQL] execute client applica
Is that possible to execute a client application from server site by
PL/Pgsql, such as pg_dump? Because my client sites are running Windows OS,
or is there any Windows version of all Client Applications come from
PostGreSQL V7.1?
Jack
---(end of broadcast)-
46 matches
Mail list logo