SQLPlus Spool Append - sqlplus

I am using a sqlplus script to generate a spool file without any issues. The file generated is html. It generates a table as shown below. I would like to add a text before the table as shown below "Alert Description"
Below is the code I am running. I am not sure where I can add the Alert Description to the Spool File or script. Any help will be appreciated.
SET LINESIZE 32767;
SET PAGESIZE 32767;
SET FEEDBACK OFF
SET MARKUP HTML ON SPOOL ON
SPOOL D:\ALERT_RETURNS.html ;
Select a, b, c, d
From
Table
Where
rs.RUN_DATE >= sysdate - 15/1440
/
spool off;
exit;

I used the prompt which will add a text as needed.

Related

How to copy from nvim to clipboard. (nvim remote or in Docker)

I can't figure out how to copy from vim, and paste to another console tab.
For instance, I'm using the preconfigured nvimdocker / ansible-neovim-pyright container. I did try:
set mouse= I can copy/paste with middle click, but I get the column with line numbers in the clipboard. Makes it unpracticable to copy few lines of script.
set mouse=nv This is great, I can select the text without the line numbers. Potentially right-click->Copy. But none of the * (highlight clipboard) nor + (system clipboard) registers are working. (None of the middle-click or explicit paste will work).
Obviously, it's not possible to access the system clipboard from remote, and xclip cannot help. I think the problem is similar when using a remote nvim through SSH (with no X redirection).
But how could I have the 'highlight' clipboard ? Is there maybe a (n)vim command to temporarily disable the left column with numbers/git/modifs/coc-errors ?
Thanks,

Creating a link to the top of the page for each tab of an excel spreadsheet in SAS using proc report

My goal is to create a mulitab spreadsheet as an output from proc report and have the user able to navigate within each tab using the links I created. This should include going to the top of the page. I am a novice programmer and experiencing
issues with proc report. I try using the footnote statement with success. I received an error message saying "can not open Excel".
Here is my SAS code:
%MACRO rpt_top(COL,TITL,YR) ;;
DATA TMP4;
SET COMBO(WHERE=(VARNAME=&COL));
RUN;
ODS LISTING CLOSE;
ODS EXCEL FILE= "&my_excel_file." STYLE=SASWEB
OPTIONS
(SHEET_NAME ="Test"
SHEET_INTERVAL="NONE" STYLE='SASWEB'
EMBEDDED_TITLES = 'YES' EMBEDDED_FOOTNOTES = 'YES' BOX='YES'
/*TAB_COLOR='GREEN'**/ frozen_headers='6' autofilter='YES' Autofit_height='yes' orientation='Landscape' suppress_bylines='YES');
TITLE1 J=LEFT BOLD "TESTING";
footnote LINK="#'Test'!A4" '(CLICK TO RETURN TO TOP)';
ODS EXCEL OPTIONS
(STYLE='SASWEB' SPLIT='/'
orientation='Landscape' suppress_bylines='YES');
PROC REPORT DATA=TMP4 NOWD;
COLUMNS VARNAME
DEFINE VARNAME /DISPLAY FORMAT=$32. 'LINE NUMBER DESCRIPTION';
RUN;
%MEND;
ODS EXCEL CLOSE will normally automatically open then output file in Excel.
When developing your ODS EXCEL output, you are likely attempting to use the same filename while the prior iteration is still open in Excel. That is when you will see a log message like
ERROR: File is in use, c:\temp\sample.xlsx.
The alert might be slightly different is using Enterprise Guide.
While developing, either be sure to close Excel before rerunning code, or use a incremental output filename.
For example
filename xlout "c:\temp\sample.xlsx"; * for production use;
filename xlout "%sysfunc(pathname(WORK))\sample-%sysfunc(monotonic()).xlsx"; * for development use;
With the incremental filenaming it becomes easier to compare and contrast effects of statements on output.

Using google query to download parts of a published sheet

This works:
curl 'https://docs.google.com/spreadsheets/d/e/2PACX-1vS3iBtVf4i_won5zAN9NGPqhcd6CcTb-4QHxpisSjCmlgV95B6mFmZvtMaC9GPvD7m8kD-6XLkVAhfc/pub?gid=911257845&single=true&output=csv'
however I want to only pick up rows where count > 300.
The query before encoding would be
select * where F > 300
After encoding
select%20*%20where%20F%3E300
So the url becomes
https://docs.google.com/spreadsheets/d/e/2PACX-1vS3iBtVf4i_won5zAN9NGPqhcd6CcTb-4QHxpisSjCmlgV95B6mFmZvtMaC9GPvD7m8kD-6XLkVAhfc/pub?gid=911257845&output=csv&tq=select%20*%20where%20F%3E300
The line above works retrieves a file, but it returns the whole file, and doesn't filter.
Note that a published web sheet has the form
https://docs.google.com/spreadsheets/d/e/KEY/pub?gid=GID
https://docs.google.com/spreadsheets/d/e/2PACX-1vS3iBtVf4i_won5zAN9NGPqhcd6CcTb-4QHxpisSjCmlgV95B6mFmZvtMaC9GPvD7m8kD-6XLkVAhfc/pub?gid=911257845
This works. Adding &output=csv to it (no space before the &) works, and it downloads as a csv file. This opens in excel and shows the data in the table.
I tried this:
https://docs.google.com/spreadsheets/d/e/2PACX-1vS3iBtVf4i_won5zAN9NGPqhcd6CcTb-4QHxpisSjCmlgV95B6mFmZvtMaC9GPvD7m8kD-6XLkVAhfc/pub?gid=911257845&output=csv&tq=select%20*%20where%20F%3E%20300
and
https://docs.google.com/spreadsheets/d/e/2PACX-1vS3iBtVf4i_won5zAN9NGPqhcd6CcTb-4QHxpisSjCmlgV95B6mFmZvtMaC9GPvD7m8kD-6XLkVAhfc/gviz/tq?gid=911257845&output=csv&tq=select%20*%20where%20F%3E300
and get errors -- resource not available.
The page above should be public for people who want to try.
This may be an issue between publishing a sheet, and sharing a whole spread sheet to anyone who has the link.
I've created a new page that uses importrange() that slurps up the page from the main sheet, and that one is public.
https://docs.google.com/spreadsheets/d/1-lqLuYJyHAKix-T8NR8wV8ZUUbVOJrZTysccid2-ycs/edit?usp=sharing
How about this modification?
Modification points :
When it uses query, please use like https://docs.google.com/spreadsheets/d/### file ID ###/gviz/tq?gid=###&tq=### query ###.
When select%20*%20where%20%F%3E300 is decoded, it is select * where %F>300.
select * where F > 300 is select%20%2a%20where%20F%20%3e%20300.
In order to output CSV, please use tqx=out:csv.
Please share the Spreadsheet.
On Google Drive
On the Spreadsheet file
right-click -> Share -> Advanced -> Click "change" at "Private - Only you can access"
Check "On Anyone with the link"
Click "Save"
At "Link to share", copy URL.
Retrieve file ID from https://docs.google.com/spreadsheets/d/### file ID ###/edit?usp=sharing
Modified curl command :
curl 'https://docs.google.com/spreadsheets/d/### file ID ###/gviz/tq?gid=911257845&tq=select%20%2a%20where%20F%20%3e%20300&tqx=out:csv'
Reference :
Query Language Reference
If I misunderstand your question, I'm sorry.
Edit :
The following 2 URLs are the comparison between your URL and my answer. The URL of my answer was matched to your URL.
1. Your URL
https://docs.google.com/spreadsheets/d/e/2PACX-1vS3iBtVf4i_won5zAN9NGPqhcd6CcTb-4QHxpisSjCmlgV95B6mFmZvtMaC9GPvD7m8kD-6XLkVAhfc/gviz/tq?gid=911257845&output=csv&tq=select%20*%20where%20F%3E300
When above URL is separated,
https://docs.google.com/spreadsheets/d/e/
e/ is not required.
2PACX-1vS3iBtVf4i_won5zAN9NGPqhcd6CcTb-4QHxpisSjCmlgV95B6mFmZvtMaC9GPvD7m8kD-6XLkVAhfc
This is not the file ID of spreadsheet.
/gviz/tq
gid=911257845
output=csv
tq=select%20*%20where%20F%3E300
2. In my answer matched to your URL
https://docs.google.com/spreadsheets/d/### file ID ###/gviz/tq?gid=###&tqx=out:csv&tq=### query ###
When above URL is separated,
https://docs.google.com/spreadsheets/d/
### file ID ###
You can see the detail of the file ID of spreadsheet at here.
/gviz/tq
gid=###
You can use gid=911257845.
tqx=out:csv
This has to be used instead of output=csv.
tq=### query ###
You can use tq=select%20*%20where%20F%3E300.
Note :
Each number corresponds.
And please share the Spreadsheet as follows. This is difference from "Publish to the web" on Spreadsheet.
On Google Drive
On the Spreadsheet file
right-click -> Share -> Advanced -> Click "change" at "Private - Only you can access"
Check "On Anyone with the link"
Click "Save"
At "Link to share", copy URL.
Retrieve file ID from ``https://docs.google.com/spreadsheets/d/###

