473,609 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
+ 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_linenum ber" 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 7188
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_linenumb er field?
Jul 20 '07 #2
ashokakr
7 New Member
ok sir,

the datatype for coitem_linenumb er 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_linenumb er 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_expressi ons 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
1147
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 possible because of virtual inheritance. What I'd like to do is provide an automatic way of deciding to use a dynamic or static cast depending on if it's possible to static_cast. The jist of what I want to do is below but I know it's wrong. Any...
1
2353
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
15174
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 setStyle(element, property, value) {
1
1263
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 fails
0
8300
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 records there is an error "Incorrect syntax near '-'. Must declare the scalar variable "@UserName". I worked out in design view,code is automatically generated.Iam not able fix the error. Iam working with Visual Web Developer-2005 Express Edition
6
6798
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 /home/.gobbles/mahcuz/mahcuz.com/upload/uploaded.php on line 129 And this is some of the code from the page: /* New code for thumbnails. Will on work if user selects "create thumb on upload" on the upload page */ //check to see if checkbox is...
1
8276
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 sure EMail address doesn't exist in database before I insert data. Connection string and everything else is correct. If I use Dim SQL = "Select * from Clients where EMail = " & chr(39) & "SomeEmailAddress@msn.com" & chr(39) it works fine.
1
4224
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 "tgname": no such variable CONTEXT: can't read "tgname": no such variable while executing ....." If I drop the table and then recreate the table and add the rigger, the trigger works fine. However if I alter the table, again I have to drop and...
5
4666
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 */ DECLARE @DepartmentName char(25) DECLARE @DepartmentHead char(25) /* Define the cursor that can be used to access the records of the table,row by row */
0
8129
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8535
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8220
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8404
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6997
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6056
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5509
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4080
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1386
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.