Using column_name%TYPE to define variable type behaves differently..
CREATE TABLE a_table(a_column VARCHAR2(10))
PROCEDURE x(in_arg a_table.a_column%TYPE)
IS
tmp_arg a_table.a_column%TYPE;
BEGIN
tmp_arg := in_arg;
END x;
EXEC x('this string is longer than 10 chars');
-> x:Line 1:Error, buffer too small.
Why?
Presumption: using table.column%TYPE in the args list takes only the TYPE. Using it to declare a temp variable, takes the TYPE AND the SIZE of the column..
You have declared a 10 char max column here
CREATE TABLE a_table(a_column VARCHAR2(10))And inside your procedure you declare an x variable sized the same as your column, with a maximum 10 characters length, but you declared a constant string with more than 10 characters, so the result is a buffer too small or a string too big.
EXEC x('this string is longer than 10 chars');
-> x:Line 1:Error, buffer too small.~ Madrid
Similar Messages
-
Can use the same thread safe variable in the different processes?
Hello,
Can use the same thread safe variable in the different processes? my application has a log file used to record some event, the log file will be accessed by the different process, is there any synchronous method to access the log file with CVI ?
DavidLimiting concurrent access to shared resources can be better obtained by using locks: once created, the lock can be get by one requester at a time by calling CmtGetLock, the other being blocked in the same call until the lock is free. If you do not want to lock a process you can use CmtTryToGtLock instead.
Don't forget to discard locks when you have finished using them or at program end.
Alternatively you can PostDeferredCall a unique function (executed in the main thread) to write the log passing the apprpriate data to it.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos? -
Defining variable type as VARCAHR2(32767) in PLSQL procedure
Hi,
in PLSQL procedure if i defined a variable type as VARCHAR2(32767) then will it cause any performance problem?
thanx
Nidhi.Hi,
It is always recommended to use the right data type with right size. If you really don't need 32767 they why you are defining, and if you need 32767 then you will have to use it there is no other choice.
Cheers, -
Convert variable type f into variable type p decimals 2
Hi,
How can i convert a type f variable into a type p decimals 2 variable?
I'm trying to make this division:
var type f.
var1 type p decimals 2
var = 50 / 100.
the result is:
var = 5.0000000000000000E-01
if i do
move var to var1.
the result is:
var1 = 0.01 ???
can anyone tell me what i'm doing wrong?DATA: var type f,
var1 type p decimals 2.
var = 50 / 100.
WRITE:/ var.
move var to var1.
WRITE:/ var1.
Result is: 0.50
I don't see what's your problem...
Greetings,
Blag. -
Global variable access behaving differently
Hi There,
I am kind of confused at the way the output of this sql;
select
proc1.get_id(dwg_no, rev_id),
proc1.get_adcn(1) from
table t1,
table2 t2
where
t1.pkey = t2.fkey;
PL/SQL (Proc1)
create package proc1
function get_id(
dwg_no varchar2(10),
rev_id varchar2(4)
function get_adcn(
a number
create package body proc1 ..
--declare/set the global variable
v_adcn_no varchar2(4) := null;
funciton get_id (dwgno, revid) as
v_rev_id varchar2(12) := null;
select 'AB', '55' into v_rev_id, v_adcn_no from dual;
return v_rev_id;
funciton get_adcn (a number) as
return v_adcn_no;
My expectation is th get_id function would be executed and the global variable v_adcn_no would be set to '55' so that this value would be returned when get_adcn fucntion is called.
But it doesn't happen so.(i validated this)
[at times i returns 55, at times it returns null]
Actually i simulated my problem with a simple example.
and I do not want to execute the same sql again when get_adcn function is called.
Any help is highly appreciated.
Regards,
SriniThx for your reply,
that does not meet my requirement, bcos there is no guarantee that get_rev_id function would be called first before get_adcn.
But my requirement is i want the rev_id function to be executed first, how would i ensure that.
regards,
Srini -
Hi All,
i would like to know how could i create a new combination of notification category with notification origin, to use 03 - Service Notification and Q1 Customer complaint and enable the "Defect Class" field.
Thanks in advance,
Gustavo Carvalheirahi
Notification category are not configurable, those are defined in the system & u can select the appropriate
We can define only Notification types.
generally you get these data in Q1 notif type.
if you want new one with all detailes mentioned by you then you need to do the IMG settings.
Plant Maintenance and Customer Service->Maintenance and Service Processing->Overview of Notification Type.
here you need to create a new notif type and then add the
screen
1.Screen Areas in Notification Header
Screen type hdr H500 Header quality notification
ScrnType Object O500 Object for customer complaint / batch
2.Screen Structure for Extended View
3.Screen Structure for Simplified View
etc...
and when you go to create the notification type from Define Notification Types, there based notification origin the system selects the catagory
-ashok
Edited by: ASHOK on Oct 22, 2008 6:06 PM -
Actual type of variable type in parameterized type
Hi all,
Is there way to find out what is actual type of the Variable type in Parameterized type, for example:
class A<T> {
//actual type of variable type T
Class<T> tClass;
public void setTClass() {
// I don't know what should I do here
public Class<T> getTClass() {
return tClass;
public static void main(String[] args) {
assert((new A<Integer>().getTClass()).toString().equals("class java.lang.Integer"));
Message was edited by:
MjLaali
Message was edited by:
MjLaali
Message was edited by:
MjLaaliyes ofcource I can't chenge the actual type of variable type T in run time, but I would like to get actual class of T in run time like this example :
package test;
import java.lang.reflect.ParameterizedType;
abstract class B<T>{
private Class<T> variableClass;
public B() {
this.variableClass = (Class<T>) ((ParameterizedType) getClass()
.getGenericSuperclass()).getActualTypeArguments()[0];
public Class<T> getTClass(){
return variableClass;
class A extends B<Integer> {
public static void main(String[] args) {
assert(new A().getTClass() == Integer.class);
but I don't want class A and I would like to move main method to class B. -
User-defined variable in selection variant - doesn't work?
Hello,
Anyone had any experience of using user-defined variables (type B) in a selection variant? I can't get this to work in 4.7 or ECC 6.0. Seems like a bug - there's no way to specify the name of the variable. The theory behind their use is fine, but I wonder if anyone has successfully used them?
Thanks,
Chris.In an ECC 5 system, I can get to these showing if I'm in a report selection screen and I use the "Goto > User variables" (or Ctrl-F6) option... but note that it will only show the menu option if there are report parameters that have a PID on them and where the PID is defined in table TUVID (see note 144459). That said, personally I've only used the "T" option and maintained system wide values in table TVARVC.
Jonathan -
Auto selection of PO type based on PR type
Dear Gurus,
I am placing question for the first time, please guide.
While using ME21N PO type should be automatically selected based on PR type when PR number is refered while creating PO.
I have configured "Link purchase requisition - document type" through Define Document type .
Above conf. has triggerd an error msg. in ME21N (useful to some extent).
But we want system to automatically select PO type based on PR type ( when PR No. refered in PO ).
Thanks in advance
RammohanDear sir,
Auto creation of PO will not workout, since manual creation only allowed. Only auto PO type selection is required.
Even PO type select in in SU3 & personal setting are made blank.
Thanks
Rammohan -
How to define the "tab" ,"enter" character in a variable(type c)
I want to use the define the "tab" key and
"enter" key in a variable(type c),
But I don't know how to write it :
for example:
data: a1 type c(1).
data: a2 type c(1).
a1 = ?. " the tab key
a2 = ?. " the enter keyHi, i think joseph fryda gave you the one solution.
In the server which doesn't support CL_ABAP_CHAR_UTILITIES, here is another solution.
data:
C_X1 TYPE X VALUE '0D',
C_X2 TYPE X VALUE '0A',
C_X3 TYPE X VALUE '09',
LC_ENTER(2) TYPE C,
LC_TAB TYPE C.
enter key
CONCATENATE C_X1 C_X2 INTO LC_ENTER.
TAB key
LC_TAB = C_X3. -
How do i declare a user defined table type sproc parameter as a local variable?
I have a procedure that uses a user defined table type.
I am trying to redeclare the @accountList parameter into a local variable but it's not working and says that i must declare the scalar variable @accountList.this is the line that is having the issue: must declare the scalar variable @accountListSET @local_accountList = @accountListALTER PROCEDURE [dbo].[sp_DynamicNumberVisits] @accountList AS integer_list_tbltype READONLY
,@startDate NVARCHAR(50)
,@endDate NVARCHAR(50)
AS
BEGIN
DECLARE @local_accountList AS integer_list_tbltype
DECLARE @local_startDate AS NVARCHAR(50)
DECLARE @local_endDate AS NVARCHAR(50)
SET @local_accountList = @accountList
SET @local_startDate = @startDate
SET @local_endDate = @endDate
CREATE TYPE [dbo].[integer_list_tbltype] AS TABLE(
[n] [int] NOT NULL,
PRIMARY KEY CLUSTERED
[n] ASC
)WITH (IGNORE_DUP_KEY = OFF)
GOWhy are you asking how to be an awful SQL programmer?? Your whole approach to SQL is wrong.
We have a DATE data type so your insanely long NVARCHAR(50) of Chinese Unicode strings is absurd. Perhaps you can post your careful research on this? Can you post one example of a fifty character date in any language?
The use of the "sp_" prefix has special meaning in T-SQL dialect. Good SQL programmers do not use CREATE TYPE for anything. It is dialect and useless. It is how OO programmers fake it in SQL.
The design flaw of using a "tbl-" prefix on town names is called "tibbling" and we laugh at it.
There are no lists in RDBMS; all values are shown as scalar values. First Normal Form (1NF)? This looks like a set, which would have a name.
In any -- repeat any -- declarative programming language, we do not use local variables. You have done nothing right at any level. You need more help than forum kludges.
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL -
How to define new variable types in BPEL?
Is there a way to define a new variable type directly in BPEL, without modifying any of the WSDL files used by Partnerlinks?
Or to import an XSD with variable definitions?It depends on what you want to use the variable for. You may not need to do it yourself. Let's assume you have a main wsdl for your service that you can't change but it has the inputs and outputs already defined.
In the middle you want to grab the input and shove it into a database table. You can create a new partner link. Rright click in the swim lanes on the BPEL page and pick the little database icon. Go through the steps to link to the db via an insert or package. You will need a db connection to do this.
jdeveloper will create the partner link wsdl and schema for you to match the table or the ins/outs of the package/procedure automatically.
Then drag an invoke onto the page and pull the arrow to your new partner link. Use the magic wand on the invoke screen to create the input/output variables.
Then you can use a transformation or assign/copy to pull the data from the input message variable of the main wsdl into the input variable of your database wsdl.
Or your situation may not be that complicated...if you click the little (X) on the edge of the box on the BPEL screen you can go through a picking process. -
Newbie how to define variable of type element?
JDEV 10.1.3.1
When I perform the following from BPEL designer in JDEV...
variable new
create variable
Select element type
Select a local file schema xsd
Select element of choice
Seems to define OK but fails to compile. Namespaces appear to include the namespace defined in the xsd.
When I define variables of type message and browse to the appropriate wsdl and pick a message from there this seems to work / compile just fine.
I am sure that since I am just getting started that this is a common error, please assist and thanks. Must all variables be defined as message types and reside in a WSDL?
Thanks,
JohnHello John,
I'm not sure whether it is possible to import a schema into a process directly. What I usually do is to import it into the wsdl-file describing the process interface. This is the file you use to define the client-partnerlink. If your schema is imported correctly, you can access the type-definition via the partner-links-node in the type chooser (this works at least in JDEV 10.1.3.3 and 10.1.3.4).
To import your schema into the wsdl, you need to go to the structure-view in wsdl-editor and after a right-click on the types-node select "insert types". Inside types you insert XML-Schema, inside schema you need to insert an import-tag. The properties for this tag are the file-location and the target namespace used in the schema. The resulting XML-structure should look like this:
<wsdl:definitions xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:tns="http://xmlns.oracle.com/Order_Booking___Shipment" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="Order_Processing_SystemPLT" targetNamespace="http://xmlns.oracle.com/Order_Booking___Shipment">
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<import schemaLocation="Order_Booking___Shipment.xsd"
namespace="http://xmlns.oracle.com/Order_Booking___Shipment"/>
</schema>
</wsdl:types>
</wsdl:definitions>
Greetings,
Christoph -
Using user-defined data types in Forms 6i
When I use the following code in Oracle Forms 6i
PROCEDURE test IS
prcl prcl_ty;
BEGIN
prcl := prcl.setParcel('xxx-xx-xxxx');
END;
I get 'Error 801'. However the above does work in SQL editor. The online help says PL/SQL8 client-side program units cannot support Oracle 8 object-related functionality and I suspect this is the reason I get the error from Forms. Is there a work-around for this.
The TYPE is defined as:
CREATE OR REPLACE
TYPE PRCL_TY AS OBJECT
(parcel VARCHAR2(11),
MEMBER FUNCTION getBook RETURN VARCHAR2,
MEMBER FUNCTION getMap RETURN VARCHAR2,
MEMBER FUNCTION getItem RETURN VARCHAR2,
MEMBER FUNCTION getItem_NS RETURN VARCHAR2,
MEMBER FUNCTION getSplit RETURN VARCHAR2,
MEMBER FUNCTION find RETURN VARCHAR2,
MEMBER FUNCTION find (yr in VARCHAR2) RETURN VARCHAR2,
MEMBER FUNCTION isValid RETURN BOOLEAN,
MEMBER FUNCTION toString RETURN VARCHAR2,
MEMBER FUNCTION toString (par IN VARCHAR2) RETURN VARCHAR2,
STATIC FUNCTION setParcel (istr IN VARCHAR2 DEFAULT '000-00-000A') RETURN prcl_ty) -- to be used as a constructor
NOT FINAL
CREATE OR REPLACE
TYPE BODY PRCL_TY AS
MEMBER FUNCTION getBook RETURN VARCHAR2 IS
BEGIN
return substr(self.parcel,1,3);
END;
MEMBER FUNCTION getMap RETURN VARCHAR2 IS
BEGIN
return substr(self.parcel,4,2);
END;
MEMBER FUNCTION getItem RETURN VARCHAR2 IS
BEGIN
return substr(self.parcel,6);
END;
MEMBER FUNCTION getItem_NS RETURN VARCHAR2 IS
BEGIN
return substr(self.parcel,6,3);
END;
MEMBER FUNCTION getSplit RETURN VARCHAR2 IS
BEGIN
return substr(self.parcel,9,1);
END;
MEMBER FUNCTION find RETURN VARCHAR2 IS
found varchar2(1);
BEGIN
begin
select 'x'
into found
from casrp
where cp_book_num = self.getBook
and cp_map_num = self.getMap
and cp_item_num = self.getItem
and rownum = 1;
return 'CASRP';
exception
when NO_DATA_FOUND then
begin
select 'x'
into found
from pro_prop
where pp_book_num = self.getBook
and pp_map_num = self.getMap
and pp_item_num = self.getItem
and rownum = 1
and NOT EXISTS (select 'x'
from cncl_prcl
where cr_book_num = self.getBook
and cr_book_num = self.getMap
and cr_book_num = self.getItem
and rownum = 1);
return 'PRO_PROP';
exception
when NO_DATA_FOUND then
return '';
end;
end;
END;
MEMBER FUNCTION find (yr IN VARCHAR2) RETURN VARCHAR2 IS
found varchar2(1);
BEGIN
begin
select 'x'
into found
from casrp
where cp_book_num = self.getBook
and cp_map_num = self.getMap
and cp_item_num = self.getItem
and cp_tax_yr = yr
and rownum = 1;
return 'CASRP';
exception
when NO_DATA_FOUND then
begin
select 'x'
into found
from pro_prop
where pp_book_num = self.getBook
and pp_map_num = self.getMap
and pp_item_num = self.getItem
and pp_tax_yr = yr
and rownum = 1
and NOT EXISTS (select 'x'
from cncl_prcl
where cr_book_num = self.getBook
and cr_book_num = self.getMap
and cr_book_num = self.getItem
and cr_tax_yr = yr
and rownum = 1);
return 'PRO_PROP';
exception
when NO_DATA_FOUND then
return '';
end;
end;
END;
MEMBER FUNCTION isValid RETURN BOOLEAN IS
i number;
BEGIN
for i in 1..8 loop
if substr(parcel,i,1) not between '0' and '9' then
return FALSE;
end if;
end loop;
if nvl(substr(parcel,9,1),'#') not between 'A' and 'Z' and
nvl(substr(parcel,9,1),'#') != '#' then
return FALSE;
end if;
return TRUE;
END;
MEMBER FUNCTION toString RETURN VARCHAR2 IS
BEGIN
return self.toString('-');
END;
MEMBER FUNCTION toString (par IN VARCHAR2) RETURN VARCHAR2 IS
BEGIN
return self.getBook||par|| self.getMap||par|| self.getItem;
END;
STATIC FUNCTION setParcel (istr IN VARCHAR2 DEFAULT '000-00-000A') RETURN prcl_ty IS
len number;
pos number;
lastch varchar2(1);
temp varchar2(30);
invalid_format exception;
pragma exception_init(invalid_format,-9001);
BEGIN
temp := upper(istr);
-- Find 1st occurance of '-'. If not in correct postion, pad book num with zeros.
pos := instr(temp,'-',1,1);
if pos > 0 then
if pos != 4 then
temp := lpad(substr(temp,1,pos-1),3,'0')||substr(temp,pos);
end if;
-- Find 2nd occurance of '-'. If not in correct postion, pad map num with zeros.
pos := instr(temp,'-',1,2);
if pos != 7 then
temp := substr(temp,1,4)||lpad(substr(temp,5,1),2,'0')||substr(temp,pos);
end if;
-- Pad item num
len := length(temp);
lastch := substr(temp,len);
temp := substr(temp,1,7)||lpad(substr(temp,8,len-1),3,'0');
if lastch between 'A' and 'Z' then
temp := temp||lastch;
end if;
end if;
temp := replace(temp,'-','');
if prcl_ty(temp).isValid then
return (prcl_ty(temp));
else
raise invalid_format;
end if;
END;
END;
Rich Hall
[email protected]You are correct in your assumptions. Client side PLSQL does not support user defined types like the one you are trying to use.
There are no workarounds I am afraid. -
Use of BinaryData variable type in the BPM
First of all, please forgive me if I am being stupid, but...
How do I load my data into a BinaryData variable type within the BPM studio.
I can create a variable of type BinaryData but I cannot find any mention of how
to load it with the data, nor any appropriate function!
Thanks in advance
SimonHi,
I have gone into transaction f.01 and am unable to find the component Transaction type in dynamic selections. If however you want to find Transacttion type 120 use transaction SE16n and table ANEKPV add in the transaction types (technical name BWASL) add other parameters example company code, period etc to get the related information.
Award points if useful.
Sadie Gajanand
Maybe you are looking for
-
I have PSE9 and have used PSE to edit screen shots. Some screenshots have required that I place an arrow to point to a specific location. I have used the shape tool for this purpose. For some reason, the shape tool has disappeared and I cannot figure
-
Custom settings of Edit-in Preset not applied to image in PS
I am having a problem with my custom made EDIT-IN Preset. While clicking on it launches the image (dng, psd or tiff) in PS, the custom settings of the preset (in my case: 8bit, sRGB) are not applied to the image. Instead the image is opened in PS wit
-
Sparse templates (when adding page types)
I'm not sure if this has already been posted in the forum, but I discovered it as I dealt with the growing number of templates, v1.1 templates, and custom templates that my iWeb now has. Also helps stub out the v1.1 'Blank' page type for older custom
-
Query for Inactive Responisibilities
Hello Everyone, Oracle Application Version : 11.5.10.2 OS : HP-UX I want a query to display in active responsibilities I have a query using this i am getting user and active responsibilities.. SELECT UNIQUE u.user_id, SUBSTR (u.user_name, 1, 30) user
-
Problem to connecte Tuxedo Service via WTC
Hello, I'm new to WTC. I want to call a tuxedo service disposed in our serveur tuxedo by using WTC. I created Local APs, Remote APs and Imported for this Tuxedo Service. When I call I have always same erreur (perrno = 6) in tpcall See below my callin