473,395 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

how retrive this problem

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 2847
michaelb
534 Expert 512MB
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
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
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...
2
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
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...
8
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...
4
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...
0
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
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...
1
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...
1
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 ...
1
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.