473,657 Members | 2,595 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to use execute statement? Getting error: syntax error at or near "USING"

61 New Member
I use the EXECUTE statement in a procedure which has 2 parameters, one is to hold the query, and the other for the value used in the query
Expand|Select|Wrap|Line Numbers
  1. create or replace function delete_from_table1(character varying , integer ) 
  2. RETURNS void as '
  3. DECLARE
  4. query ALIAS FOR $1;
  5. id  ALIAS FOR $2;
  6.  
  7. BEGIN
  8. EXECUTE query 
  9. USING id ;
  10.  
  11. END;'
  12.  
  13. language 'plpgsql';
  14.  
but I have an error:
ERROR: syntax error at or near "USING"

may any one solve this problem?

THANKS.
Oct 21 '10 #1
3 6309
rski
700 Recognized Expert Contributor
What postgres version do you use.
Oct 25 '10 #2
osman7king
61 New Member
Postgres 8.3 for windows
Oct 26 '10 #3
rski
700 Recognized Expert Contributor
Expand|Select|Wrap|Line Numbers
  1. EXECUTE .. USING
  2.  
appeared in 8.4 version.
See here http://www.postgresql.org/docs/8.4/s...lease-8-4.html
Oct 26 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
9638
by: Russell Mangel | last post by:
Is it possible to use the using statement with XmlTextReader? I tryed to use it, but it gives me the error message: Cannot implicitly convert type 'System.Xml.XmlTextReader' to 'System.IDisposable' Is there something I am doing wrong? // This no worky using(XmlTextReader xtr = new XmlTextReader("C:\\myfile.xml")) {
5
2698
by: Bill Priess | last post by:
Hey gang, Ok, I'm stumped on this one... I am using the using statement to wrap a SqlDataAdapter that I am using to fill a DataTable. Now, what I need to know is, just how much block-scope applies to objects created in the using scope. For example: <code> static DataTable getTable()
1
315
by: Kepler | last post by:
I have a situation where I need to use a Using statement that creates some records in a database. After that completes, if it completes, I need to do some file creation. Any code I'm putting after the Using statement gives a compiler warning of "Unreachable Code Detected", and it never runs. Why is this happening? I really don't want to put the file manipulation code in the using statement because it's a transaction. I also need for...
8
3700
by: J-T | last post by:
I have a class like below I have a couple of questions about that: 1) I like to use "Using statement" when creating an object of this class,so I had to implement IDisposable.Am I doing this right here? 2) Do I have to be worried about those objects I have created in GetPackageNames() ?? for instance making them null afterward or something? 3) This class is in my business layer As you can see I'm using Microsoft.SQLServer.DTSPkg80...
1
3505
by: pascal_pare | last post by:
Hi, Is there a way to declare a using statement with the CodeDom? Something like: using (obj = new Object()) { obj.DoSomething; }
18
2359
by: Trevor | last post by:
I have seen the "using" statement used in strange ways in some C# code. Example: using (StreamReader sr = new StreamReader("TestFile.txt")) { // do some stuff... } What effect does the using statement give you in this example?
2
5011
by: Robert Bravery | last post by:
Hi all, Being new to C# and .net I often don't know how to use things. I have created an app that imports excel data, it works well, with methods to open excel, extract the data and close excel. Now a colege of mine suggested useinf the usingstatement, so that the office object is dispossed/destroyued correctly, saying that it prevents memoryleaks. Problem is I am having problems trying to achieve this, I keep getting the error: type...
6
1951
by: Juan Zamudio | last post by:
Hi all, I'm using vs 2003, i have a question about using and as, i was reading in programing .net components that one way to avoid null references inside using was using as, something like this: using(var as IDisposable){ ..... } the book saids that if the conversion is null the code inside using will not run, but i cant make it work, I have a FileStream that opens a file, the path is a parameter, something like this:
5
7135
by: Hillbilly | last post by:
MSDN Remarks "as a rule" the using statement should be used when instantiating objects which inherit IDisposable. Other than the obvious unmanaged objects like the file system example, fonts and the database how else may it be determined which classes and their objects inherit IDisposable? And the remarks imply the using statement is a different and perhaps more efficient way to use objects than try-catch-finally? ...
3
1680
by: CSharper | last post by:
I have a using statement something like the following try { using(SqlConnection cnn = ...) { } catch(Exception e1) { }
0
8397
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8827
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7333
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6167
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2731
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1620
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.