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     [SOLVED] Maintain Sybase SQL passthru example needed

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Maintain Sybase SQL passthru example needed
 Login/Join
 
Member
posted
Does anyone have a complete working example of a simple Sybase (15) SQL passthru for Maintain 7.7? I found the SYS_MGR.ENGINE documentation at

Maintain Language Reference

but being new to WF/Maintain I am struggling to complete working code. A version I have tried is the following:

  
...
               else begin;
                  $$ insert row into TPR_activity to record change to comment
                  Compute rc/i8;
                  Type "Inserting row into table TPR_activity ";
                  rc=sys_mgr.engine("SQLSYB","set connection_attributes SBOS509_DEV3/a_user,the_password");
                  Type "ReturnCode=<<rc DBMS Err=<<SYS_MGR.DBMS_ERRORCODE";
                  rc=sys_mgr.engine("SQLSYB","insert into dbo.TPR_activity values('ars1', ..., 'anv1');");
                  Type "ReturnCode=<<rc DBMS Err=<<SYS_MGR.DBMS_ERRORCODE";
                  $$




which gets the result:

 (FOC1400) SQLCODE IS 4 (HEX: 00000004) 
 (FOC1394) CONNECT FAILURE 
   : ct_connect(): network packet layer: internal net library error: Error st
   :  ring not available                                                     

 (FOC1414) EXECUTE IMMEDIATE ERROR. 
 (FOC1400) SQLCODE IS 4 (HEX: 00000004) 
 (FOC1394) CONNECT FAILURE 
   : ct_connect(): network packet layer: internal net library error: Error st
   :  ring not available                                                     
 (FOC1414) EXECUTE IMMEDIATE ERROR. 
 Inserting row into table TPR_activity
 ReturnCode=      -1DBMS Err=       4
 ReturnCode=      -1DBMS Err=       4



So my connect is obviously failing, but I have not been able to find much information on correct usage for Sybase connect strings for Maintain passthru.

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


7.7.02
Solaris
HTML/PDF
 
Posts: 3 | Location: Texas | Registered: November 21, 2011Report This Post
Expert
posted Hide Post
Does SQL passthrough work outside of maintain ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Master
posted Hide Post
WAZ has a great point. See if the procedure that you are trying to run works outside of Maintain. Create a FEX, hardcode the values, and see if that runs.

What you can do is EXEC the procedure from Maintain and pass in the variables. But first get the logic to work.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Member
posted Hide Post
Ok, good suggestion - I ran it from a fex successfully:

-* File sqltrans.fex
ENGINE SQLSYB SET DEFAULT_CONNECTION SBOS509_DEV3
SQL SQLSYB
insert into dbo.TPR_activity values('ars3', ..., 'anv1');


Then I tried transcribing the SET DEFAULT_CONNECTION into a sys_mgr.engine call, but got a complaint about "set default_connection" not being a valid command (are these documented anywhere?). So I removed this call, leaving just the call with the insert, and it worked. Maintain must be mapping SQLSYB to SBOS509_DEV3 automatically somehow. Thanks for the help! - Rich


7.7.02
Solaris
HTML/PDF
 
Posts: 3 | Location: Texas | Registered: November 21, 2011Report This Post
Expert
posted Hide Post
If it worked without the SET DEFAULT_CONNECTION setting, then its probably in the edasprof anyway.



Could you please update the first post in this thread, and add [SOLVED] in the title.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report 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     [SOLVED] Maintain Sybase SQL passthru example needed

Copyright © 1996-2020 Information Builders