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     SQL Passthru error. Please help!

Read-Only Read-Only Topic
Go
Search
Notify
Tools
SQL Passthru error. Please help!
 Login/Join
 
Member
posted
Hi All,

I am using SQL passthru in the following format and it works:

SQL SQLMSS SET DEFAULT_CONNECTION conn1
SQL SQLMSS PREPARE SQLOUT FOR
select * from db_name.dbo.table_name
;
END
TABLE FILE SQLOUT
PRINT *
END

But, when the report is ready to be run against a different connection and db, I have to rename all the connection names and db names.

Changing connection name - we can live with that.

But why do we need to prefix the db_name? If I dont prefix I get the following error -

(FOC1400) SQLCODE IS 208 (HEX: 000000D0) XOPEN: 42S02
: Microsoft OLE DB Provider for SQL Server: [42S02] Invalid object name 'table_name'. [42000] Statement(s) could not be prepared. [] Deferred pre
: pare could not be completed.
L (FOC1405) SQL PREPARE ERROR.
(FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: SQLOUT
BYPASSING TO END OF COMMAND

Any help on this issue is very much appreciated.

Thanks.

This message has been edited. Last edited by: BIGuru,
 
Posts: 14 | Registered: September 13, 2007Report This Post
Virtuoso
posted Hide Post
What type of data base? db_name is associated with table space in the db2 world, and for different environments it can be different.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Member
posted Hide Post
quote:
db_name

Leah,
We are using SQL Server 2005.


---------------------------------
Prod - WebFOCUS 7.7.03/ MS-SQL Server 2005/ParAccel/Windows 2008 R2 64Bit
Test - WebFOCUS 7.7.03/ MS-SQL Server 2005/ParAccel/Windows 2008 R2 64Bit
Dev - WebFOCUS 7.7.03/ MS-SQL Server 2005/ParAccel/Windows 2008 R2 64Bit
Output - PDF/HTML/AHTML/Excel
 
Posts: 14 | Registered: September 13, 2007Report This Post
Guru
posted Hide Post
Have you tried using variables for both the connection and db_name? I used it at one job, it was their standard. What you do is set up a
-include Names, which is a member in your procedure library, and depending on which db you are going against, you just -include the correct names.


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
Member
posted Hide Post
I tried that and it works with the db_name prefix:
-INCLUDE app/abc.fex
SQL SQLMSS PREPARE SQLOUT FOR
select * from db_name.dbo.table_name
;
END
TABLE FILE SQLOUT
PRINT *
END


However it does not work without the db_name prefix. That’s the big problem! This table exists in all the environments, so that should not be the problem.


---------------------------------
Prod - WebFOCUS 7.7.03/ MS-SQL Server 2005/ParAccel/Windows 2008 R2 64Bit
Test - WebFOCUS 7.7.03/ MS-SQL Server 2005/ParAccel/Windows 2008 R2 64Bit
Dev - WebFOCUS 7.7.03/ MS-SQL Server 2005/ParAccel/Windows 2008 R2 64Bit
Output - PDF/HTML/AHTML/Excel
 
Posts: 14 | Registered: September 13, 2007Report This Post
Expert
posted Hide Post
The same table-name could be used in multiple databases of connection conn1.

This is the normal behaviour of SQL Server: you have to specify database-name.table-name


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
So, anytime I move the report I need to manually change the connection name and the db name? There is no alternative?


---------------------------------
Prod - WebFOCUS 7.7.03/ MS-SQL Server 2005/ParAccel/Windows 2008 R2 64Bit
Test - WebFOCUS 7.7.03/ MS-SQL Server 2005/ParAccel/Windows 2008 R2 64Bit
Dev - WebFOCUS 7.7.03/ MS-SQL Server 2005/ParAccel/Windows 2008 R2 64Bit
Output - PDF/HTML/AHTML/Excel
 
Posts: 14 | Registered: September 13, 2007Report This Post
Expert
posted Hide Post
Doesn't it make sense that you have to do that?

If the db name is the same on all connections then you wouldn't have to change the dbname.

You could do what RSquared suggested, create an include:

-SET &CONN_NAME = 'CONN1';

-SET &DB_NAME = DECODE &CONN_NAME ('CONN1' 'DB1', 'CONN2' 'DB2', 'CONN3' 'DBXX' ELSE 'DBQS');


Then in your fex:


-INCLUDE CONNNAMES

...

SELECT * FROM &DB_NAME...TABLE_NAME

...


(Note the three dots after the Dialogue Manager variable)


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
Thanks! Thats what I was trying and looks like it will work.


---------------------------------
Prod - WebFOCUS 7.7.03/ MS-SQL Server 2005/ParAccel/Windows 2008 R2 64Bit
Test - WebFOCUS 7.7.03/ MS-SQL Server 2005/ParAccel/Windows 2008 R2 64Bit
Dev - WebFOCUS 7.7.03/ MS-SQL Server 2005/ParAccel/Windows 2008 R2 64Bit
Output - PDF/HTML/AHTML/Excel
 
Posts: 14 | Registered: September 13, 2007Report This Post
Master
posted Hide Post
quote:
But why do we need to prefix the db_name?


Sequel Squirmer connections can include the db_name by putting ;dbname at the end

eg ENGINE SQLMSS SET CONNECTION BILLGATES GATES/ilove,melinda;WILLIAM

accesses database WILLIAM on server GATES.



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006Report This Post
Expert
posted Hide Post
John, good point. Then you probably don't need to prefix the table name with the db name.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
That'll work! Thanks to everyone.


---------------------------------
Prod - WebFOCUS 7.7.03/ MS-SQL Server 2005/ParAccel/Windows 2008 R2 64Bit
Test - WebFOCUS 7.7.03/ MS-SQL Server 2005/ParAccel/Windows 2008 R2 64Bit
Dev - WebFOCUS 7.7.03/ MS-SQL Server 2005/ParAccel/Windows 2008 R2 64Bit
Output - PDF/HTML/AHTML/Excel
 
Posts: 14 | Registered: September 13, 2007Report 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     SQL Passthru error. Please help!

Copyright © 1996-2020 Information Builders