SQL & PL/SQL :: Declare Identifier In Oracle 10g?

May 22, 2013

When I am running script in oracle 10g ,getting error message as "PLS-00201: identifier 'UTL_SMTP' must be declared".

how to declare identifier 'UTL_SMTP' in oracle 10g or how to give execute access to current user

View 6 Replies


ADVERTISEMENT

SQL & PL/SQL :: ORA-00904 - Invalid Identifier In Oracle 11G

Sep 24, 2013

I have created one user in DB using below command

SQL> create user user1 identified by user1;

User created.

SQL> grant dba to user1;

Grant succeeded.

SQL>

I am trying to run below query

SQL> select dbms_random.value(-9223372036854775808, 9223372036854775807) from dual;
select dbms_random.value(-9223372036854775808, 9223372036854775807) from dual
*
ERROR at line 1: ORA-00904: : invalid identifier

I am getting "ORA-00904: : invalid identifier" even after giving the DBA right to user.When I run the same query using the sysdba , I am able to run the query

SQL> conn / as sysdba
Connected.
SQL> select dbms_random.value(-9223372036854775808, 9223372036854775807) from dual;

DBMS_RANDOM.VALUE(-9223372036854775808,9223372036854775807)
-----------------------------------------------------------
-5.113E+18
SQL>

View 4 Replies View Related

SQL & PL/SQL :: Oracle Error For Invalid Identifier In Execute Immediate Statement

Apr 5, 2011

I have a procedure as below. To sum up the procedure in one line it dynamically forms a string to get the values of the type which is passed as an input to the procedure.

I call the procedure as

exec exec_imm( exec_imm_t(1,'asd','1/2-34'));

ERROR:
Error starting at line 9 in command:
exec exec_imm( exec_imm_t(1,'asd','1/2-34'))
Error report:
ORA-00904: "P_TYPE_DATA"."ADDRESS": invalid identifier
ORA-06512: at "PTK_ADM.EXEC_IMM", line 26
ORA-06512: at line 1
00904. 00000 - "%s: invalid identifier"

NOTE:
When I try to execute the procedure with the execute immediate statement I get the above error. But when I execute the select statement which is nothing but the value in v_type_data directly (as seen in the comments in the code below) there is no error. But when the same v_type_data is used in execute immediate, I get an error.

CREATE OR REPLACE procedure exec_imm(p_type_data exec_imm_t)
AS
v_type_str CLOB := NULL;
v_type_data CLOB := NULL;
v_type_name VARCHAR2(25) := NULL;
BEGIN
[code]......

View 6 Replies View Related

Oracle And MySQL Database - Could Not Resolve Connect Identifier Specified

Jun 2, 2011

i tried for 3 days to setup a connection between my oracle database 11.2 (resides on 2003,64 bit Microsoft windows) and a mysql database (resides on 2003,32 bit Microsoft widows).

i used dg4odbc 64 bit which was installed on oracle server, my steps was as follows :

1- configure ODBC driver (MYSQL 3.51 odbc) on oracle server that connect to mysql database and the connection was tested successfully (the name of odbc dsn is DG4ODBC).

2- configure the listener.ora file (which resides on dg4odbc installation path) that contains the following :

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxxxxxxxxxxx)(PORT = 1511))

[code]....

3- configure the tnsnames.ora file (which resides on oracle database path) that contains the follwoing :

DG4ODBC =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=xxxxxxxxxxxx)(PORT=1521))
(CONNECT_DATA = ( SERVICE_NAME = DG4ODBC ))
(HS=OK)
)

4- configure that initdg4odbc.ora file that resides on the dg4odbc installation.

HS_FDS_CONNECT_INFO = DG4ODBC
HS_FDS_TRACE_LEVEL = off

5- restart the gateway listener.

6- test DG4ODBC service by tnsping which was successful .when i try to get some data from mysql database by SELECT * FROM MDL_COURSE@DG4ODBC query,the query take some time (15 second !!) and return

ORA-12154: TNS:could not resolve the connect identifier specified

View 2 Replies View Related

SQL & PL/SQL :: Declare And Set Parameters

Dec 22, 2010

the same query i put below but in oracle.

I'm trying to declare and set parameters in oracle

I'm trying to do something similar as the follow SQL Server Sentence:
------------------------------------------------------
DECLARE

@Year SMALLINT,
@City varchar(255)

SET @Year = 2010
SET @City = ''NY','NJ''

[Code]....

View 3 Replies View Related

SQL & PL/SQL :: Have Exception In Declare Block

Feb 20, 2012

Can we have any exception in DECLARE block (shown are just for example)?

Declare
exception occured
begin
code
end;

declare
variables;
begin
declare
variables;
begin
code;
end;
end;

View 6 Replies View Related

SQL & PL/SQL :: Declare Returned Value - Getting Error

Jan 28, 2013

while trying to execute this

declare ret_val number;
begin
exec p_buildinfo('252657020001', to_date('20120820','YYYYMMDD'),to_date('20120928','YYYYMMDD'),ret_val, 0);
DBMS_OUTPUT.PUT_LINE('Value Returned Is : '||ret_val) ;
end;

I getting the below error

ORA-06550: line 3, column 10:
PLS-00103: Encountered the symbol "P_BUILDINFO" when expecting one of the following:

:= . ( @ % ;
The symbol ":=" was substituted for "P_BUILDINFO" to continue.

the procedure structure is

CREATE OR REPLACE
PROCEDURE p_buildsinfo ( var_p_cod CHAR := NULL,
var_p_dat_from DATE := NULL,
var_p_dat_to DATE := NULL,
po_var_l_nxt_seq IN OUT NUMBER,
var_p_consol_flg NUMBER default 0
)

View 14 Replies View Related

SQL & PL/SQL :: Error On DECLARE Statement?

Dec 19, 2011

I am getting an error when trying to run this DECLARE statement and I'm not sure why. I'm fairly new to PL/SQL and have looked up how to format a DECLARE statement and this seems right to me.

DECLARE

v_eventstart date;
v_maxhbdate date;
v_6monthPOS date;

[code]...

The error is stating "encountered the symbol "end-of-file" when expecting one of the following... " and is refering to the beginning of this statement.

View 6 Replies View Related

PL/SQL :: Declare Variable As Row Type For A Table?

Jul 19, 2012

Can I declear a variable in PLSQL as the row type for a table, who's name is unknown during compile time, but will be determined when the PLSQL is runnning. The code is like following:

Procedure operTable( tableName IN VARCHAR2)
IS
TYPE ty_Row IS tableName%ROWTYPE
v_Row ty_Row;
CURSOR v_quey_cur

[code]...

View 5 Replies View Related

PL/SQL :: Declare Variable In Stored Procedure

Dec 21, 2012

how do you declare a variable in a store procedure

View 11 Replies View Related

SQL & PL/SQL :: Declare A User Define Exception Name As Per Defined Name?

Jan 25, 2011

Can we able to declare a user define exception name as per defined exception name?Ex: we have predefined exception called :"NO_DATA_FOUND "

Now in my PL/SQL block can i able to declare "NO_DATA_FOUND" like

Begin
no_data_found exception;
//statements
raise no_data_found;
end

View 6 Replies View Related

SQL & PL/SQL :: Difference Between Variables Declared Under Begin And Declare?

Feb 24, 2013

i just what to understand the differnce between the variable declared under the Begin and variable declared under Declared. to understand this i tried a sample plsql procedure as show below

create or replace
PACKAGE BODY TEST_DEV AS
PROCEDURE TESTING(I_NAME VARCHAR2,
I_AGE NUMBER) AS
INTEGE binary_integer := 100;
[Code] .......

the Line L_nums1 NUMBER := 100/0; is throwing error(PLS-00103: Encountered the symbol "NUMBER" when expecting one of the following:)

if i remove the line L_nums1 NUMBER := 100/0; and just declare the variable out side the begin , and using inside the same variable inside the begin works fine

Why question is why we are not able to decalre, initialize and use the same Number variable insde the begin

View 4 Replies View Related

SQL & PL/SQL :: How To Declare A Variable Which Reference Level Type

Aug 5, 2010

I have a problem :

In package head I declare a variable , which reference 'level' type , but I don't know how to declare the variable , because I don't know what type of 'level'.

View 9 Replies View Related

Forms :: How To Declare Global Variable And Call Same In Other Form

Oct 6, 2008

I want to call a value from one from to another form in d2k forms 4.5. I think this can be done only by declaring a global variable. I don't know how to declare global variable and also calling the same in other forms.

View 14 Replies View Related

SQL & PL/SQL :: How To Declare Global Variable In Package Body (Not Spec)

Feb 26, 2013

I want to know how we can declare a Global Variable in Package body(Not Spec), So that i can use it in any procedures or function(Defined in same package).

View 11 Replies View Related

SQL & PL/SQL :: Hide Declaration Or Declare It Inside The Body Of Package

Mar 11, 2010

I have a package which has couple of Procedures and functions. I use some constants between the functions and procedure and also functions r called from the other procedure and stuff...

So I declared all these in the header

Like this

CREATE OR REPLACE PACKAGE "PROCESS_HISTORY" IS
type table_name_i is varray(100) of VARCHAR2(30);
c_add constant number := 1;
c_del constant number := 2;
c_select_frm_tmp constant number := 1;
[code]......

Now is there anyway I could hide the stuff that I don't want outside people to see? or can I declare them (constants and some functions) some where inside the body and use them?

View 9 Replies View Related

Precompilers, OCI & OCCI :: Variable Declarations In DECLARE SECTION?

Mar 9, 2010

I am getting some odd results from a Database Insert Function. The function receives an Array of elements. The elements are a defined structure (containing around 21 data items). I need to insert these records into an Oracle table.For each element of the Array the function reads the structure into a local c structure of the same type.

I then go through this local structure and get a copy of the data into local variables declared in the EXEC SQL BEGIN DECLARE SECTION of the function. I then use the local vars to do the insert, using null INDICATOR variable to handle those variables that could be empty. The local variables look like this....

EXEC SQL BEGIN DECLARE SECTION;
int dbServiceTypeId;
int dbRecordType;
char dbRbmCustRef[MAX_CUST_REF_LEN];
int dbServiceSeq;

[code]...

BUT.. when I uncomment the dbCOS variable (even though I don't populate it or try to include it in the insert) I get the following in the table (The RATE value goes missing completely and the multiplier is wrong)...

ID SERVICE CODE R/T RATE MULTI
41325-SCODE-1084 1 542139762
11326-SCODE-1086 1 542139762
11326-SCODE-1086 2 542139762
21327-SCODE-1087 1 542139762
21327-SCODE-1087 2 542139762
21327-SCODE-1087 3 542139762
21327-SCODE-1087 3 542139762

However, a printf statement just before the insert based that returns the variables shows the following...

Service Type ID: '4'
Record Type ID: '1'
Service Cust Ref: '1325-SCODE-1084'
Service Unit Rate: '1200.00'

Indeed, for this record the Multiplier doesn't even get populated. The other odd thing is if I recomment the dbCOS but remove the dbOraDateFmt variable definitions, it corrupts the data again, though different fields. I can't understand why individual local variables are behaving this way. Is this a problem with the way variables are declared in this section?

View 3 Replies View Related

Forms :: Declare Message For @ Is Not Type In Email Address

Oct 24, 2011

i want if user is not type the @ in email text box than from show the message "check your email address" but i cant do that

declare
ok_flag number :=0;
begin
ok_flag :=instr('emailaddress','@');
if
ok_flag < 1 then
message('invalid email');
else
message('thanks');
end if;
end;

View 8 Replies View Related

Connect Oracle Database From Delphi - Could Not Resolve Connect Identifier Specified

Oct 6, 2010

I have the following computer/setup:

Acer laptop, Intel Processor w/ Windows 7 Professional (64-bit)
Delphi 2010 Professional
Oracle XE (+ the Oracle XE client that comes with it)

I cannot can't to the Oracle database from Delphi. The error I keep getting is:

Alias is not currently opened. [Oracle][ODBC][Ora]ORA-12154:TNS: could not resolve the connet identifier specified.

Here's what I've done:

1. Create an ODBC connection to my Oracle database

- run C:WindowsSysWOW64odbcad32.exe to open the ODBC administrator.
- Data source name: bt_user
- TNS Server Name: localhost/xe
- user bt_user
- Clicked "test connection" -- Success.

2. Open Delphi and drop a TDatabase component on my main form.

- Set the Alias Name property to "bt_user" (the alias I set up in ODBC)
- Set database name to "bt_user".
- Checked "connected".

Alternatively, I tried using the Delphi ADO components (the dbGo components).

- Drop TADOConnection component on my form.
- Select "connection string" and open the dialog.
- Click "build string".
- Select "Microsoft OLE DB Provider for ODBC Drivers" from the selection.
- In "use data source", select "bt_user" from the drop-down list (my ODBC connection from #1)
- Click "test connection".

Again the same error.

My questions are:

1. Can Delphi work with Oracle XE (Express Edition)?

2. If so, then do I need to install the "Instant Client"?

3. Will the instant client for Oracle 10g work with Oracle 10g XE?

4. Do I need to install any additional ODBC driver(s)?

5. Why was I successful in creating the ODBC connection in Windows, but it failed in Delphi?

6. Will Visual Studio.NET (C#) work with Oracle XE, and what are the steps for setting that up?

View 2 Replies View Related

SQL & PL/SQL :: Declare Date Variable And Assign It To Current System Date

Apr 19, 2011

Write a program to declare a date variable and assign it to the current system date. Depending on the day of the month the program should print the following:

If day is 1-10 then print "It is day<day number> of <month name>. It is early in the month".
If day is 11-20 then print "It is day<day number> of <month name>. It is the middle of the month".
If day is 21-31 then print "It is day<day number> of <month name>. It is nearly the end of the month".

For example, if the day is November 30, then print "It is day 30 of November. It is nearly the end of the month".

View 9 Replies View Related

SQL & PL/SQL :: Invalid Identifier?

Oct 30, 2011

I am trying to do an update with an anonymous PL/SQL block because it has been absolutely impossible to get by the infamous "Single-row subquery returns multiple rows" Whatever.So this code below work... Obviously, I am updating it to a constant.. OK, duh.. Of course it works, it's easy.... Now, I really need to update it to a value in another table that is in my cursor. I believe that I probably need to declare a secondary cursor.

I'm just getting back in the DBA saddle, so I'm a little rusty..

set serveroutput on;
DECLARE
numrows NUMBER := 0;
total NUMBER := 0;
CURSOR upd_record_cur IS SELECT m.rowid, m.swcm_cycle, t.newcycle, p.aprem_no from toad.fswcmas m,

[code]...

Not so good here

ORA-06550: line 20, column 53:
PL/SQL: ORA-00904: "TOAD"."TTP43425_LOAD"."NEWCYCLE": invalid identifier
ORA-06550: line 20, column 10:
PL/SQL: SQL Statement ignored

Doesn't work...
BEGIN
FOR upd_rec IN upd_record_cur LOOP
update toad.fswcmas sw set sw.swcm_cycle = toad.ttp43425_load.newcycle
WHERE rowid = upd_rec.rowid;
total := total + 1;

View 17 Replies View Related

ORA-00972 / Identifier Is Too Long

Feb 5, 2009

I am attempting to run a query to pull some data to fill a data request. However I keep getting the following error, "ERROR at line 1:ORA-00972: identifier is too long."

select FS_CORRESPONDENCE_CODE||';'||CM_FILER_SEQ||';'||CM_ORGNAME||';'||CM_FILER_CODE||';'||
CM_PARTY_CODE||';'||RC_LNAME||';'||RC_FNAME||';'||RC_ORGNAME||';'||RC_MAILADDR1||';'||
RC_MAILADDR2||';'||RC_CITY||';'||RC_STATE||";'||RC_ZIP||';'||RC_OCCUPATION||';'||
RC_EMPLOYER||';'||RC_AMT||';'||
from TREFCM, trefrc, treffs
WHERE CM_FILER_SEQ = RC_FILER_SEQ

[code]....

View 3 Replies View Related

PLS-00201 / Identifier Must Be Declared

Oct 30, 2008

I am trying to execute the below and getting the error:

PLS-00201: identifier 'DBMS.REFRESH' must be declared

The mv is in my schema.. so I am owner. I thought I once read that a dbms.refresh had to be in a block.. so I added the begin and end.. but that didn't resolve it.

I have tried two ways, both resulting in the above error:

execute dbms.refresh('mv_bb_basket');
begin
dbms.refresh('mv_bb_basket');
end;

View 1 Replies View Related

SQL & PL/SQL :: ORA-00972 / Identifier Is Too Long

Jul 14, 2012

SQL> alter system "_allow_level_without_connect_by"=true scope=spfile;
alter system "_allow_level_without_connect_by"=true scope=spfile
*
ERROR at line 1:
ORA-00972: identifier is too long

View 11 Replies View Related

SQL & PL/SQL :: ORA-00904 EID Invalid Identifier

Oct 18, 2013

I'm having an issue creating a table which references a larger table of mine.It gives me the error:

ORA-00904: "EID": invalid identifier

when issuing the command:

CREATE TABLE Phone (P_num CHAR(7), P_type VARCHAR2(10), PRIMARY KEY(P_num), FOREIGN KEY(EID) REFERENCES Employee ON DELETE CASCADE);

I need the employee id (EID) to be the primary key for my table Employee, as described here:

DESC Employee;
Name Null? Type
----------------------------------------- -------- ----------------------------
EID NOT NULL CHAR(7)
E_NAME VARCHAR2(15)
E_ADDRESS VARCHAR2(30)

And since Phone has its own primary key of Pnum, I find it weird that it won't let me reference Phone back to Employee using EID.

View 12 Replies View Related

SQL & PL/SQL :: PLS-00201/ Identifier Must Be Declared

Aug 3, 2011

I need export data from remote server i.e. in Oracle8i envtt. but in my machine having client oracle10g.

I m using command from local machine :

expdp test/test@test_env_tns dumpfile=abcd_dat.dat logfile='abcd.log

then i m getting error :

UDE-00008: operation generated ORACLE error 6550
ORA-06550: line 1, column 52:
PLS-00201: identifier 'SYS.DBMS_DATAPUMP' must be declared
ORA-06550: line 1, column 52:
PL/SQL: Statement ignored
[/code]

Note : I m executing command from my local machine command prompt

View 8 Replies View Related

PLS-00201 - Identifier Must Be Declared

Jul 16, 2012

I am using oracle 10g database (10.2.0.1.0), which trouugh an error while i am trying to EXPORT.

View 4 Replies View Related

How To Generate Unique Identifier

Jun 21, 2012

Is there a way to generate a unique identifier(length 8), which can contain numbers (0-9) and letters(a-z) in pl/sql or sql ?

Note :- in oracle 9i.

View 23 Replies View Related

PL/SQL :: Getting Invalid Identifier Error

Jul 24, 2012

select to_char(123.5,'fm$99999.00') from dual

when I execute this I get an output of $123.50...I want to use other speacial characters like @,* instead of $...But I am getting invalid identifier error if I use any special character other than $.

View 5 Replies View Related

SQL & PL/SQL :: Ora-00972 Identifier Is Too Long?

Jan 24, 2012

i have an error while running an SQL statement - ora-00972 identifier is too long.

SELECT
COL_XXXXXXXX,
COL_XXXXXXXXXXX,
COL_XXXXXXXXXXXXXXXXXXXXX,
COL_XXXXXXXXXXXXXX,
COL_XXXXXXXXXXXX,
COL_XXXXXXXXXXXXXXX,
COL_XXXXXXXXXXXX,
COL_XXXXXXXXXXXXXXX,
COL_XXXXXXXXX,
FROM SCHEMA_NAM.TABLE_NAME_XXXXXXXX
WHERE rowid = 0x414142345a63414150414147532f49414178
FOR UPDATE NOWAIT

I've read that the error is caused by object name too long, longer then 30 symbols, to be exact.

The weird thing is that the statement does not have a reference to such a column ableother object name, not that long.

Moreover, when i eliminate the where clause by setting it as remark , i see that the query is executing without an error:

--WHERE rowid = 0x414142345a63414150414147532f49414178

when i look at the max(length(rowid)) from our tables - i see that the value is 18, while the length in the query is 38.

this seems to be the problem, but i don't understand why, and didn't see a proof of it in the documentation.

also, in the log of the application debug, i see another error on executing the exact statement - ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired.

1. What can cause the ora-00972 error? is it the Rowid value?

2. How do i know what is the max length of rowid allowed?

3. is the first error somehow related to ORA-00054?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved