Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0037318
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Z. Otherscriticalalways2017-11-17 10:302023-05-02 09:24
Reporterjainsapna581View Statuspublic 
Assigned ToTriage Platform Base 
PriorityurgentResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSWindowsDatabasePostgreSQLJava version8
OS Version7Database version9.3Ant version1.9.7
Product Version3.0PR17Q1.1SCM revision 
Review Assigned To
Web browserGoogle Chrome
ModulesMy Openbravo Tab
Regression levelPackaging and release
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0037318: function which returns table

DescriptionWe are creating a function which returns table and able to export and package it in functional state. But when we install this module, we get below error for the procedure and procedure does not get created.

[java] 55489 WARN - SQL Command failed with: ERROR: cannot use RETURN QUERY in a non-SETOF function
[java] Position: 1596
[java] 55497 WARN - -- END
[java] -- -----------------------------------------------------------------------
[java] -- FUNCTION API_GETDATA
[java] -- -----------------------------------------------------------------
[java] CREATE OR REPLACE FUNCTION API_GETDATA(pcs OUT NUMERIC, quantity OUT NUMERIC)
[java]

Is there any way or alternative for such procedures where we need to return a table from procedures
Steps To Reproduce1. Create the below function

CREATE OR REPLACE FUNCTION api_getdata()
  RETURNS TABLE(pcs integer, quantity integer) AS
$BODY$
/******************************************************************************/
BEGIN
  RETURN QUERY select count(*) as pcs,round(qtyonhand,2) as quantity
from api_data;
END ; $BODY$
  LANGUAGE plpgsql VOLATILE


2. package it and install in other environment
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
causes feature request 0052297 newTriage Platform Base Add SETOF return value 

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2017-11-17 10:30 jainsapna581 New Issue
2017-11-17 10:30 jainsapna581 Assigned To => Triage Finance
2017-11-17 10:30 jainsapna581 Web browser => Google Chrome
2017-11-17 10:30 jainsapna581 Modules => My Openbravo Tab
2017-11-17 10:30 jainsapna581 Regression level => Packaging and release
2017-11-17 10:30 jainsapna581 Triggers an Emergency Pack => No
2023-04-29 01:33 axelmercado Relationship added causes 0052297
2023-05-02 09:24 aferraz Assigned To Triage Omni OMS => Triage Platform Base


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker