Focal Point
[SOLVED]Create Report with Synonym(stored procedure)

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/313103293

March 11, 2010, 08:48 PM
Yangyang
[SOLVED]Create Report with Synonym(stored procedure)
when i create new synonym with stored procedure

the stored procedure have parameter.

the created synonym like this:

SP_GET_USER.mas

INPUT:@id ,@name ...
OUTPUT:@RETURN_VALUE
ANSWERSET1:USEER_KEY,USEER_NAME.....


when i create report in fex file.


TABLE FILE SP_GET_USER
PRINT
'SP_GET_USER.ANSWERSET1.USEER_KEY'
'SP_GET_USER.ANSWERSET1.USEER_NAME'
HEADING
""
FOOTING
""
.................
.................


when i run the fex , i get the message :

(FOC1400) SQLCODE IS 201 (HEX: 000000C9) XOPEN: 42000
: Microsoft SQL Native Client: [42000] Procedure or function 'PS_WF_Custom
: erDropDownDates' expects parameter '@id , which was not supp
: lied.
L (FOC1406) SQL OPEN CURSOR ERROR.


i think the issue with the parameters(@id,@name...).

but i don't know how to supply the @id to fex file.

i try to
-DEFAULT @id=2;
-DEFAULT @name='test';
...........

but it's not work...

i read the document , i think i didn't find the correct way or ensample to do.


Thanks,
Yang

This message has been edited. Last edited by: Yangyang,


WebFOCUS 7.6.8
WebFOCUS 7.6.10
BI
FLEX
.NET
March 12, 2010, 01:49 AM
Ram Prasad E
Try this

-DEFAULT &id=2;
-DEFAULT &name='test';



WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/
March 12, 2010, 02:03 AM
<JG>
quote:
-DEFAULT &id=2;
-DEFAULT &name='test';

that will set defaults

What is required in the procedure

is WHERE ID EQ '&id' and WHERE TEST EQ '&test'
March 12, 2010, 04:28 AM
Yangyang
thanks Ram Prasad E
thanks JG

i'm did that ... but i not work ...

i found ohter problem ..
i can't find the "New Parameters Dialog Box"
like online help
http://documentation.informati...x.htm?url=layout.htm


the @id ,@name.... are required with procedure

Thanks,
James Yang


WebFOCUS 7.6.8
WebFOCUS 7.6.10
BI
FLEX
.NET
March 12, 2010, 09:21 AM
Ram Prasad E
jgelona, are you refering the below thread.

http://forums.informationbuild...71057331/m/276101293

This message has been edited. Last edited by: Ram Prasad E,


WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/
March 12, 2010, 09:27 AM
<JG>
James not sure which tool you are using but change
-DEFAULT to -DEFAULTS
March 12, 2010, 09:53 AM
njsden
quote:
change -DEFAULT to -DEFAULTS


That may not be necessary. I rarely (if ever) use -DEFAULTS. They are synonyms anyway and for whatever reason -DEFAULT just looks "neater" to me Wink

From documentation:

quote:

-DEFAULT commands set default values for local or global variables. Supplying default values to variables in a stored procedure helps ensure that it runs correctly.

Note that -DEFAULTS is a synonym for -DEFAULT




Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
March 12, 2010, 11:15 AM
<JG>
The problem is that the tools that you use to generate screens and prompts
prefer -DEFAULTS and -DEFAULTH

S meaning seen H meaning HIDDEN

or Prompt Do not Prompt.
March 12, 2010, 11:33 AM
njsden
I stand corrected, JG !

As I don't use any particular tool other than Dev. Studio's text editor and sometimes Unix's vi to directly edit .fex files the use of -DEFAULT has proven to be quite effective. As far as HTML launch pages are concerned, we still use and maintain our own old ASP-based reporting application with calls to server-based .fex procedures made through the WFServlet so we don't really use the HTML Layout painter or any of the other tools that came packed with Dev.Studio.

Here's me hoping that one day we'll upgrade our WF 5.3.4 environment to 7.6.x (or 8.x? ) so we can take advantage of the new functionality and tools but 'til then ... text editor it is.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
March 12, 2010, 08:49 PM
Yangyang
thanks Ram Prasad E
thanks njsden

thanks JG
i'm use version 7.6.8 .

