sky_lt
asked on
Cannot insert function in select statement in oracle forms record group query
Hi,
I have created a packadge. Its specification:
"
PACKAGE GET_O_NUMBER
IS
FUNCTION F_O_NUMBER
( kodas IN number,
numeris IN varchar2 )
RETURN varchar2;
PRAGMA RESTRICT_REFERENCES(F_O_NU MBER, WNDS, RNDS,TRUST);
END;
"
But when i add it in select in forms record group query i get an error :
'' Unhandled error in icrg 102"
In record group query i write :
SELECT ORVIS.GET_O_NUMBER.F_O_NUM BER(past.k odas, pat_numeris) from ..........
ORVIS is my username. I use oracle forms 5.0.6.8.0 on database 9i
What could cause this error?
Thanks for any help
I have created a packadge. Its specification:
"
PACKAGE GET_O_NUMBER
IS
FUNCTION F_O_NUMBER
( kodas IN number,
numeris IN varchar2 )
RETURN varchar2;
PRAGMA RESTRICT_REFERENCES(F_O_NU
END;
"
But when i add it in select in forms record group query i get an error :
'' Unhandled error in icrg 102"
In record group query i write :
SELECT ORVIS.GET_O_NUMBER.F_O_NUM
ORVIS is my username. I use oracle forms 5.0.6.8.0 on database 9i
What could cause this error?
Thanks for any help
ASKER
yes i tried but it outpust:
"FRM-12001 Cannot create record group"
The packedge is ok as it works in sql navigator.
ASKER
my select in record group is :
SELECT
past.kodas,
pat.pat_numeris,
GET_O_NUMBER.F_O_NUMBER(pa st.kodas, pat.pat_numeris)
from
patalpos pat,
pastatai past
where
pat.id = past.id
SELECT
past.kodas,
pat.pat_numeris,
GET_O_NUMBER.F_O_NUMBER(pa
from
patalpos pat,
pastatai past
where
pat.id = past.id
You can try this, if it cannot help, then I don't know what is the problem:
SELECT
pastatai.kodas KODAS,
patalpos.pat_numeris PAT_NUMERIS,
GET_O_NUMBER.F_O_NUMBER(pa statai.kod as, patalpos.pat_numeris) G_O_N
from
patalpos patalpos,pastatai pastatai
where patalpos.id = pastatai.id
SELECT
pastatai.kodas KODAS,
patalpos.pat_numeris PAT_NUMERIS,
GET_O_NUMBER.F_O_NUMBER(pa
from
patalpos patalpos,pastatai pastatai
where patalpos.id = pastatai.id
ASKER
Thanks henka for help!
well i think i found the reason but i do not know how to solve it:
My function F_O_NUMBER returns varchar2(20) but when i put it in a select statement
the column in which it returns the values becomes of varchar2(4000) datatype.
I created view using that function and saw that the column which is made by the function
became of varchar2(4000) datatype. That is why i can not create the record group.
What could be the reason of it?
How i could make the datatype of varchar2(20) as defined in funcion?
well i think i found the reason but i do not know how to solve it:
My function F_O_NUMBER returns varchar2(20) but when i put it in a select statement
the column in which it returns the values becomes of varchar2(4000) datatype.
I created view using that function and saw that the column which is made by the function
became of varchar2(4000) datatype. That is why i can not create the record group.
What could be the reason of it?
How i could make the datatype of varchar2(20) as defined in funcion?
ASKER
I do not know why the column becomes of varchar2(4000) but i used
substr and solved this problem. Thanks for yor help.
Do you have any ideas about how the function of return type varchar2(20) returns varchar2(4000) ?
Thanks
substr and solved this problem. Thanks for yor help.
Do you have any ideas about how the function of return type varchar2(20) returns varchar2(4000) ?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This is an addition to ishando's comment:
Query record group
A query record group is a record group that has an associated SELECT statement. The columns in a query record group derive their default names, data types, and lengths from the database columns referenced in the SELECT statement. The records in a query record group are the rows retrieved by the query associated with that record group.Query record groups can be created and modified at design time or at runtime.
So if it is a function I think that if you use substr() in it the problem is gone.
Query record group
A query record group is a record group that has an associated SELECT statement. The columns in a query record group derive their default names, data types, and lengths from the database columns referenced in the SELECT statement. The records in a query record group are the rows retrieved by the query associated with that record group.Query record groups can be created and modified at design time or at runtime.
So if it is a function I think that if you use substr() in it the problem is gone.
SELECT kodas,pat_numeris,GET_O_NU