Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] How to use Oracle bind variables in a SQL report

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] How to use Oracle bind variables in a SQL report
 Login/Join
 
Silver Member
posted
Hi all, we would like using Oracle bind variables in some of our reports and need your help for that.

We found the following example creates an Oracle table from the CAR file, then issues a PREPARE followed by queries that pass two parameters, it works pretty well.
--------------------
TABLE FILE CAR
PRINT SEATS
BY COUNTRY
BY CAR
ON TABLE HOLD AS BAUCAR FORMAT SQLORA
END

SQL SQLORA BEGIN SESSION

SQL SQLORA PREPARE ABC FOR SELECT * FROM BAUCAR WHERE COUNTRY=:0001 AND
SEAT=:0002;
END

SQL SQLORA BIND ABC USING CHAR(10), DECIMAL(4);
END

-* repeat with different input data...

SQL SQLORA EXECUTE ABC USING 'ENGLAND',2 ; TABLE FILE ABC PRINT *
END

SQL SQLORA EXECUTE ABC USING 'FRANCE',5 ; TABLE FILE ABC PRINT *
END

SQL SQLORA EXECUTE ABC USING 'ITALY',4 ; TABLE FILE ABC PRINT *
END

SQL SQLORA EXECUTE ABC USING 'JAPAN',4; TABLE FILE ABC PRINT *
END
----------------------

*But the difference is that our reports are SQL reports (Type SQL statements in the report request). I failed to use Oracle bind variables based on the example above.
*Could you please provide a correct example or tell me where is wrong in the following code, appreciate!

------------------
ENGINE SQLORA SET DEFAULT_CONNECTION &DEFCONN
SQL SQLORA PREPARE SQLOUT FOR
---SQL here----
END

TABLE FILE SQLOUT
PRINT
QUESTION
IS_ACTIVE
REVISION
COMMENTS
BY QUESTION_ID
ON TABLE HOLD AS HOLD_IT FORMAT SQLORA
END

SQL SQLORA BEGIN SESSION

SQL SQLORA PREPARE ABC FOR SELECT * FROM HOLD_IT WHERE QUESTION=:0001 AND REVISION=:0002;
END

SQL SQLORA BIND ABC USING VARCHAR2(300), NUMBER(38);
END

SQL SQLORA EXECUTE ABC USING 'I05479',1 ; TABLE FILE ABC PRINT *
END
---------------------

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


7703 on Linux, Windows
ReportCaster
PDF, HTML, Excel, AHTML, and CSV
 
Posts: 40 | Registered: January 31, 2008Report This Post
Guru
posted Hide Post
quote:
Oracle bind variables


The following link is similar to the example you provided above.

How to use Oracle bind variables in a query

Did you review the document that is referred to at the end of the example?

This is further documented in the Relational Data Adapter User's Manual:

Are you still using WebFOCUS 7.1.7 ??? Please update your profile if not.

Thank you for participating in the Focal Point Forum!
Tamra Colangelo
Focal Point Moderator
Information Builders


WebFOCUS 8x - BI Portal, Developer Studio, App Studio, Excel, PDF, Active Formats and HTML5
 
Posts: 487 | Location: Toronto | Registered: June 23, 2009Report This Post
Silver Member
posted Hide Post
Thanks Tamra! I updated my profile.

I read Relational Data Adapter User’s Manual, but it is not helping me on how to use Oracle Bind Variables.
Also we are directly connecting to remote DB Server rather than using Adapter.

Does anyone have ideas to use Oracle Bind Variables in a SQL report? Thanks for help.


7703 on Linux, Windows
ReportCaster
PDF, HTML, Excel, AHTML, and CSV
 
Posts: 40 | Registered: January 31, 2008Report This Post
Virtuoso
posted Hide Post
Hi TechLights

I found this old FP post that may help. http://forums.informationbuild...1057331/m/8047044766

If not you should probably open a case with techsupport and hopefully they can assist you with this.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
 
Posts: 2127 | Location: Customer Support | Registered: April 12, 2005Report This Post
Silver Member
posted Hide Post
Hi Chuck,
Good suggestion. We will open a case with tech-support. Thanks!

By the way, we found this old FP post too.


7703 on Linux, Windows
ReportCaster
PDF, HTML, Excel, AHTML, and CSV
 
Posts: 40 | Registered: January 31, 2008Report This Post
Silver Member
posted Hide Post
I have got help from tech-support. I am in the progress to change a SQL report to use bind variables.

I met a difficulty in dealing with a calendar’ value that needs your help:

When client picks a date from calendar, the value will pass into the report as a string (mm/dd/yyyy), it is easy to use to_date() function to convert this string into date (mm/dd/yyyy) in the sql.

After use bind variables, this string must be converted before pass it into the sql. Any idea how to do this?

Thanks for help!


7703 on Linux, Windows
ReportCaster
PDF, HTML, Excel, AHTML, and CSV
 
Posts: 40 | Registered: January 31, 2008Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] How to use Oracle bind variables in a SQL report

Copyright © 1996-2020 Information Builders