Home > Uncategorized > Google Syntax Highlighter for PL/SQL

Google Syntax Highlighter for PL/SQL

Google Syntax Highlighter App. provides us to show code in our blogs or other html pages. This application shows code of C,Java,Jscript,C#,SQL,XML,Ruby,Phyton. But as you predicted, Oracle PL/SQL is missing. So, i decided to develop a code to highlight our Oracle/PLSQL code. Things you have to do them are as follows :

Download shBrushPlSql.js

(This is compatible with reserver words and keywords of Oracle Latest Version )

After all of these step, now you can test your plsql code. Like this 🙂


CREATE OR REPLACE PACKAGE BODY PKG_RULE_CONTROL IS

-- CREATED BY A. FUAT SUNGUR
-- afsungur@gmail.com
--
--
-- Kural ile ilgili islemleri gerceklestiren pakettir

------------------------------------------------------------------------------------------
-- DBMS_SCHEDULER tarafindan cagrilacak pl sql blogunun dinamik olarak uretilmesini saglar
-- RUN_JOB prosedurune gonderilecek parametreler dinamik olarak ayarlanir.
FUNCTION PRODUCE_JOB_SQL
(
vExpr_1 VARCHAR2,
vExpr_2 VARCHAR2,
nCond_Id NUMBER,
iRuleId NUMBER
) RETURN VARCHAR2 IS

vJobSql VARCHAR2(2000);
iSqlCode INTEGER;
vSqlErrMsg VARCHAR2(250);

BEGIN
-- CHR(39) = ' ( tek tirnak )
IF (vExpr_2 IS NOT NULL)
THEN
vJobSql := 'BEGIN PKG_JOB_CONTROL.RUN_JOB(' || CHR(39) ||
vExpr_1 || CHR(39) || ',' || CHR(39) || VExpr_2 ||
CHR(39) || ',' || nCond_Id || ',' || iRuleId ||
'); END;';
ELSE
vJobSql := 'BEGIN PKG_JOB_CONTROL.RUN_JOB(' || CHR(39) ||
vExpr_1 || CHR(39) || ',NULL,' || nCond_Id || ',' ||
iRuleId || '); END;';
END IF;
RETURN vJobSql;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
INSERT INTO TERRORS
VALUES
(SEQ_TERRORS.NEXTVAL,
iSqlCode,
vSqlErrMsg,
CURRENT_TIMESTAMP,
'FUNCTION PKG_RULE_CONTROL.PRODUCE_JOB_SQL()');
COMMIT;
RETURN NULL;
END;
END;
Advertisements
Categories: Uncategorized
  1. July 14, 2014 at 8:59 am

    very understandable syntax.
    Thanks.
    Oracle Training in Chennai

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: