Wednesday, June 24, 2009

Array type of SQL in Postgres

Try this SQL statement like below for query any value which contain the array of year

select * from tb_element where tb_element.element_name like
ANY (ARRAY['%2005%','%2006%','%2007%','%2008%']) order by tb_element.element_name ;


http://archives.postgresql.org/pgsql-patches/2004-03/msg00369.php


-FCY-

Upgrading Tslc components to Delphi 7

To upgrade the old version code from Delphi 5 to 6 and above we need to follow the below instruction :-


Tcl Scripting Language Components Migration to Delphi 6

William Byrne - 1/22/2002

The following chronology can be used as a guideline to promote the Delphi 4
supported source release, tslc-1.0.zip, to the Delphi 6 compiler requirements.
The environment for the analysis and inevitable modifications included a fresh
expansion of the tslc-1.0.zip archive to an arbitrary directory, a recent
installation of Delphi 6, and a Win2K Professional OS. Existing Tcl environment
variables were also removed. The Delphi 6 installation excluded the source and
object files for the ToolsAPI that provides the mechanisms for component
integration into its Design-Time architecture.

- Downloaded tslc-1.0.zip from SourceForge:
http://prdownloads.sourceforge.net/tslc/tslc-1.0.zip

- Expanded tslc-1.0.zip to arbitrary "c:\d6" folder.

- Started D6 and closed default project: File->Close All.

- Opened TslcPkg.dpk: File->Open Project (c:\d6\tslc\TslcPkg.dpk)

- Acknowledged package format migration notice.

- Right-Clicked on the "Requires" node in the Package maintenance window and
selected "Add".

- Navigated to the Delphi 6 install directory and selected lib\designide.dcp

- Clicked the compile button and received an error about missing DsgnIntf.dcu
file listed in TslcEdit.pas

- Renamed DsgnIntf to DesignIntf. Saved File.

- Recompiled and received error about missing DsgnIntf.dcu in TslcEmul.pas.

- Renamed DsgnIntf to DesignIntf. Saved File.

- Recompiled and received error about unexpected symbol "Type"

- Duplicated preprocessor statement for the v130 compiler to code suitable
for the v140 compiler:
{$IFDEF VER140}
Menus, ToolsAPI;
{$ENDIF}

- Saved File.

- Recompiled and received error about erroneous TFormDesigner class.

- Duplicated preprocessor statement for the v130 compiler to code suitable for
the v140 compiler:
{$IFDEF VER140}
TFormDesigner = IFormDesigner;
{$ENDIF}

- Saved File.

- Recompiled and received error about erroneous IFormDesigner class.

- Renamed IFormDesigner to IDesigner. Saved File.

- Recompiled and received error about missing DsgnIntf.dcu in TslcParam.pas.

- Renamed DsgnIntf to DesignIntf. Saved File.

- Recompiled and received error about missing DsgnIntf.dcu in TslcReg.pas.

- Renamed DsgnIntf to DesignIntf. Saved File.

- Recompiled and received error about type mismatch in "ParseStyle" statement.

- Duplicated preprocessor statement for the v130 compiler to code suitable for
the v140 compiler a few lines above:
{$IFDEF VER140}
procedure ParseStyle(str: string; var style: DWORD);
{$ELSE}
...
{$ENDIF}

- Saved File.

- Recompiled and received numerous errors starting with undeclared
TComponentEditor in TslcReg.pas

- Inserted "DesignEditors" after "DesignIntf" in the "Uses" clause. Saved File.

- Recompiled successfully. Saved Project. Files->Save All.

- Strangely, components were automatically installed and present on Tslc
component page. Click the Install button if necessary.

- Closed the TslcPkg.dpk project: Files->Close All.

- Opened the extensions package TslxPkg.dpk:
File->Open Project (c:\d6\tslc\ext\TslxPkg.dpk)

- Acknowledged package format migration notice.

- Compiled successfully. Clicked Install button.

- Saved and closed project.

- Opened Script Pad project to test packages:
File-Open Project (c:\d6\tslc\Projects\ScriptPd\ScriptPd.dpr)

- Compiled project and received error about not finding Tslc.dcu.

- Added "C:\d6\Tslc;C:\d6\Tslc\ext" to the "Search Path" in the "Directory"
panel of the project options dialog.

- Saved all files and recompiled successfully.

- Ran ScriptPd.exe and encountered unexpected Windows Installer for D6 things.

- After numerous dismissal and cancels, bypassed unexpected installer and was
greeted with Script Pad application. Installer not seen on subsequent runs.

- Clicked on the "Open" button and
selected "C:\d6\Tslc\library\demos\TkBde.tcl".

- Clicked on the "Execute" button and observed Tk Widgets and database demo
material in the "Tk Panel". Test Passed.

- Clicked the "Cancel" button to end the script.

- Clicked on the "Open" button and
selected "C:\d6\tslc\library\tix4.1\vtcl_tix.tcl".

- Clicked on the "Execute" button and observed Stewart Allen's Visual Tcl
application. Test Passed.


Production of the Delphi 6 migration can use the above steps as a
foundation for primary implementation iterations of the tslc code base.

For migrating to Delphi 6 , please change the

{$IFDEF VER140}


For migrating to Delphi 7 , please change the

{$IFDEF VER150}


And i just made it. For the fully migrated to Delphi 7 components you may download from my rapidshare.com link

Credits goes to William Byrne - 1/22/2002 at http://sourceforge.net/projects/tslc/


-FCY-