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 - view diff
Embed
  1. BEGIN
  2. DECLARE @SQL LONG VARCHAR;
  3. SET @SQL = 'SELECT Test';
  4. FOR f_fetch
  5. AS c_fetch NO SCROLL CURSOR FOR
  6. SELECT DISTINCT t1.TestDate AS @c2
  7.   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
  8. ORDER BY t1.TestDate DESC
  9.  
  10. FOR READ ONLY
  11. DO
  12.    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,'''' );
  13. END FOR;
  14. SET @SQL = STRING (
  15.    @SQL,
  16.    ' 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' );
  17. EXECUTE IMMEDIATE @SQL;
  18. SELECT * FROM #t1 ORDER BY Test;
  19. END;

Replies to Re: Untitled rss

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