in .NET or TSQL no problem, but i cant get in Team Developer...
create Table Test (Field1 int, Field2 varchar(100)) -- Field1 is PK, but has no identity (1,1)!
i want to insert Data from TD Application, the mission is to receive the value for Field1
TSQL: runs ok
insert into Test (Field1) Output Inserted.Field1 select max(Field1)+1 from Test
TD: How can i get the value for Field1
insert into Test (Field1) Output Inserted.Field1 select max(Field1)+1 into :m from Test
sqlprepareandexecute -> returns syntax error in sql
sqlfetchnext
thank you
michael
TD and MS-SqlServer: How To Insert with Output parameter?
Re: TD and MS-SqlServer: How To Insert with Output parameter?
I may be wrong but I don't think you can get output parameters this way from SQL using this method. I would suggest rolling it all into a store procedure and running it that way.
MartinD
MartinD
Re: TD and MS-SqlServer: How To Insert with Output parameter?
Thank you Martin,
in .NET Code and TSQL it works fine, but i think there is no way in TD...
in .NET Code and TSQL it works fine, but i think there is no way in TD...
Re: TD and MS-SqlServer: How To Insert with Output parameter?
Well, there is a way to do this...
Use a stored procedure. Some DB folks say to always use stored procedures to handle inserts, edits and deletions. A stored procedure can return any infomation you want.
MartinD
Use a stored procedure. Some DB folks say to always use stored procedures to handle inserts, edits and deletions. A stored procedure can return any infomation you want.
MartinD
Who is online
Users browsing this forum: [Ccbot] and 0 guests