Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Oracle PL / SQL ( .PSP and .SQL file extension) #10863

Closed
smager opened this issue Apr 9, 2015 · 3 comments
Closed

Oracle PL / SQL ( .PSP and .SQL file extension) #10863

smager opened this issue Apr 9, 2015 · 3 comments

Comments

@smager
Copy link

smager commented Apr 9, 2015

Would it be possible if Brackets could have pl/sql as an extension?

@smager smager changed the title Oracle PL / SQL ( .PSP file extension) Oracle PL / SQL ( .PSP and .SQL file extension) Apr 9, 2015
@peterflynn
Copy link
Member

Tagging 'extension idea' so this will show up in lists of suggestions for extension authors. But I'll close this since this probably isn't something we'd add to the default download of Brackets -- the core of Brackets is focused primarily on front-end web technologies.

To give potential extension authors better guidance though, could you say more about exactly what features you'd want in a PL/SQL extension? You don't mean that Brackets should include an entire database engine built-in, right? Are you looking for the ability to connect to a database server and run commands, like a terminal? Or a visual database browser? Or features that help you write SQL query code -- if so, what sorts of features? Etc.

@smager
Copy link
Author

smager commented Apr 10, 2015

my suggestion is to add pl/sql for #1. syntax highlighting and #2. run command for (batch files *.bat), a run command is used to compile source code, see TextPad by Helios Software Solutions.

PL/ SQL is not only for database but it is also for front-end web technologies. We use pl / sql for custom web application, pl / sql for web are similar to Classic ASP and PHP.

Please see the sample below for pl / sql or web procedure file (*.psp)

filename = ebb_groups_form.psp

<%@ plsql procedure="ebb_groups_form" %>
<%@ plsql parameter="p_module_id" type="NUMBER" default="NULL"%>
<%@ plsql parameter="p_group_id" type="VARCHAR2" default="NULL"%>
<%!
l_dhtmlx_path VARCHAR2(100) := zsi_lib.DHTMLXPath;
l_js_path VARCHAR2(100) := zsi_lib.JSPath;
l_style_path VARCHAR2(128) := zsi_lib.StylePath;
l_title VARCHAR2(50);
l_date_format VARCHAR(20) := 'MM/DD/YYYY';
l_date VARCHAR(20) := TO_CHAR(SYSDATE,l_date_format);
l_rec ebb_groups%ROWTYPE;

l_group_id ebb_groups.group_id%TYPE := '';
l_group_name ebb_groups.group_name%TYPE := '';
l_group_desc ebb_groups.group_desc%TYPE := '';
l_group_level ebb_groups.group_level%TYPE := '';
l_user_iswrite NUMBER(1):=0;

%>
<%
ebb_pageheader(p_dgrid=>'Y', p_dwin=>'Y');
%>
<body>
<%

zsi_bs_lib.InputHiddenBox(p_inputName=>'p_group_id');
%>
<table class="table">
<tr>
<th nowrap align="left">Group Name</th>
<th nowrap align="left">Description</th>
<th nowrap align="center">Level</th>
</tr>
<%
FOR i IN 1..5 LOOP
%>
<tr>
<td><input type="hidden" name="p_group_id" value="">
<input type="text" name="p_group_name" value="" class="form-control input-sm">
</td>
<td><input type="text" name="p_group_desc" value="" class="form-control input-sm"></td>
<td><input type="text" name="p_group_level" value="" class="form-control input-sm"></td>
</tr>
<%
END LOOP;
%>
</table>
<%
END IF;
%>
</form>
</body>
</html>

And 2nd file type is *.sql and are very similar to sql server syntax.

filename=ebb_wsresponse.sql

SET SCAN OFF
CREATE OR REPLACE
PROCEDURE ebb_wsresponse (p_ws_id IN VARCHAR2 default NULL,
p_job_id IN VARCHAR2 default NULL,
p_ws_response IN VARCHAR2 default NULL,
p_ws_url IN VARCHAR2 default NULL) IS
BEGIN
INSERT INTO ebb_job_ws (job_id, ws_id, ws_response, ws_url) VALUES (p_job_id, p_ws_id, p_ws_response, p_ws_url);

htp.p('{ "Code":"JOBCOMPLETED", "Job_Id":"' || p_job_id || '","Msg":"' || p_ws_response || '" }');
END;
/

SHOW ERR;

@marcelgerber
Copy link
Contributor

Note: There's already a PL-SQL mode in CM (http://codemirror.net/mode/sql/index.html?mime=text/x-plsql), so it's easy to enable in Brackets.
This can also be done in a simple extension. See https://github.com/adobe/brackets/wiki/Language-Support#defining-a-new-language.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants