Monday, March 12, 2012
Extended Proc
I have compiled a dll in delphi but I cannot use it as extended procedure(it
always returns null). Here is my source and usage in sql server:
--
library testdll;
uses
SysUtils,
Classes;
{$R *.res}
function xp_a:string;
begin
{for test}
result:='10';
end;
exports xp_a;
end.
________________________________________
_
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
exec sp_addextendedproc N'xp_a', N'testdll.dll'
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
________________________________________
_
declare @.a varchar(10)
exec master..xp_a @.a output
select @.a as output
--
Any help would be greatly appreciated.
LeilaYou can not return a string, you need to return it as an output parameter
instead, an XP always and only returns an integer.
See for examples and helper libraries:
http://www.howtodothings.com/viewar...spx?article=223
http://mastercluster.com/xproc.html
GertD@.SQLDev.Net
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright SQLDev.Net 1991-2005 All rights reserved.
"Leila" <Leilas@.hotpop.com> wrote in message
news:OSr6YI6JFHA.2796@.tk2msftngp13.phx.gbl...
> Hi,
> I have compiled a dll in delphi but I cannot use it as extended
> procedure(it
> always returns null). Here is my source and usage in sql server:
> --
> library testdll;
> uses
> SysUtils,
> Classes;
> {$R *.res}
> function xp_a:string;
> begin
> {for test}
> result:='10';
> end;
> exports xp_a;
> end.
> ________________________________________
_
> SET QUOTED_IDENTIFIER OFF
> GO
> SET ANSI_NULLS OFF
> GO
> exec sp_addextendedproc N'xp_a', N'testdll.dll'
> GO
> SET QUOTED_IDENTIFIER OFF
> GO
> SET ANSI_NULLS ON
> GO
> ________________________________________
_
> declare @.a varchar(10)
> exec master..xp_a @.a output
> select @.a as output
> --
> Any help would be greatly appreciated.
> Leila
>
>
Wednesday, March 7, 2012
Expression Data Type Conversion
I am getting the following error in my report. I am tring to program the BackgroungColor Expression so the if the value is null display a blue color else leave it white.
Conversion from string "" to type 'Date' is not valid
Here is my code sample:
=Iif(Fields!ReturnTime.Value = "", "AliceBlue", "White")
Hi RayClark,You cannot compare a string with a date.
You can do this in several ways here is one:
=IIF(Len(Fields!ReturnTime.Value)=0, "AliceBlue", "White")
Use the length function to check the length of return time. If it is 0 set it to alice blue else set it to white :).
http://jhermiz.googlepages.com|||Thanks that worked great!!!
Expression - Comparing a variable
Hi,
I have a variables in SSIS:
- object MyObj
How can I write an expression that checks if MyObj is NULL or NOT NULL?
Thank you.
If it's an object type, you'll have to shred it with a foreach loop container first. A script task would likely work as well, but coding is required.Are you wanting to test if the object is EMPTY or NULL? Two different things.|||
"Are you wanting to test if the object is EMPTY or NULL? Two different things."
You′re absolutely right.
My Data Flow's Record Set Destination puts some row data in MyObj variable.
How can I How can I write an expression to see if MyObj contains some row or none at all (how can I see if it′s empty or not empty?
Thanks once again Mr.Phil Brammer!
The code here might help:
Recordsets instead of raw files
(http://blogs.conchango.com/jamiethomson/archive/2006/01/04/2540.aspx)
-Jamie
|||A row count transformation will store the count of rows that pass through it into an integer variable that you can later work with. Won't that work for you instead?|||Yes, it worked.
Thank you once again!