我有一个表值函数.我还有一个标量值函数,我已经声明了一个临时表.我想在标量值函数内部执行表值函数,并在临时表中设置该值,如下所示
**Exec @tempTable=TableValuedFunction**
Run Code Online (Sandbox Code Playgroud)
我怎么能这样做?
这是表值函数
ALTER FUNCTION [dbo].[fn_Functiont]()
RETURNS TABLE
AS
RETURN
(
SELECT d.*, b.Name AS Name, ps.Name AS PaymentSystemName, c.UserName AS UserName, c.FirstName AS ClientFirstName, c.LastName AS LastName, c.Number AS DocumentNumber, c.Id
FROM Document AS d
JOIN System AS ps ON d.SystemId = ps.Id
JOIN Client AS c ON c.Id = d.ClientId
LEFT JOIN Shop AS b ON b.Id = d.ShopId
WHERE d.OperationTypeId IN (2, 4, 5) AND c.Type = 1
)
Run Code Online (Sandbox Code Playgroud) 我试图访问我的XML文件中的一些节点,但我不能让它工作,因为我可能不理解Delphi中的XML-Namepsaces.
<gesmes:Envelope xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01" xmlns="http://www.ecb.int/vocabulary/2002-08-01/eurofxref">
<gesmes:subject>Reference rates</gesmes:subject>
<gesmes:Sender>
<gesmes:name>European Central Bank</gesmes:name>
</gesmes:Sender>
<Cube>
<Cube time="2018-01-18">
<Cube currency="USD" rate="1.2235"/>
<Cube currency="JPY" rate="136.07"/>
<Cube currency="BGN" rate="1.9558"/>
<Cube currency="CZK" rate="25.365"/>
<Cube currency="DKK" rate="7.4475"/>
<Cube currency="GBP" rate="0.88208"/>
<Cube currency="HUF" rate="308.51"/>
<Cube currency="PLN" rate="4.1665"/>
<Cube currency="RON" rate="4.6480"/>
<Cube currency="SEK" rate="9.8305"/>
<Cube currency="CHF" rate="1.1748"/>
<Cube currency="NOK" rate="9.6013"/>
<Cube currency="HRK" rate="7.4409"/>
<Cube currency="RUB" rate="69.2126"/>
<Cube currency="TRY" rate="4.6374"/>
<Cube currency="AUD" rate="1.5311"/>
<Cube currency="BRL" rate="3.9321"/>
<Cube currency="CAD" rate="1.5229"/>
<Cube currency="CNY" rate="7.8582"/>
<Cube currency="HKD" rate="9.5648"/>
<Cube currency="IDR" rate="16325.38"/>
<Cube currency="ILS" rate="4.1950"/> …Run Code Online (Sandbox Code Playgroud) 我正在努力在我的TComoBox中获取我的一个Item的ItemIndex ...通常这对我来说似乎不是一件难事......但不知怎的,当我尝试施放我的String(我从一个SQL select)到TObject.这似乎不起作用.我尝试通过手动将String写入Object来调试我的代码,如下所示:
TObject('U');
Run Code Online (Sandbox Code Playgroud)
那不知何故确实有效,我无法解释......
我填写ComoBox的方式:
for i := Low(_VerkaufTypenBez) to High(_VerkaufTypenBez) do
begin
CBBelegart.AddItem(VerkaufTypenBez(i), Tobject(VerkaufTypenShort[i]));
end;
Run Code Online (Sandbox Code Playgroud)
我尝试设置索引的方式:
CB.ItemIndex := CB.Items.IndexOfObject(TObject(SetIndexWithSQL('select top 1 * from KOMSAconfig_Allgemein', 'Belegart'))); //index = -1
helper := 'U';
CB.ItemIndex := CB.Items.IndexOfObject(TObject(helper)); //index = -1
CB.ItemIndex := CB.Items.IndexOfObject(TObject('U')); //index = 1
Run Code Online (Sandbox Code Playgroud)
有什么建议?