Skip to content

Instantly share code, notes, and snippets.

<script type="text/javascript">
$(function() {
$(".autocomplete").each(function() {
$(this).autocomplete({
source: "index.cfm?action=admin:main.lookup&src=" + $(this).attr("data-src"),
minLength: 2,
select: function(event, ui){
var thisObj = $(this);
var thisId = "#" + thisObj.attr("id");
<cfscript>
// our pretend version of the pests that we input by a user
pests = [5,6,10];
rev = EntityLoadByPK("Revisions",1);
// get the id of all matching pests
ormPests = JavaCast("string[]",ormExecuteQuery("select Pest.Code from RevisionPests where Revision.Id=?",[rev.getId()]));
dbPests = ArrayNew(1);
for( i=1; i<=ArrayLen(ormPests); i++){
select ncb.*
from
(select max(r_id) as r_id from ats.VW_NCB_QUARTERLY where cast(exec_date as DATETIME) between q2_start and q2_end group by ats) m
inner join ats.VW_NCB_QUARTERLY ncb
on m.r_id = ncb.r_id
set serveroutput on;
declare
l_num_rows number;
l_num_bytes number;
l_stmt varchar2(2000);
begin
l_stmt := 'select well, study, conc, mdl, rpt_yr from wellinv.widata where rpt_yr > 1998';
dbms_mview.estimate_mview_size
/**
* @persistent
*/
component schema="SPECUSE" table="A_APPLICATIONS"
{
property name="Id" fieldtype="id" generator="sequence" ormtype="int" params="{sequence='A_SEQ'}";
property name="SpecialUseNumber" column="SPECUSE_NO" ormtype="int";
property name="RegistrationType" fkcolumn="SPECUSE_IND" cfc="RegistrationTypes" fieldtype="one-to-one";
property name="Status" fkcolumn="S_CODE" cfc="Statuses" fieldtype="one-to-one";
property name="Issued" column="ISSUE_DATE" ormtype="date";
select AR_ID from SPECUSE.ARS_APPLICATION_REV_SITES ARS where SITE_CODE in (14022)
union
select AR_ID from SPECUSE.ARP_APPLICATION_REV_PESTS ARP where P_CODE in (549)
union
select AR_ID from SPECUSE.ARC_APPLICATION_REV_COUNTIES where C_CODE in (34)
select
sum(recs) as recs,rct_name,
sum(rrc_sabrc_reportable) as rrc_sabrc_reportable,
sum(rrc_sabrc_compliant) as rrc_sabrc_compliant
from
(
-- Select the stuff that is associated with the record
select count(rct_name) as recs,
rct_name,
sum(convert(numeric,isnull(rrc_sabrc_reportable, 0))) as rrc_sabrc_reportable,
/**
* @persistent
*/
component schema="LABEL" table="PROD_CHEM" readonly="true"
{
property name="Product" fkcolumn="PRODNO" cfc="Products" fieldtype="id,many-to-one";
property name="Chemical" fkcolumn="CHEM_CODE" cfc="Chemicals" fieldtype="id,many-to-one";
property name="Percent" column="PRODCHEM_PCT";
}
select s.sid, s.serial#, s.status, p.spid
from v$session s, v$process p
where s.username = 'myuser'
and p.addr (+) = s.paddr;
-- alter system kill session '<sid>,<serial#>';
-- Description: Performs a case insensitive search against the column for similarly formatted
-- tables in mssql (since some closed box systems make it hard to determine which table contains a particular lookup item)
-- replace ismv7 and table prefix with your own
DECLARE @searchFor varchar(50)
DECLARE @targetSchema varchar(50)
DECLARE @tableFormat varchar(50)
-- WHAT ARE YOU LOOKING FOR?
set @searchFor = 'fumigation'
set @tableFormat = 'TABLE_LOOKS_LIKE_THIS%'