"Variable" is it a reserved word?
Hi, a third party application generates a table, which contains
a column called: "variable", and the name of this column can not
be changed...
I need to use the column, but when I refer to it, oracle sql developer
put the word "variable" in bold and gives an error while compiling:
...DECLARE
var_xyz table.variable%TYPE
Is there anyway to solve this issue with the column name?
thanks you all,
jo
SQL> l
1 select *
2 from v$reserved_words
3* order by keyword
KEYWORD LENGTH
USING 5
VALIDATE 8
VALIDATION 10
VALUE 5
VALUES 6
VARCHAR 7
VARCHAR2 8
VARRAY 6
...
Similar Messages
-
I need to use a reserved word as parameter name in proc called from URL
Let me preface this post by saying I already know this is terrible to attempt, but it's short term fix only.
Ok, so I have to create a procedure that will be called by a vendors application via a API that calls our URL to send data over. The terrible part is
that the API they have uses the parameter FROM=vendor_data A change is on the way so in the future the API won't use FROM as a paramter, so this isn't something I want to do, but it's a workaround.
So the nastiness is this..., I can create a procedure that'll compile when I enclose FROM in double quotes "FROM" as my input parameter
but if I try to call my procedure via URL (as their application will do) the procedure isn't working. I searched for someway to do an inline
replace of the FROM parameter to something else, but no luck. I'm open to all positive comments. I cannot go outside of Oracle
to do this, so I can't call a shell script and replace. Basically I need some way to use a reserved word as a parameter name, and then be able to call
that proc from a URL, or someway to change the FROM in the URL inline. Any help on this admittedly whacky situation would be appreciated much.
I tried ...\myproc?from=text
...\myproc?"from"=text
...\myproc?'from'=text
proc is simple test procedure
create or replace procedure myproc
("from" in varchar2 default 0)
is
v_from varchar2(30);
begin
v_from:="FROM";
insert into test(col1) values(v_from);
end;
**** Update
I didn't get any more replies but came to a solution that I thought I'd post. It's much better, more elegant and maybe can help others.
So instead of using FROM as the parameter name I did some research and decided I can use flexible parameters. Basically you end up having
2 input parameters for a procedure, one holds a parameter name the other holds the parameter value. They get loaded into arrays
and you access the values with regular name_array(1), value_array(1), etc. ?v=parameter&v2=value
Once I figued I could use flexible parameter it took me tons of research to find out the actual syntax. I'll post some examples for others
later, but was suprised with the lack of resources consideriing how "flexible" they are.
Thanks again for the replies. Cheers.
Edited by: Mitz on Jul 29, 2009 11:37 PMScott,
Thanks for the reply. I'm not familiar with the wwv_flow_epg_include_mod_local, however I know that the
myproc is available via URL. I passed the my procedure name(myproc) on to the dba a while back to make it "accessible" so, I'm assuming that he
added it to this the www_flow_epg_mod_local (assuming this has something to do with access control).
If I modify myproc procedure and remove "FROM" as the input variable, and replace with say,
IN_FROM I can then call the procedure via the URL ./myproc?in_from=test without any problems.
I'm pretty confident that it's the "FROM" that is the hurdle and not a security or setup issue. The proc is fine to call from the URL until I got the curveball that the only available parameter was FROM. How the URL should be when inputing to that parameter?
Edited by: Mitz on Jul 25, 2009 7:36 PM
Edited by: Mitz on Jul 25, 2009 9:16 PM -
Invoking LC webservices from VB6 where "invoke" is reserved word
Hi everyone:
I'm making some poceses tests on one customer (We are running a proof of concept and positioning LC technology ) who wants to invoke LC PDF-G orchestrated services using the WS endpoint from an VB6 app.
When the VB6 app creates the proxy object to call the invoke method exposed by the LC orchestrated process an compilation error occurs,
apparently invoke is a "reserved word" for internal use in VB6, so it doesn't works...
If we try to invoke an out-of-the-box LC service from a VB6 app via the WS API all works fine!
This is part of our code:
SERVICE = ""
Port = ""
WSDL = "http://172.26.45.195:8080/soap/services/getReportTitle?WSDL"
Set objSoap = New MSSOAPLib30.SoapClient30
objSoap.ClientProperty("ServerHTTPRequest") = True
Call objSoap.MSSoapInit(WSDL, SERVICE, Port)
objSoap.ConnectorProperty("AuthUser") = "administrator"
objSoap.ConnectorProperty("AuthPassword") = "password"
Resultado = objSoap.Invoke("1")
An we attache the VB error.
How to solve this problem...??
Thanks in advance,
Diego.That's going to be tricky because any custom LC processes has a default method of invoke. You may be able to "reflect" it by creating a java service that lives on the LC server. That java service can call the LC application and could be called by the VB6 app.
On the other hand, I though Microsoft end-of-life for VB6 was back in March 2008 - so you may want to push them into using a .Net version. -
Best practice for the use of reserved words
Hi,
What is the best practice to observe for using reserved words as column names.
For example if I insisted on using the word comment for a column name by doing the following:
CREATE TABLE ...
"COMMENT" VARCHAR2(4000),
What impact down the track could I expect and what problems should I be aware of when doing something like this?
Thank You
BenHi, Ben,
Benton wrote:
Hi,
What is the best practice to observe for using reserved words as column names.Sybrand is right (as usual): the best practice is not to use them
For example if I insisted on using the word comment for a column name by doing the following:
CREATE TABLE ...
"COMMENT" VARCHAR2(4000),
What impact down the track could I expect and what problems should I be aware of when doing something like this?Using reserved words as identifiers is asking for trouble. You can expect to get what you ask for.
Whatever benefits you may get from naming the column COMMENT rather than, say, CMNT or EMP_COMMENT (if the table is called EMP) will be insignificant compared to the extra debugging you will certainly need. -
How to use reserved word in MAX() function?
Hello, I migrated from SQL Server 7 to Oracle 8.1.7 and have to keep the same tables, columns etc names as it used to be in sql server. One of my tables have colunm called 'Row' and as far as I understand it's reserved word in Oracle
I need to bypass it somehow in the following query:
SELECT MAX(Row)
FROM TableX
I'll appreciate all ideas
Thanks in advance
MarinaHi,
Try one of the following
Select MAX("ROW")
Select MAX("Row")
be careful the double quotes (") make the Row case sensitive.
Regards
John -
My XML document has the tag <DATE>. (an Oracle reserved word)
My Oracle table has the column DATE. This was creating by enclosing the column name with quotes when creating the table.
I assumed that a putXML would work since the SQL Reference manual says that Oracle considers DATE and "DATE" to be the same thing.
However, when I run putXML, I get the error message "missing SELECT keyword encountered during processing ROW element 1".
Does this XML file need to be preprocessed by XSLT to alter the DATE element, does getXML have a bug, or did I do something wrong?
Thanks.Scott,
<p>
Yeah I know it is a bug but what I was not sure of is whether Product Development knew about it or not.
<p>
I was just letting Product Development know about it in case they did not already.
<p>
<b>Is there, or should there be, another (better) way of reporting bugs with Application Express to product development.</b>
<p>
Chris -
How to Exclude Java Reserved Words Using StringTokenizer
Hi, i'm trying to exclude identifiers and java reserved words using StringTokenizer from an input file outputting the remaining words alphabetically ordered with the line, on witch they occur, in front of the word.
So far my code does all that, except exclude those words. I'm kind on a dead end... Any suggestions?
The code:
public class Interpreter{
/* Uses a Binary Search Tree */
public static void main(String args[ ]) {
String path = null;
for (int j = 0; j < args.length; j++) {
try {
// Step 1, read the input file
path = args[j];
FileReader input = new FileReader(args[j]);
BufferedReader br = new BufferedReader(input);
String line;
int count = 1;
String word;
// Step 2, create an empty Tree
BST tree = new BST();
while((line = br.readLine())!=null){
StringTokenizer str = new StringTokenizer(line);
while (str.hasMoreTokens()){
word = str.nextToken();
tree.insert(word,count);
count++;
// We're done, print out contents of Tree!
tree.print();
// Error Handling
//check for IO problem with bad file
} catch (IOException e) {
System.out.println("There was a problem with the filename you entered.");
//check for no filename entered at command prompt
} catch (ArrayIndexOutOfBoundsException e) {
System.out.println("Please include a filename when running this program.");
}Edited by: Redol on Dec 12, 2007 8:32 PM
Edited by: Redol on Dec 12, 2007 8:33 PMuse split instead of tokenizer.
public String[] splitString( String line, String delim )
String[] tokens = null;
if( line != null )
tokens = line.split( delim );
return tokens;
} -
"MS" reserved word in oracle text query?
Wondering if anyone has run into the string "MS" behaving as a reserved word in oracle text queries. For example, this specification returns all records from Texas:
'<query>
<textquery>
<progression>
<seq> TX WITHIN CUSTOMER_STATE </seq>
</progression>
</textquery>
</query>'
But this one does NOT find any results for Mississippi:
'<query>
<textquery>
<progression>
<seq> MS WITHIN CUSTOMER_STATE </seq>
</progression>
</textquery>
</query>'
I've confirmed we have data that should match, and I've tried escaping it with the sequences as described in the SQL docs (I've tried single quotes, pairs of single quotes, braces, and combinations of those) . And trying to find info on the web is tough since all web queries that contain 'MS' bring back tons of Microsoft-relevant information.
Can anyone nudge me in the right direction for a better google-search, or some materials in these forums (my initial searches here didn't turn anything up either).
Thanks for any feedback!
jhWondering if anyone has run into the string "MS" behaving as a reserved word in oracle text queries.Maybe because »MS« is in the default english stoplist?:
English Default Stoplist. -
SQL Developer 1.5 migration issue with MS use of reserved words
In version 1.2 the was and advanced option that allowed the use of reserved words for column names, I can not find that option in 1.5. What happened to this option? I can not find it and I need to port those applications with out changing the column names. I know I can hand edit the scripts but I did not have to do that with 1.2.
Any one know if this can still be done?n 1.2 iIt was under preferences - > Migration -> Advanced, in version 1.5 no advanced options and I searched around and could not find it else where. gulp as for the reserved words ( don't laugh I am just migrating under orders) there are date, number and some columns with embedded / that it barfs on. I am under orders to do it the way it is written.
-
How Badly Do You Abuse Reserved Words in Column Names
I have a challenge for all you DBA's out there. Most of us agree that reserved words as column names is a bad practice but how clean is your database and some people are quit outspoken about it. Run the following query on some of your custom, non-COTS, databases and post your top 5. You may want to run it in Development to make sure new tables don't violate the best practice. Often we don't think when creating column names or inherited ugly databases, but the fact is, we all have reserved word column names.
Marcus Bacon
SELECT col.column_name , COUNT(1)
FROM all_tab_columns col, sys.v_$reserved_words rwrd
WHERE col.column_name = rwrd.keyword
AND owner NOT IN
( 'SYS',
'SYSTEM',
'MDSYS',
'DBSNMP',
'WMSYS',
'XDB',
'APPQOSSYS',
'OPSG',
'ORDDATA',
'ORDSYS',
'OUTLN' ,
'CTXSYS',
'OE',
'HR',
'TOAD')
GROUP BY col.column_name
ORDER BY count(1) desc,col.column_name;
COLUMN_NAME
COUNT(1)
TO_DATE
32
NAME
21
ID
14
OWNER
9
CLASS
6Hi,
Interesting exercise!
I modified your query, showing separate counts for Oracle, COTS and In-House schemas:
WITH got_developer AS
SELECT CASE
WHEN a.owner IN ( 'APPQOSSYS'
, 'CTXSYS'
, 'DBSNMP', 'DMSYS'
, 'HR'
, 'MDSYS'
, 'OE', 'OLAPSYS', 'OPSG', 'ORDDATA', 'ORDSYS', 'OUTLN'
, 'SCOTT', 'SYS', 'SYSTEM'
, 'TOAD', 'TSMSYS'
, 'WKSYS', 'WMSYS'
, 'XDB'
) THEN 'ORACLE'
WHEN a.owner IN ( 'FUBAR'
) THEN 'COTS'
ELSE 'IN_HOUSE'
END AS developer
, r.keyword
, r.reserved
FROM all_tab_columns a
JOIN sys.v_$reserved_words r ON r.keyword = a.column_name
SELECT keyword
, reserved
, SUM (CASE WHEN developer = 'IN_HOUSE' THEN 1 END) AS in_house
, SUM (CASE WHEN developer = 'COTS' THEN 1 END) AS cots
, SUM (CASE WHEN developer = 'ORACLE' THEN 1 END) AS oracle
, COUNT (keyword) AS all_sources
FROM got_developer
GROUP BY GROUPING SETS ( (keyword, reserved)
, (reserved)
ORDER BY keyword
, reserved
Output from one database:
KEYWORD R IN_HOUSE COTS ORACLE ALL_SOURCES
A N 1 1
ACCOUNT N 2 2
ADMIN N 3 3
ADMINISTRATOR N 3 3
ADVISE N 2 2
ALIAS N 2 2
ALWAYS N 3 3
ATTRIBUTE N 8 34 42
ATTRIBUTES N 11 11
AUTHENTICATION N 3 3
AUTHID N 3 3
BIGFILE N 4 4
VALUE N 8 3 173 184
VERSION N 1 2 124 127
WAIT N 2 2
WHEN N 1 1
WHERE Y 2 2
WRITE N 1 1
XID N 20 20
XMLSCHEMA N 15 15
YEAR N 21 1 22
ZONE N 2 30 32
N 479 182 4253 4914
Y 3 3
479 182 4256 4917
241 rows selected.
Over 85% of the cases (including all 3 of the reserved words (1 ORDER and 2 WHEREs) were in Oracle-supplied schemas.
The most commonly used keywords, outside of Oracle schemas, were
ID (used in 206 tables)
NAME (80)
PERCENT (38)
ZONE (32)
YEAR (22)
TIMESTAMP (18)
USAGE (17)
COST (15)
CLASS (12)
STATEMENT_ID (12)
LOCATION, which was one of your most common examples, only occured 4 times in this database, and OWNER not at all (outside of Oracle schemas). -
Check variable against an array of words
Hi,
I wish to check a variable for a number of words that are in
a array.
Not sure if this is the best way to do it, but this is what i
have.
I have my own counter system that counts every visitor, but
some of these visits are from BOTS, spiders..
So i wish to have a method of searching the HTTP_USER_AGENT
for certain words i put in a array.
What i am after is how i get the words in an array and how i
then get the script to check the HTTP_USER_AGENT for a word in the
array and if so it will not complete the script. (not add to the
counter)
if none of the words are in the HTTP_USER_AGENT then it will
add to the counter.
so something like?
<?
// do array
// check if HTTP_USER_AGENT contains a word from array
if () {
// increase counter if none of the words are in
HTTP_USER_AGENT
include(increase.php);
?>
its the bit between the if () that i have no idea about, any
help would be great.
cheers in advance for your help.
Jasonnot very clever wrote:
> this is a bit more about what i am trying to do.
>
> <?
> // do array
> array(1)="something";
> array(2)="something else";
> array(3)=..
> ..
> ..
>
>
> $HTTP_USER_AGENT = contants of the HTTP_USER_AGENT
> // check if HTTP_USER_AGENT contains a word from array
> if (array(x) is in the string $HTTP_USER_AGENT) {
> // increase counter if none of the words are in
HTTP_USER_AGENT
> include(increase.php);
> }
>
> ?>
>
>
$myArray = array('blip','blop','glup',...);
$counter = 0;
foreach($myArray as $mA){
if(preg_match('/'.$mA.'/',$HTTP_USER_AGENT)){
$counter++;
seb ( [email protected])
http://webtrans1.com | high-end web
design
Downloads: Slide Show, Directory Browser, Mailing List -
Rman dupicate db skip tablespace not working reserved words with quoates
This is how the script looks like
set newname for datafile '/oracle/oracle10.2/oradata/smalldb/users01.dbf' to '/oracle/staging/TEST1/users01.dbf';
set newname for datafile '/oracle/oracle10.2/oradata/smalldb/system01.dbf' to '/oracle/staging/TEST1/system01.dbf';
set newname for datafile '/oracle/oracle10.2/oradata/smalldb/sysaux01.dbf' to '/oracle/staging/TEST1/sysaux01.dbf';
set newname for datafile '/oracle/oracle10.2/oradata/smalldb/undotbs01.dbf' to '/oracle/staging/TEST1/undotbs01.dbf';
duplicate target database to TEST123
SKIP TABLESPACE 'USERS2', 'USERS3', 'CATALOG'
PFILE= '/oracle/staging/test123init.ora'
LOGFILE
'/oracle/staging/TEST1/redo01.log' SIZE 4096K reuse,
'/oracle/staging/TEST1/redo02.log' SIZE 4096K reuse,
'/oracle/staging/TEST1/redo03.log' SIZE 4096K reuse;
contents of Memory Script:
set until scn 12748962;
set newname for datafile 1 to
"/oracle/staging/TEST1/system01.dbf";
set newname for datafile 2 to
"/oracle/staging/TEST1/undotbs01.dbf";
set newname for datafile 3 to
"/oracle/staging/TEST1/sysaux01.dbf";
set newname for datafile 4 to
"/oracle/staging/TEST1/users01.dbf";
restore
check readonly
clone database
skip tablespace USERS3,
USERS2,
CATALOG ;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00601: fatal error in recovery manager
RMAN-03012: fatal error during compilation of command
RMAN-03028: fatal error code for command Duplicate Db : 600
RMAN-00600: internal error, arguments [8049] [] [] [] []
**RMAN-01009: syntax error: found "catalog": expecting one of: "double-quoted-string, identifier, single-quoted-string"**
RMAN-01007: at line 16 column 2 file: Memory Script
I tried single quote and double quote but it did not work.
Any idea what is going wrong here ?
-RohitWhat oracle version? Check the DB alert log files for information about the internal error. Other thing is RMAN may be getting confused with the 'CATALOG' tablespace with it being a reserved word in RMAN in generating the internal script - may be a bug.
See in the internal script:
skip tablespace USERS3,
USERS2,
CATALOG ;The internal script gets an error once it reaches CATALOG even though you've quoted it in the original script. For example:
RMAN> list copy of tablespace CATALOG;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "catalog": expecting one of: "double-quoted-string, identifier, single-quoted-string"
RMAN-01007: at line 1 column 25 file: standard inputwhereas with quotes should work (untested).
Edited by: Stellios on Oct 14, 2009 11:37 AM -
What to do when a table name is a reserved word?
I know the best answer is not to use a reserved word to name a table. But I have no control over that in this situation. I have read that using all Caps and quotations will allow you to use the table name in queries, i.e. "CATEGORY" is suppose to free the table to be used. But that is certainly not working, nor any variation of that formatting.
Does anyone know how to format a reserved word to allow queries?
Thank YouUse double quotes:
SQL> create table ALTER (a number);
create table ALTER (a number)
ERROR at line 1:
ORA-00903: invalid table name
SQL> create table "ALTER" (a number);
Table created.
SQL> desc alter
ERROR:
ORA-00931: missing identifier
SQL> desc "ALTER"
Name Null? Type
A NUMBER
SQL> insert into "ALTER"
2 select level from dual connect by level<=10;
10 rows created.
SQL> select * from "ALTER";
A
1
2
3
4
5
6
7
8
9
10
10 rows selected.BTW CATEGORY is not a reserved word:
SQL> create table category (a number);
Table created.Max
http://oracleitalia.wordpress.com
Edited by: Massimo Ruocchio on Feb 25, 2010 12:32 AM -
Use Enum to Switch on Strings where one string is a java reserved word.
Hi,
I'm having problems switching on a string using enums, when one of the strings is a java reserved word. Any suggestions would be appreciated. Or maybe even a suggestion that I should just be stringing together if-else if and doing string compares rather than a switch.
I've been using the following method to switch on strings.
public enum MyEnum
foo, bar, novalue;
public static MyEnum stringValue(String string)
try { return valueOf(string); }
catch (Exception e) { return novalue; }
Then I can switch like
switch(MyEnum.stringValue( someString )
case foo:
break;
case bar:
break;
default:
break;
Now I have run into the problem where one of the strings I need to use is "int", which is a reserved word in java, so I have to modify.
What is the best way to handle this?
I could just not add it to the Enum and handle it at the switch like this...
switch(MyEnum.stringValue( someString )
case foo:
break;
case bar:
break;
default:
if(someString.equals("int") { ... }
break;
OR...
I could change the Enum, and return intx, by checking if the string is "int". I could check before the valueOf, or during the exception, but I know it's not good practice to use Exceptions in the normal execution of your code... as it's not really an exception.
public enum MyEnum
foo, bar, intx, novalue;
public static MyEnum stringValue(String string)
if(string.equals("int") { return intx; }
try { return valueOf(string); }
catch (Exception e) { return novalue; }
OR...
public enum MyEnum
foo, bar, intx, novalue;
public static MyEnum stringValue(String string)
try { return valueOf(string); }
catch (Exception e) {
if(string.equals("int") { return intx; }
else return novalue;
}My advice is still to not name the enum the same as the value of the string you want to test for. That page I linked to shows how to have enums with parameters. Then you could have an enum whose name is (say) JavaInt and whose string value is "int".
But frankly if I wanted to map Strings to actions I would just use a Map<String, Action> instead of trying to force my code into an antique construction like switch. -
Incomprehensible Oracle Reserved Word Error
I'm trying to create a Table for a new application and I keep getting this error message:
1 error has occurred
The identified column name is an Oracle reserved word. Please choose another name.
Unfortunately, it doesn't identify a column as containing a reserved word. I tried googling for a list of Oracle Reserved Words, Oracle Keywords, and PL/SQL Reserved Words; but none of them match the column names in my table. My column names are:
PROJECT NAME (Aliases)
(C)USTOMER REQUEST or (IT) REQUEST
Priority (1= high)
PROJECT STATUS
PROJECT MANAGER
LAST STATUS
Link to Status
START DATE
ESTIMATED COMPLETION
NOTES
Report on Time?
Business Analyst
Technical Lead
Business Apps
DBA_Name
Systems
Network
NOC
CSC
Training
Communications
SME
Super User
Contracts
ERP
DBA_Name used to be DBA, which is a keyword, but when I changed it to DBA_Name, i got the same error. Please help.
Steve in Raleigh NCThanks. I'm using Oracle 11g. I think what you're suggesting would work, if the objective is to create an empty table and then populate it with data.
However, what I'm trying to do is import a spreadsheet into APEX as a table, after which I shall build an application on that. If I do it your way, I'll have to key all the spreadsheet data in after creation, creating the possibility of keyed errors, which would require proof-reading. I'd prefer not to do that.
This morning, before returning to this thread, I was able to import the spreadsheet by changing all the column names to the corresponding Excel column heads: A, B, C and so on. When I went to SQL workshop to rename the columns, I found only 10 had been imported. There are 22 columns in the spreadsheet, most of them populated, and we need them all.
I believe I can still use the table I have created. I can add the extra 12 columns now, one at a time, and populate them by typing, if I must.
However, if there's some constraint or constant I can alter to import all 22 columns with all the information in one pass, I would appreciate it. There are 53 rows. Keying 12 columns for all 53 would be something of a pain.
Steve the n00b in Raleigh NC
Maybe you are looking for
-
Greetings! So here's the skinny. I have a 1st Gen Nano - have had absolutely no issues with it, or my Nike+ stuff, until a few days ago. On Saturday, the 24th, I was running, and my Nano had a total battery loss/shut down. It had been giving me (I th
-
Audio line-in input won't work
Hello, have used Garageband several times in the past, and have had no problems setting the input as audio line-in to record my guitar. However, I tried again for the first time in a couple of years the other day and neither my Powerbook or my iMac w
-
How do I update web template HTML files on MAC
I'm running lightroom 4.3 on a PC. The web template needed a few changes making, mainly the layout and replacing links for images etc., I could not find a way to update via lightroom so I changed the detail.html and grid.html files directly in C:\Pro
-
Error message on dowloading App Manager update
I'm trying to download the update to CC Application Manager and get an error message that it can't be loaded. I've tried twice. Before I attempt to download any other updates, I want to make sure I've got the manager updated.
-
File transfers are soooo extremely slow in Parallels! How to speed up?
For transferring files between osx and parallels, i use the tool which is dilivered with paralles, but is is sooooo extremely slow here. It took 3 minutes too transfer a 2 mb file. Is it possible to acces the OSX partition in windows by using Macdriv