Q

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;

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

Dig deeper on Microsoft SQL Server Installation

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

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:

-ADS BY GOOGLE

SearchBusinessAnalytics

SearchDataCenter

SearchDataManagement

SearchAWS

SearchOracle

SearchContentManagement

SearchWindowsServer

Close