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]Delete rows from a SQL Server table using WebFocus

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Delete rows from a SQL Server table using WebFocus
 Login/Join
 
Platinum Member
posted
I am writing information to a sql table nightly from a .fex but want to remove all records in the table before loading them. Has anyone done this before?

Using the following two step procedure removes the rows from the table if it finds a match but it doesn't remove rows if there is no match.

 MODIFY FILE ACVADVR
FIXFORM FROM ADVRHOLD
MATCH Pidm
ON NOMATCH INCLUDE
ON MATCH DELETE
DATA ON ADVRHOLD
END

MODIFY FILE ACVADVR
FIXFORM FROM ADVRHOLD
MATCH Pidm
ON NOMATCH INCLUDE
ON MATCH REJECT
DATA ON ADVRHOLD
END 

This message has been edited. Last edited by: <Emily McAllister>,


WF8
Windows
 
Posts: 117 | Registered: May 28, 2015Report This Post
Virtuoso
posted Hide Post
If you're trying to remove all records from the table why not use a SQL command to truncate or delete from the table instead of MODIFY? Also, your code is saying ON NOMATCH INCLUDE which means if there's a Pidm in ADVRHOLD that doesn't exist in ACVADVR it'll get inserted into the table.

What's the source of the data?


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Expert
posted Hide Post
Trudy,
May want to bookmark this site, very helpful...
Tom

SQL Delete and Other Stuff


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Master
posted Hide Post
how are you populating advrhold?

If you are doing something like

SET HOLDLIST=PRINTONLY

TABLE FILE ACVADVR
PRINT PIDM NOPRINT
BY PIDM
ON TABLE HOLD AS ADVRHOLD
END  


You would be pulling all of the records assuming that pidm is your key. I'm guessing that the table is probably keyed on PIDM, ADVISOR_PIDM, ADVISOR_TYPE, and Some Sequence number knowing banner.... So you probably want to match on those keys instead.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013Report This Post
Virtuoso
posted Hide Post
ENGINE SQLMSS SET DEFAULT_CONNECTION YOUR_CONNECTION_NAME (you can find this in ACVADVR.ACX)
SQL SQLMSS DELETE xxx.ACVADVR; (fully qualified tablename also in the same .ACX file)
COMMIT;
END


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Virtuoso
posted Hide Post
Unless you need a log of records deleted, I would use the SQL TRUNCATE command instead of DELETE because it is faster and does a more thorough job of cleaning up the table space.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Master
posted Hide Post
The easiest way would be to do this with Maintain!

MAINTAIN FILE ACVADVR
FOR ALL NEXT Pidm INTO STK
FOR ALL DELETE Pidm FROM STK
END

This will remove all of the records from the database without dropping the table.

Mark Derwin
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report 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]Delete rows from a SQL Server table using WebFocus

Copyright © 1996-2020 Information Builders