hi jgelona,
i'm glad that you saw my qustion.


i try to
-DEFAULT &id=2;
-DEFAULT &name='test';

and

-DEFAULTS &id=2;
-DEFAULTS &name='test';

and

-DEFAULTS SP_GET_USER.INPUT.@id=2;
-DEFAULTS SP_GET_USER.INPUT.@name='A';

.. but it not work ....

thanks all , i will try other way.

Thanks,
James Yang

This message has been edited. Last edited by: Yangyang,


WebFOCUS 7.6.8
WebFOCUS 7.6.10
BI
FLEX
.NET
March 12, 2010, 10:10 PM
Ram Prasad E
To pass input parameter values to stored procedure, here is a snippet.

-SET &id=2;
-SET &name='''test''';

SQL SQLMSS
EXECUTE SP_GET_USER &id &name
;



WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/
March 12, 2010, 11:44 PM
Yangyang
Thanks Ram Prasad E

by the way , i used [synonym]

SP_GET_USER.mas

INPUT:@id ,@name ...
OUTPUT:@RETURN_VALUE
ANSWERSET1:USEER_KEY,USEER_NAME.....


use -set ... not work.

Thanks,
James Yang


WebFOCUS 7.6.8
WebFOCUS 7.6.10
BI
FLEX
.NET
March 14, 2010, 11:20 PM
Yangyang
can anybody help me on this ?

create report with synonym.mas(need parameter @id,@name....)


my step:
1.create synonym ,Restrict object type to :Stored Procedures ,select a stored Procedures and input @id,@name... subimt create synonym ,SP_GET_USER.mas it's ok.

2. in the test.fex , i create a report , select
SP_GET_USER.mas and dragging ANSWERSET1.USEER_KEY and ANSWERSET1.USEER_NAME to report , and run it :
i got the error:
(FOC1400) SQLCODE IS 201 (HEX: 000000C9) XOPEN: 42000
: Microsoft SQL Native Client: [42000] Procedure or function SP_GET_USER
: erDropDownDates' expects parameter '@id , which was not supp
: lied.
L (FOC1406) SQL OPEN CURSOR ERROR.

how can i pass the parameters to report or synonym ?

Thanks,
James Yang

This message has been edited. Last edited by: Yangyang,


WebFOCUS 7.6.8
WebFOCUS 7.6.10
BI
FLEX
.NET
March 15, 2010, 04:26 AM
Computix
You need to pass the parameter with IF:

TABLE FILE SP_GET_USER
PRINT whatever you need
IF @ID EQ 1
IF @NAME IS MISSING
END

regards,
Markus


WF 7.6.6 (MRE,BID, DevStudio, partly RC) on Windows 2003 /Apache/Tomcat
Output: HTML,Excel,PDF,PPT
Adapters: SQL Server, DB2, Oracle
March 15, 2010, 05:31 AM
Yangyang
thanks Computix ,

i'm try it , but i also error with @id,@name.....

i will check it with your idea again.

Thanks,
James Yang


WebFOCUS 7.6.8
WebFOCUS 7.6.10
BI
FLEX
.NET
March 16, 2010, 02:03 AM
Yangyang
quote:
Computix


hi computix,

i try to :

TABLE FILE SP_GET_USER
PRINT whatever you need
WHERE (SP_GET_USER.INPUT.@ID EQ 1 )
AND (SP_GET_USER.INPUT.@NAME EQ 'TEST')
AND....
END

or...

TABLE FILE SP_GET_USER
PRINT whatever you need
WHERE (@ID EQ 1 )
AND (@NAME EQ 'TEST')
AND....
END

i get the error :

0 ERROR AT OR NEAR LINE 30 IN PROCEDURE test1 FOCEXEC *
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED:
SP_GET_USER.INPUT.@id
BYPASSING TO END OF COMMAND
(FOC009) INCOMPLETE REQUEST STATEMENT


something wrong with that ?

Thanks,
James Yang


WebFOCUS 7.6.8
WebFOCUS 7.6.10
BI
FLEX
.NET
March 16, 2010, 02:27 AM
Yangyang
Thanks all

i found the issue ,

i just changed @ID to @id ...

it's work.

Thamks,
James Yang


WebFOCUS 7.6.8
WebFOCUS 7.6.10
BI
FLEX
.NET