A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Re: Untitled - Stikked
From Mustard Dormouse, 8 Years ago, written in SQL.
This paste is a reply to Untitled from Mature Tapir - go back
Embed
Viewing differences between Untitled and Re: Untitled
testBEGIN
DECLARE @sql LONG VARCHAR;
SET @sql = 'SELECT Test';
FOR f_fetch
AS c_fetch NO SCROLL CURSOR FOR
SELECT DISTINCT t1.TestDate AS @c2
  FROM (SELECT ccd_lab_desc AS 'Test',  ( ccd_result_1  || ' '  || ccd_lab_display_unit ) AS 'Result',  ccd_lab_date_display AS 'TestDate' FROM DBA.v_ccd_lab WHERE ccd_lab_date > ( Today() - 90 )  AND ccd_patient_id = 17577 ORDER BY ccd_lab_desc ASC,  ccd_lab_date DESC ) as t1
ORDER BY t1.TestDate desc

FOR READ ONLY
DO
   SET @sql = STRING (@sql,', (if charindex(''-99'',replace((max( ( IF t1.TestDate = ''',@c2,''' THEN t1.Result ELSE -99 ENDIF ) ) || max(t1.ccd_lab_display_unit) ),''0000'',''0'')) = 0 then replace((max( ( IF t1.TestDate = ''',@c2,''' THEN t1.Result ELSE -99 ENDIF ) ) || max(t1.ccd_lab_display_unit) ),''00000'',''0'') else ''N/A'' endif) AS ''',@c2,'''' );
END FOR;
SET @sql = STRING (
   @sql,
   ' INTO #t1 FROM (SELECT ccd_lab_desc AS Test, ccd_lab_display_unit, (case when IsNumeric(ccd_result_1) = 1 then ccd_result_1 ELSE 0 end) AS Result,  ccd_lab_date_display AS TestDate FROM DBA.v_ccd_lab WHERE ccd_lab_date > ( Today() - 90 )  AND ccd_patient_id = 17577 ORDER BY ccd_lab_desc ASC,  ccd_lab_date DESC ) as t1 GROUP BY t1.Test' );
EXECUTE IMMEDIATE @sql;
SELECT * FROM #t1 ORDER BY Test;
END;

Replies to Re: Untitled rss

Title Name Language When
Re: Re: Untitled Speedy Prairie Dog sql 8 Years ago.