473,486 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

"is not scalar Variable" Error

7 New Member
Hi all
This my procedure, when i try to run the procedure it says
"coitem_linenumber" is not a scalar variable.

Can any one say what is the error and how i can correct it

Expand|Select|Wrap|Line Numbers
  1. declare
  2. wotype CHARACTER;
  3. id integer;
  4. so_no ALIAS FOR $1;
  5. _wono integer;
  6. _wolno integer;
  7. woisid integer;
  8. wostdate date;
  9. wosdate date;
  10. woqty integer;
  11. wopno text;
  12. woprj integer;
  13. woordid integer;
  14. BEGIN
  15. select max(wo_id) into id from wo;
  16. wotype := 'W';
  17. LOOP
  18. IF id=0 THEN id=1;
  19. ELSE id=id+1; 
  20. END IF;
  21. UPDATE coitem SET coitem_order_type=wotype,coitem_order_id=id 
  22. WHERE (coitem_cohead_id=(SELECT cohead_id from cohead where(cohead.cohead_number=so_no))); 
  23. select 
  24. cohead_number into _wono,
  25. coitem_linenumber into _wolno, 
  26. coitem_itemsite_id into woisid,
  27. coitem_lastupdated into wostdate,
  28. coitem_scheddate into wosdate,
  29. coitem_ordqty into woqty,
  30. (cust_number||'-'||cust_name) into wopno, 
  31. cohead_prj_id into woprj 
  32. from custinfo,cohead,coitem 
  33. where ((cust_id=cohead_cust_id) and (cohead_id=coitem_cohead_id) and (coitem_order_id=id));
  34. select max(evntlog_order_id) into wo_ordid from eventlog where(eventlog_number=(wo_no||'-'||wo_lno));
  35. Insert into wo values(id,wo_no,wo_lno,'R',wo_isid,wo_stdate,wo_sdate,'S',wo_ordid,wo_qty,0,'','','',0,0,wo_pno,wo_prj,1,0) ;
  36. END LOOP;
  37. END;
  38.  
Jul 20 '07 #1
3 7169
michaelb
534 Recognized Expert Contributor
Please read the Posting Guidelines at the top of the page and use the CODE tags for your future postings.

What datatype is your coitem_linenumber field?
Jul 20 '07 #2
ashokakr
7 New Member
ok sir,

the datatype for coitem_linenumber is integer


Please read the Posting Guidelines at the top of the page and use the CODE tags for your future postings.

What datatype is your coitem_linenumber field?
Jul 20 '07 #3
michaelb
534 Recognized Expert Contributor
Looking at your code I see this:
Expand|Select|Wrap|Line Numbers
  1. ... ... ... ...
  2. SELECT
  3. cohead_number INTO _wono,
  4. coitem_linenumber INTO _wolno,
  5. coitem_itemsite_id INTO woisi
  6. ... ... ... ...
  7.  
I don't think this is right, the manual on SELECT INTO says:
------------------------------------------------------------------------------------------------
The result of a SELECT command yielding multiple columns (but only one row)
can be assigned to a record variable, row-type variable, or list of scalar variables.
This is done by:
SELECT INTO target select_expressions FROM ...;
-----------------------------------------------------------------------------------------------
So it seems you need to either use a list of variables with a single INTO -
Expand|Select|Wrap|Line Numbers
  1. select into var1, var2, var3   field1, field2, field3  FROM  tab-name ...
  2.  
or, considering you have a fair number of fields, it might be better just to select into var type RECORD and get what you need from there

See SELECT INTO for details
Jul 20 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1137
by: Gianni Mariani | last post by:
I'm trying to make a generic factory that provides a placement new as well as the accompanying destructor. To do a down-cast I used a static_cast but it turns out that this is not always a...
1
2345
by: G Fernandes | last post by:
Hi, can someone tell me what the following words mean as per C/clc: 1) token 2) token sequence 3) scalar variable 4) vector
2
15165
by: forwardtrends | last post by:
I am trying to simply make a div appear and dis-appear. The code I am using is: --- if(!document.getElementById) { document.getElementById = function() {return null;}; } function...
1
1256
by: Evan | last post by:
template <class CharT > struct ctype_byname { ctype_byname(); }; template < > ctype_byname<char>::ctype_byname<char>(); This code compiles with GCC 3.4.4, Sun CC 5.8, and MSVC 7.1. It...
0
8289
by: roamnet | last post by:
hi i created database file with .mdf extention ,sql server as a source and use grid view to display data there're no problem in data retrieve and display,but i want to edit it or insert new...
6
6784
Markus
by: Markus | last post by:
I'm adding to my script a section that allows a thumbnail to be created and saved. I get this error: Warning: imagejpeg() : Unable to open '../uploads/thumb/' for writing: Is a directory in...
1
8268
by: Tony M | last post by:
vs 2005 - vb .net - web forms - xp pro Can't figure out why I keep getting the error Must declare the scalar variable "@CheckUser". The error happens on SqlDA.Fill(SqlDS). Just trying to make...
1
4209
by: indikamaligaspe | last post by:
Hi all, I am trying to get a PL/TCL trigger to update an audit table working. The problem is when I create the trigger on an exiting table, I get the following error "ERROR: can't read...
5
4660
by: Amit Rai | last post by:
/* Create a table */ Create table Department (vDepartmentName char(25),vDepartmentHead char(25)) /* Create two variables that would store the values returned by the fetch statement */ ...
0
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7319
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5430
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4864
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.