Focal Point
[SOLVED] SQL Insert

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/215101761

June 30, 2009, 08:24 AM
Laurie
[SOLVED] SQL Insert
Can someone please help me with the syntax to run a SQL command which returns a result set and then insert it into a predefined master file table. This will give you an idea of what I am trying to do.

ENGINE SQLMSS SET DEFAULT_CONNECTION DevSalesDB
SQL SQLMSS
EX pss_GetMarketAnalysis 29645, 20723,0,0,1,0,'';

-RUN
SQL
INSERT INTO pss_getmarketanalysis (contractID, contractTermID) VALUES (contractID,contractTermID)

-RUN

This message has been edited. Last edited by: Kerry,
June 30, 2009, 09:10 AM
<JG>
something along the lines of

 
ENGINE SQLMSS SET DEFAULT_CONNECTION DevSalesDB
SQL SQLMSS
EX pss_GetMarketAnalysis 29645, 20723,0,0,1,0,'';
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD FORMAT ALPHA
END
-RUN
-READ HOLD &contractID.An. &contractTermID.An.
SQL
INSERT INTO pss_getmarketanalysis (contractID, contractTermID) VALUES (&contractID.EVAL,&contractTermID.EVAL)
END
-RUN
 


Where n is the length of the column
June 30, 2009, 10:13 AM
Tony A
Don't forget the semi colon and the TABLE FILE SQLOUT etc.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
June 30, 2009, 05:11 PM
Waz
For the Insert step, you could also use MODIFY or 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!

June 30, 2009, 06:19 PM
Laurie
Thank you for your suggestions. I have worked thru this now.