473,765 Members | 2,070 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how retrive this problem

3 New Member
Expand|Select|Wrap|Line Numbers
  1.  
  2. CREATE OR REPLACE FUNCTION schema._pg_object_getobjectlist(varchar) 
  3. RETURNS refcursor AS 
  4. '
  5. DECLARE
  6.     columnid int4;
  7.     search_string varchar;
  8.     temp refcursor;
  9.     rc refcursor;
  10. BEGIN
  11.     search_string :=  \'%\' || $1 || \'%\'; 
  12.  
  13.     ----------------------------------------------------------------------------
  14.     -- clean-up temporary object list table before populating it with data
  15.     ----------------------------------------------------------------------------
  16.  
  17.     DELETE FROM schema.tempobjectlist;
  18.  
  19.     OPEN temp FOR SELECT  idobject  FROM  schema.strnodeprops  
  20.     WHERE  spropertyvalue  LIKE search_string; 
  21.  
  22.     LOOP
  23.         FETCH temp INTO columnid;
  24.         EXIT WHEN NOT FOUND;
  25.         PERFORM schema._pg_object_utility(columnid);
  26.     END LOOP;
  27.  
  28.     CLOSE temp;
  29.  
  30.     ----------------------------------------------------------------------------
  31.     -- make up a reference to the resulting table and return it to an external 
  32.     --                              program
  33.     ----------------------------------------------------------------------------
  34.  
  35.     OPEN rc FOR SELECT * FROM schema.tempobjectlist;
  36.  
  37.     RETURN rc; 
  38. END;
  39. '
  40. LANGUAGE 'plpgsql';
  41.  
  42.  
this program show the error when create the function in PGadmin database
error is
syntax error at or near
line3 columnid int4;
Apr 7 '07 #1
2 2857
michaelb
534 Recognized Expert Contributor
Hi,
I can't spot anything wrong around line 3. The function qualifier looks odd, but considering that Postgres did not complain about it I have to assume that you indeed created schema with the name "schema". Not a good choice for a schema name, but let's hope this won't cause any problems.

Lets try to get some more info, could you please run these queries and post the results:
Expand|Select|Wrap|Line Numbers
  1. select nspname from pg_namespace;
  2. select current_schema();
  3. select version();
  4.  
At the same time you can start debugging the problem;
Get rid of the schema qualifier and start with a truncated version of your function, something like this:
Expand|Select|Wrap|Line Numbers
  1. CREATE OR REPLACE FUNCTION _pg_object_getobjectlist(varchar)
  2. RETURNS refcursor AS
  3. '
  4. DECLARE
  5. columnid int4;
  6. search_string varchar;
  7. temp refcursor;
  8. rc refcursor;
  9. BEGIN
  10. search_string := \'%\' || $1 || \'%\';
  11. return temp;
  12. END;
  13. '
  14. LANGUAGE 'plpgsql';
  15.  
To eliminate any possible interference you may want to do it directly in psql session, rather than going through pgAdmin.

Let us know what happened.
Apr 8 '07 #2
rajeev85
3 New Member
thanks for suggestion. i completly solve this problem.
Apr 8 '07 #3

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

Similar topics

3
2753
by: Allan | last post by:
I use select @@identity to return @@identity from my store procedure, but I could not retrive it from my Visual basic code, like variable= oRS.fields.item(0).value, it always says item can not be found....
2
3912
by: eric | last post by:
Hi Does any one know how to retrive data from foxpro 2.6 memo field in c#. I just manage to retrive the first row. /Eric
2
1661
by: Terry | last post by:
Any .dll or COM+ for .Net can help me retrive data from a Access file? The table contain several columns and the last one is a container which I store Article; because each article is a little bit huge, so when I store it, it ask me if I want to pack it (the article) into a object then I click 'Yes'. But now I need to retrive data from the file and show it by datagrid, and now I don't know what kind of data type it is (when I click it, it...
8
2534
by: asenthil | last post by:
Hai, i'm having a string in a specific field of a database... now i want to retrive that string from the database and i have to write that string into a xml file.... retriving is not a problem for me... but how can i write that string to a xml file....
4
4005
by: khyati30 | last post by:
hi, i am working on asp i am facing problem in asp , combox i want to retrive data in textbox , from combobox . in combobox , when i select particular user , i want to fetch that regarding data from database in the textfield . so i am facing problem that reply thanks
0
1656
nehashri
by: nehashri | last post by:
hi, I need one help regarding Asp with MsAccess database. Problem. ======== i want to retrive stored image from the MSAccess database using asp.
23
3423
nehashri
by: nehashri | last post by:
hi i am designing a database using Ms Access and ASP. i have 3 tables in access namely 'PERSONAL', other as 'POLICY' and 3rd one is named as 'STAFF'. in the contact table i have ID, Name, Children as fields. Also in policy table the firlds are:- ID, date_of_policy, no_policy, amount_paid, amount_balance and similarly the 3rd ie., staff has few fields. all three are linked my a common field which is ID all i want is when the user searches...
1
3358
by: amritranjan | last post by:
How to retrive image file from MS access database and display this in another JSPpage -------------------------------------------------------------------------------- This is my Jsp code for image upload in database: -----------Upload.jsp---------------- <html> <head> <title>Account Details </title>
1
977
by: senthiltr86 | last post by:
hai, i want to retrive the contents from one aspx page.i used some buttons like submit,view mail.i want to retrive the contents before this buttons.could you pls tell me how can i retrive without submit.. buttons.thank you
1
1774
by: mahesh123 | last post by:
Hi Folks, I am using the SQL Server 2000 as back end in my project. I have one problem that saving and retrive the image from the SQL Server 2000. So please help me regarding the saving and retrive the images from the SQL Server 2000. if there is any sample or example of the VB code please send to me. Thanks in advance Mahesh
0
10164
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...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
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...
0
6649
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
5277
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
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3926
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
3
2806
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.