Hey All,
I have been wracking my head with this one. I would like to use a SP for security reasons but I can't get this thing to run! The full SQL statement below works but the SP won't execute without error. I get a .F. on the flag but 'Success' in my call result text.
I have been wracking my head with this one. I would like to use a SP for security reasons but I can't get this thing to run! The full SQL statement below works but the SP won't execute without error. I get a .F. on the flag but 'Success' in my call result text.
Code:
Dim conn as SQL::Connection Dim argz as SQL::Arguments Dim SQL as c Dim SQLStatement as c dim cLoginType as c = "" dim cResultText as c 'flag to test if connection opens dim flag as l SQLStatement = <<%sql% INSERT INTO WebUsersLogins (Username, IPaddress, LoginError, LoginType) OUTPUT INSERTED.Id VALUES('test3','1001001003','gridinitialize3','in') %sql% SQL = <<%sql% EXEC jwspWebUsersLoginsInsert(:username,:ip,:loginerror,:logintype) %sql% argz.set("username","testuser") argz.set("ip","101010101") argz.set("loginerror","OnGrid") argz.set("logintype","in") conn.Open("::name::RaTSTest") cResultText = conn.CallResult.Text 'flag = conn.execute(SQLStatement) flag = conn.execute(SQL,argz) debug(1)
Code:
Use RaTSTest GO ALTER PROCEDURE jwspWebUsersLoginsInsert @username nvarchar(250), @ip nvarchar(50), @error nvarchar(250), @logintype nvarchar(3) /*This procedure adds a record everytime a user logs in to the Reportal and is called by the Web User Security function 'saveLoginLog' */ AS INSERT INTO WebUsersLogins (Username, IPaddress, LoginError, LoginType) --OUTPUT INSERTED.Id VALUES(@username, @ip, @error, @logintype);
Comment