Error Call A Function Which Alter Sequence Value
Jun 22, 2011
error call a function which alter sequence value..I created a function to reset a sequence value as below
CREATE OR REPLACE FUNCTION rebuildSequence
return number
As
l_csmsgid1 PLS_INTEGER;
l_csmsgid2 PLS_INTEGER;
l_val PLS_INTEGER;
plsql_block VARCHAR2(500);
[code]....
I verified and executed the pl/sql block without a problem. but when only put into a fuction and call it, got then error.
View 7 Replies
ADVERTISEMENT
Feb 17, 2010
why function does no raise error no_data found when call in select statement.
1) create one function.
CREATE OR REPLACE function fn_sal(v_id NUMBER) RETURN NUMBER
IS
v_sal NUMBER;
BEGIN
SELECT sal INTO v_sal FROM emp where empno=0;
RETURN v_sal;
END;
2) call it in select statement.
SELECT fn_sal(e.sal),e.* FROM emp e
select satement cause no error , it displayes all the records but null for the function cloumn.
why it not gives no_data_found error.
View 4 Replies
View Related
Jun 30, 2011
my java program i am executing a pl/sql function using callable statement i checked everything in the function and the function is created without compilation errors in sql*plus environment, and i gave all DBA permissions to the user, but i got the error like below
java.sql.SQLException: ORA-06550: line 1, column 28: PLS-00201: identifier 'NAME' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored
and i wrote the function like below for the below table
create table student(regno number(6),name varchar2(15),dob date,phone number(10),
address varchar2(30),cat varchar2(2),password varchar2(12),hallno number(6),
fee_paid varchar2(3),constraint student_pk primary key(regno))
create table fee(regno number(6), branch varchar2(15),amount number(4), ddno number(12), fee_paid varchar2(3),
dddate date, dd_received_date date default sysdate, constraint fee_pk primary key(regno))
[code]...
and the java program is like below
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection connection=DriverManager.getConnection(dbURL,dbUserName,dbPassword);
CallableStatement st=connection.prepareCall("{?=call
[code]...
View 5 Replies
View Related
May 4, 2010
is there any way to alter only max value in sequence without specifying the max value.
i know we can alter it like :
-- Alter sequence
alter sequence TEST_SEQ
maxvalue 99999999;
can we alter it without providing the max value and let oracle choose default value for the same, same as we can do it when creating a new sequence.
View 5 Replies
View Related
Dec 31, 2005
When I try to compile a procedure with this command:
alter sequence myschema.seqmessages increment by 100;
The error says "encountered symbol "ALTER" when expecting...
Is there another way to alter a sequence from a procedure? In this case, I am altering a sequence in another schema that has granted the alter and select privileges for the sequence.
View 7 Replies
View Related
May 18, 2012
I have to load data from sql loader in a table and the table has got a varchar2 column which accept data from sequence.the expression would be.
TRANSACTION_ID "'AUTO-'||To_Char(prt_trs_id_seq.nextval)"
TRANSACTION_ID is the column name.
When i add this expression the loader doesn't work, when i remove it works and load null for this column and valid data with other column.
View 2 Replies
View Related
Sep 26, 2013
I am able to see 1Hr difference in my date fields of SQL output because in UI (User Interface) date field was stored in BST format but DB time zone is in GMT format so how to find a solution for 1 hr difference, here i don't have Privileges to alter DB time zone and i couldn't use function as i have so many SQL's and can't apply that function manually. SO is there any other option to change the DB time zone with out alter it and with out using function.
View 1 Replies
View Related
Oct 28, 2010
Can we call a function in IN of "WHERE" clause.I mean to say like:
Select *
FROM table1,table2
WHERE table1.col=table2.col and CONDITION IN FUNCTION1
View 1 Replies
View Related
Dec 3, 2011
How to call outside function in procedure
View 11 Replies
View Related
Jan 3, 2012
I want to have something like this:Run PL/SQL function and in middle of function call JAVA function and when JAVA function is done continue PL/SQL function.
Because I have PL/SQL function who inserts into table information.And the JAVA function is uploading/streaming file to column->blob.And in the end of PL/SQL function goes insert into table with file extension and check for *.edoc validation.I can't do it with PL/SQL only. how to do this right or how to run JAVA function in PL/SQL.
View 3 Replies
View Related
Mar 5, 2010
I am defining a function in a schema as a user with admin role (default). The function is to do a call to another function on a custom package in SYS schema.
something funny happens : when I compile the function (defined with authid as DEFINER)it says that the function SYS.custom_package.myFunction is not defined.
however if I do a select sys.custom_package.my Function from dual it's okay.
why this behaviour and how to work around it? You see, the package in SYS proposes a number of other functions that I don't want to expose. I only intend to create some sort of wrapper function that would Marshall the call to the my Function only on the custom_package in SYS.
my wrapper function looks something like that :
create or replace function myFunction_wrapper authid definer return pls_integer is
begin
return sys.custom_package.myFunction;
end;
View 2 Replies
View Related
Feb 27, 2013
i am trying to call a function from Sql statement and i am getting this error ORA-06572: Function XX has out arguments.
View 2 Replies
View Related
Dec 9, 2010
I try to alter the SGA it give me error The Steps which I do show sga
Total System Global Area 135338868 bytes
Fixed Size 453492 bytes
Variable Size 109051904 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
[code]...
View 5 Replies
View Related
Aug 6, 2010
I have a package includes 22 functions, each function just returns a sql template (clob type).
I also have a stored procedure called query_builder, query_builder has applicationName and statementName as parameters. I need to call these functions in the package based on the given applicationname and statementname.
CREATE OR REPLACE PROCEDURE Query_builder (ApplicationName varchar2, StatementName varchar2) IS
SQLSkeleton varchar2;
BEGIN
PackageName := ApplicationName||'_SKELETON;
SQLSkeleton := PackageName.StatementName; -- I know this will not work, but how can i call these function dynamically?
View 6 Replies
View Related
Oct 19, 2011
Can we call a function within decode statement. I am able to do the same for simple example function . But In my actual procedure it's giving the error message . Are there any restrictions to call function with in decode statement?
View 4 Replies
View Related
Nov 30, 2011
how to play around with NDS dynamic sql and I'm trying to add a column on the fly.Basically the procedure is trying to take a table name, column name, and eventually a data type and adds it to a table.
It works fine without the bind variable for the column name, accepting the table name on the fly.As soon as it tries to use the column name I get an ORA-00904 invalid identifier exception.
Here is the procedure I'm using
CODEcreate or replace
procedure test(tbl_name varchar2, col_name varchar2) IS
qry varchar2(500);
begin
[code]....
Here is how I'm executing it.
CODEexecute test(tbl_name => 'BB_SHOPPER', col_name => 'MEMEBER');
View 3 Replies
View Related
Oct 22, 2013
I made this script but I still don't quite understand if the syntax is correct. I just wanted to create a function and call it in an anonymous block. I then wanted it to use a variable as a parameter in an iteration and output the variable every iteration. It's done basically but I know it's not 100% right. The fibonacci function looks like its going to loop an infinite number of times if the parameter is greater than 2.
CREATE OR REPLACE PACKAGE myPACKAGE AS
CREATE OR REPLACE FUNCTION fibonacci
(n BINARY_DOUBLE) RETURN BINARY_DOUBLE IS
BEGIN
IF n <= 2 THEN
RETURN 1;
[code]........
View 5 Replies
View Related
Jul 17, 2012
i have this function
create function xxx_sal (p_number in number)
return number is
v_sal number;
begin
select sum(sal)
into v_sal
from emp
where empno = p_number;
return v_sal;
end;
how can called it in oracle forms
View 8 Replies
View Related
Apr 12, 2012
I have made a function to add two number create or replace function add_num(a in number, b in number) return number
as
begin
return a+b;
end;
/
i run it via
select add_num(2,5) from dual;
my question is how to call add_num in procedure.
View 9 Replies
View Related
May 20, 2011
how to call a function on key-next-item trigger. atlst the syntax.
View 2 Replies
View Related
Sep 5, 2007
I am having Oracle 9.2.0.1.0 client in my PC and jdk version is 1.6
I had configured below tools in my PC. (windows 2000) I am having Oracle 9.2 with Oracle Developer Suite 10g (10.1.2.0.2) which contains Oracle JDeveloper 10g (10.1.2.1) also.
How to call a java function from Oracle forms? code samples and how to integrate those thing?
View 13 Replies
View Related
May 24, 2011
I am stuck with a query which is taking a lot of time to execute. Below is the pseudo code of the same:
SELECT TAB_ALIAS1.COL1,TAB_ALIAS1.COL2,TAB_ALIAS1.COL3
FROM TABLE1 TAB_ALIAS1
WHERE TAB_ALIAS1.COL4 = <INPUT PARAMETER1>
AND TRUNC(TAB_ALIAS1.ELAP_TIME) =
(
SELECT MAX(ELAP_TIME)
[code]....
View 6 Replies
View Related
Apr 30, 2013
I need to call the VB function below from a Procedure's PL/SQL code and capture the returned variable into a varchar2 variable.I looked at the several means and nothing seems to work.
View 5 Replies
View Related
Jul 13, 2012
On a Oracle 11g R2 I've a table function ( PIPELINED ) returning rows selected from a table.The first time the function is selected, in a session ( I've tried to disconnect and log in again ), it returns no rows.I've tried to log the call using DBMS_OUTPUT and from what I see the select on the table function returns no rows and no output is printed. So I presume Oracle is not calling the function.
The same function on a similar environment ( same db versions, patches and database structure ) works fine. The second environment is a production environment so it has more memory and some other settings enabled.
View 6 Replies
View Related
Jul 3, 2012
How to call a function with a row type return in an Oracle select statement.
For e.g. :
If I had this function with a rowtype return:
------------------------------
create function abc
return xyz%rowtype
is
rec xyz%rowtype;
begin
select * into rec from xyz where col1 = n;
return rec;
end;
--------------------------------
How could I use this in a select clause, as there is a multi column return by the function ?
View 5 Replies
View Related
Jul 2, 2013
I wrote function Quantity(p_item_number in varchar2)RETURN NUMBER, i called This function in POST_QUERY ,Error like this "wrong number or type of arguments in call to Quantity", i tried like as " Quantity(p_item_number in varchar2)RETURN NUMBER" , but it gives an error "encounterd the symbol VARCHAR2 when expecting one of the following ( "..
View 6 Replies
View Related
Jun 19, 2013
What is the difference between alter session and alter system?
View 2 Replies
View Related
Aug 9, 2011
Calling function
select PACK.MAIN('blah') from dual
generates:
ORA-14551: cannot perform a DML operation inside a query
ORA-06512: at "SYSADM.NEW_QUANTUM_PACK", line 756
ORA-06512: at "SYSADM.NEW_QUANTUM_PACK", line 245
Unfortunately the Body is not accessible to see.The spec of the function is:
FUNCTION MAIN (mvar IN varchar2) RETURN varchar2; I read somewhere that I can call it like:
var myVar VARCHAR2; call PACK.MAIN('blah') into :myVar
But this generates: ORA-01008: not all variables bound
View 3 Replies
View Related
Oct 3, 2012
1 - i want to ask few things as i m new to apex, i am using apex 4.1, and created 3 select list and a button in selecting of parameter,
1 select list : select area
2 select list: select product
3- select list - size of the product
i want to generate Ids for the following. for that i created query for INSERTING RECORD FROM ONE TABLE TO ANOTHER , generation the ids when button pressed "Generate" after selecting parameters,
Now where i call that QUERY on button ? because when i create button its gives me option to submit, defined dynamic action, etc, where i call the function name id_generation when button pressed?
2- second thing i created tabular " select user_id, product_name, product_type from product".
By default check box list are create delete submit button are created, first when i insert record it saves that was fine, e.g i entered 50 records and afterward i want to update only one record, e.g there is a record product name = box, if i change it to box small and click submit then it saves all the page means all 50 records,
I want to submit only that record that i changed, for that i use the logic that only those records should be updated which are checked but the user. how will i do this ?
View 4 Replies
View Related
Feb 4, 2013
I have the following C code:
class Factorial {
public:
int getVal (int a);
};
[code]....
/When I am trying to execute this function always get the ORA-06521. I changed the data types - but nothing changed.
Just in case, listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = db)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
[code]....
View 6 Replies
View Related