Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, November 25, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Reporting & Notification Forums - Reporting
Forum to discuss reports for SalesLogix including Crystal, SQL Reports, etc. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Reporting | New ThreadView:  Search:  
 Author  Thread: Push database View out to remote clients
Adam Conde
Posts: 13
 
Push database View out to remote clientsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Oct 06 2:30 PM
fiogf49gjkf0d
Some of my Crystal Reports use views that i've created on the SQL server. But these reports don't work where remote users run them because their remote databases don't have these views.

Is there a way to push these views out to remote users?
I was thinking I could create a SQL script in architect and use an Agent to run the view on the remote database, but I'm not sure if this is the right way to do it.
Please advise.

Thank you very much!
[Reply][Quote]
Stuart
Posts: 178
 
Re: Push database View out to remote clientsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Oct 06 2:37 AM
fiogf49gjkf0d
I would be very interested in knowing a way to do this, as I have exactly the same issue. I tried to create the Views in Administrator using Execute SQL, thinking it would then sync the changes, but it said it was 'Not Testable' and left the Execute button greyed out so I couldn't run it.
[Reply][Quote]
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Re: Push database View out to remote clientsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Oct 06 7:23 AM
fiogf49gjkf0d
I've done this a very long time ago. It involved a batch file, a SQL file and OSQL. Basically you have to send the two files to the user who then saves them locally and then runs the batch file. The batch file calls OSQL and uses the SQL file as input. The SQL file then adds the view(s) to the remote database.

I'll look around for an example, but at this point I have not clue where one might be.

John G.
[Reply][Quote]
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Re: Push database View out to remote clientsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Oct 06 7:56 AM
fiogf49gjkf0d
I'll look around for an example

I found my example! Its not a batch file but a .CMD file that was created. My example is as following

FILE: createview.cmd
osql -dslxremote -Usa -P -icreateview.sql
pause


FILE: createview.sql
SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON
GO
CREATE VIEW sysdba.c_OppAccountDet
AS
SELECT TOP 100 PERCENT USERINFO.REGION, seccode.SECCODEDESC, USERINFO.USERID, USERINFO.USERNAME, seccodejoins.PROFILEID, ACCOUNT.ACCOUNT, OPPORTUNITY.DESCRIPTION,
OPPORTUNITY.ESTIMATEDCLOSE, OPPORTUNITY.ACTUALCLOSE, OPPORTUNITY.CLOSEPROBABILITY, OPPORTUNITY.STATUS, PRODUCT.FAMILY,
PRODUCT.NAME, CAST(OPPORTUNITY_PRODUCT.EXTENDEDPRICE AS int) AS ExtendedPrice, CAST(C_SIN_OPPPRODUCT.PROFIT_AMOUNT AS int)
AS Profit_Amount, CAST(C_SIN_OPPPRODUCT.PROFIT_MARGIN AS decimal(15, 2)) AS Profit_Margin
FROM sysdba.OPPORTUNITY OPPORTUNITY LEFT OUTER JOIN
sysdba.OPPORTUNITY_PRODUCT OPPORTUNITY_PRODUCT ON
OPPORTUNITY.OPPORTUNITYID = OPPORTUNITY_PRODUCT.OPPORTUNITYID INNER JOIN
sysdba.PRODUCT PRODUCT ON OPPORTUNITY_PRODUCT.PRODUCTID = PRODUCT.PRODUCTID LEFT OUTER JOIN
sysdba.C_SIN_OPPPRODUCT C_SIN_OPPPRODUCT ON
OPPORTUNITY_PRODUCT.OPPPRODUCTID = C_SIN_OPPPRODUCT.OPPPRODUCTID INNER JOIN
sysdba.ACCOUNT ACCOUNT ON OPPORTUNITY.ACCOUNTID = ACCOUNT.ACCOUNTID LEFT OUTER JOIN
sysdba.USERINFO USERINFO ON OPPORTUNITY.ACCOUNTMANAGERID = USERINFO.USERID INNER JOIN
sysdba.USERSECURITY USERSECURITY ON USERINFO.USERID = USERSECURITY.USERID INNER JOIN
sysdba.SECCODEJOINS seccodejoins ON USERSECURITY.DEFAULTSECCODEID = seccodejoins.CHILDSECCODEID INNER JOIN
sysdba.SECCODE seccode ON seccodejoins.PARENTSECCODEID = seccode.SECCODEID
WHERE (seccodejoins.CHILDSECCODEID =
(SELECT _seccodejoins.childseccodeid
FROM sysdba.usersecurity _usersecurity INNER JOIN
sysdba.seccodejoins _seccodejoins ON _usersecurity.defaultseccodeid = _seccodejoins.childseccodeid
WHERE _seccodejoins.childseccodeid = seccodejoins.childseccodeid
GROUP BY _seccodejoins.childseccodeid)) AND (SUBSTRING(seccode.SECCODEDESC, 5, 1) = '-')
ORDER BY
opportunity."estimatedclose" ASC,
USERINFO."REGION" ASC,
SECCODE."SECCODEDESC" ASC,
USERINFO."USERNAME" ASC,
ACCOUNT."ACCOUNT" ASC,
PRODUCT."FAMILY" ASC,
PRODUCT."NAME" ASC
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
QUIT


You can create multiple views and/or stored procedure via the createview.sql file. Just add the appropriate create view/procedure and your set.

As for distribution.. you are depending on the user being able to get to the files and then saving them locally. This is easy if the user is in the office at times, just send them to a shared network resource. But for the truely remote users you'll have to get creative.

This is making me wonder if the Administrator SQL could just be used. That is, plug the SQL create view statement into the Administrator SQL, then when you execute it on the database, send it to all remote databases. Sounds tidier, but the technique I showed above was devised as a result of a phone call to support on this very question. I think there was a reason why it wouldn't work via the Admin, but I can't recall what that reason was.

John G.
[Reply][Quote]
Zeph
Posts: 37
 
Re: Push database View out to remote clientsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Oct 06 8:57 AM
fiogf49gjkf0d
I believe in Version 7, the SLX OLE will be able to handle Create statements but I don't think that this is available in V6.

There was a pretty good article posted about this though.

http://www.slxdeveloper.com/page.aspx?action=viewarticle&articleid=78

Zeph
[Reply][Quote]
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Re: Push database View out to remote clientsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Oct 06 9:45 AM
fiogf49gjkf0d
I don't think that this is available in V6.


At the bottom of the article you listed it mentions

Now that SP4 (v6.2.4) is out you no longer have to do this.. The provider now supports CREATE and DROP. This was implemented to support new functionality comming in Scorpion (v7.0)... and it syncs.
[Reply][Quote]
Zeph
Posts: 37
 
Re: Push database View out to remote clientsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Oct 06 10:03 AM
fiogf49gjkf0d
Good stuff. I hadn't tried this since upgrading but it works like a charm. If you're running sp4 of course.
[Reply][Quote]
Stuart
Posts: 178
 
Re: Push database View out to remote clientsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Oct 06 6:42 AM
fiogf49gjkf0d
Using the technique mentioned in the comments to that article seems to work, and it says the changes will be sent to remotes. I haven't tried it in production yet, though.

If you run this in Administrator
EXEC('CREATE VIEW vTEST AS SELECT * FROM ACCOUNT WHERE ACCOUNT LIKE ''A%''')

It creates a view.
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/25/2024 7:14:11 AM