Error loading txt files to synedit

I'm trying to load the text from a text file to a synmemo by using
procedure TForm1.btn7Click(Sender: TObject);
begin
if dlgOpen1.Execute then
synm1.Lines.LoadFromFile(dlgOpen1.Files.Text);
end;
But as soon as I select a file i get this error:
Cannot open file "C:\Users\adria\Desktop\New Text Document.txt
". The filename, directory name, or volume label syntax is incorrect.
Component: https://github.com/TurboPack/SynEdit
The problem is in the use of the Files property of the dialog to access the selected filename.
The Files property is a list of strings intended for use when you have enabled multiple selection in the dialog and need to process more than one filename selected by the user.
The Text property of string list returns a formatted representation of all entries in that list with each entry delimited by an EOL character (or characters).
You might expect that where only a single file is involved that this Textproperty would contain only the name of that file. But in fact it also includes an EOL character. i.e. the filename you are trying to open by using this technique is actually:
'C:\Users\adria\Desktop\New Text Document.txt'#13#10
There was actually a clue to this in the way that the message was being displayed, with the closing quotes on a separate line as a result of that EOL.
The correct way to work with the selected filename depends on whether you are supporting multiple selection or single.
In the case of single selection (your case here) the simplest approach is to use the Filename property of the dialog:
if dlgOpen1.Execute then
synm1.Lines.LoadFromFile(dlgOpen1.Filename);
For multiple selection you would use the Files property, but access each filename by index in the list:
if dlgOpen1.Execute then
for i := 0 to Pred(dlgOpen1.Files.Count) do
begin
// Do something with each dlgOpen1.Files[i] ...
end;

saving data with TextEdit

I want to use TextEdit to save data. what I have so far
tell application "TextEdit"
open /Users/UserName/Desktop/save.rtf
end tell
This gives me
"Expected “given”, “in”, “of”, expression, “with”, “without”, other parameter name, etc. but found unknown token."
and highlights the . in .rtf I tried removing the .rtf
but when I compile it it turns into
(open) / Users / username / desktop / (save)
This code gives "The variable Users is not defined."
also if possible can I have TextEdit run in the background without opening a window?
Put quotes around the path and use POSIX file to get a file object for the path:
tell application "TextEdit"
open POSIX file "/Users/UserName/Desktop/save.rtf"
end tell
You can modify the text of a document by changing the text property:
tell application "TextEdit"
set text of document 1 to text of document 1 & "aa"
end tell
It removes all styles in rich text documents. It also inserts the text as 12-point Helvetica in plain text documents, regardless of the default font.
Creating a new rtf file:
tell application "TextEdit"
make new document at beginning with properties {text:"aa"}
close document 1 saving in POSIX file "/tmp/a.rtf"
end tell
printf %s\\n aa | textutil -inputencoding UTF-8 -convert rtf -stdin -output a.rtf

Resources