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 last published in August 2002

Dig Deeper on Microsoft SQL Server Installation

PRO+

Content

Find more PRO+ content and other member only offers, here.

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.

Start the conversation

Send me notifications when other members comment.

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

Please create a username to comment.

-ADS BY GOOGLE

SearchBusinessAnalytics

SearchDataCenter

SearchDataManagement

SearchAWS

SearchOracle

SearchContentManagement

SearchWindowsServer

Close