Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New Record Insert 1

Status
Not open for further replies.

Lladros

Programmer
Feb 21, 2008
18
US
I am new to Sybase so please bare with me.

I have created a table and created a store procedure to insert the new record into the newly created table. I am doing a direct Execute statement like this: EXECUTE dbo.usp_change "NP1016", 220804, "MOM", "May 2 2005 8:13PM", "NP201", "May 2 2005 8:13PM", "NP201", "Change.", "Y".

This is my stored proc: CREATE PROCEDURE dbo.usp_change
@pc_emp_id VARCHAR(15),
@pn_dep_id INT,
@pc_relation CHAR(5),
@pc_change_pr_flag CHAR(1),
@pc_reason_text VARCHAR(255)
AS

UPDATE dbo.tbl_change
SET emp_id = @pc_emp_id,
dep_id = @pn_dep_id,
relation = @pc_relation,
flag_for_change = @pc_change_pr_flag,
comment_text = @pc_reason_text,
last_update_date = @ldt_today,
last_update_id = @lc_user_id,
authorized_user_date = @ldt_today,
authorized_user_id = "ACTIONSApp"
FROM dbo.tbl_change

When I insert the one record, I get 1 row affected. But when I do a select * from dbo.tbl_change, I do not see the record that I just inserted. Any clue as to what I have done wrong?

Please Help!!!!
 
You say you are inserting but there is no insert statement.
The procedure only update an existing record.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top