Ask the Expert

Problem trying to insert data

This is my procedure. I have to insert this information, but I don't know how to insert v_callno. An error says "no data found" and "can't insert null". I want to know if it is right, and if it is not, how can I do it?
 set verify off set serveroutput on accept p_ename prompt'Please enter the employee name:' accept p_cname prompt'Please enter the customer name:' accept p_typeno prompt 'Please enter the call type number:' accept p_comp prompt'Please enter the company name:' DECLARE v_callno number(3); --v_date :=sysdate; --v_cname:='&p_cname'; v_ename staff.name%type:='&p_ename'; --v_typeno :='&p_typeno'; --v_comp :='&p_comp'; v_support staff.job%type; BEGIN v_callno :=sql%rowcount; select job into v_support from staff where &p_typeno=30 and v_ename in('JAMAL','KAMAL','WAEL I.','WAEL S.','AJI'); INSERT INTO call_info values(v_callno,sysdate,'&p_cname','&p_ename','&p_typeno','&p_comp','v_s uppo rt'); COMMIT; END;

    Requires Free Membership to View

This would be more appropriately asked in a development forum related to the language you are using. I generically understand the code, but I have no idea what you are trying to do or where the data comes from. It is not a problem with SQL Server.

 

For More Information

This was first published in August 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: