Parse query/procedure in Toad - oracle

I am new to Oracle/Toad. I am trying to create new procedures using Toad as IDE. Don't have permission/access to execute the procedures in the Oracle DB. In order to check whether the procedure is written correctly wanted to parse the procedure. We have do have option in SSMS for Parsing the query.
Tried to find on Google and got Ctrl+F9 option. But nothing happens when i press those keys. Do I need to change any other setting along with it?
SSMS Parse option

From my point of view, what you are doing is pretty much useless. How are you supposed to write a program if you aren't allowed to execute it? Why don't you ask for access? Or, do as we do (here, on StackOverflow): someone asks a question, doesn't provide test case so we create it ourselves. You could do the same.
if you have your own user in some database, do it there
if you don't, consider installing Oracle XE
if not, sign in for free access on apex.oracle.com and write code online
Though, what do you call "execute"? Can you compile it? That's what create or replace procedure your_proc does. begin your_proc; end; executes it.
As far as I can tell, you can tell TOAD to format code (Ctrl + Shift + F). If it fails, there's something wrong so you should fix it (TOAD will tell the position of the error). Other than that, if you can't compile nor execute it, I'd say that there's nothing you can do.

Related

Oracle: one or more scripts to provoke a failure on instance

For educational purposes, i need one or more scripts to provoke a failure on the current instance of Oracle (orcl for example). This way i can be sure that my backups are working accordingly. And yes, I NEED SCRIPTS.. so... no manual shutdown of my computer during a query or weird stuff like that.
To give some more context, am using the 19.x.x version of oracle, and using mostly SQLPLUS and RMAN for everything.
Thank you for your time. And,if i can get more than only one type of script, the better.
EDIT 1:
Since am being told of being "off-topic", i clarify. Am trying to save me up a fortune by skipping up a whole semester if i take a "convalidation exam". And what am asking is a point (or goal if you want) of the "summary" of the class. And it literally says: "The student should make one or more scripts so the instance fails and do a proper backup".
And right now am not recieving an answer from the teacher.
Just raise the appropriate exceptions:
DECLARE
tns_listener_not_found EXCEPTION;
PRAGMA EXCEPTION_INIT( tns_listener_not_found, -12154 );
BEGIN
RAISE tns_listener_not_found;
END;
/
or
BEGIN
RAISE_APPLICATION_ERROR( -20000, 'User specified error.' );
END;
/
Just write an SQL*Plus script that deletes the system datafile. The database will fail and the instance very likely, too.
SELECT file_name FROM dba_data_files WHERE file_name LIKE '%system%';
You store the filename in a variable and delete the file on the operating system, for instance on Unix:
rm /opt/oracle/oradata/.../system01.dbf
The HOST command is described here, how to store the file name here, I am confident that you can do the rest yourself!

Does reSELECT [tblmytable] clear a filter?

I'm converting a Foxpro app and I'm having a bit of trouble with database table referencing/selection. I'm not in a position to run the Foxpro code as I only have code dumps with which to work. If someone could help me understand what is happening here I'd be most grateful. Yes... I searched.
SELECT tblMyTable
Set Filter To Inlist(cbid,123)
SELECT tblMyTable
Does the second Select simply reselect tblMyTable and clear the filter?
If not is a second instance being opened so you have one that’s filtered and one that isn’t?
If so how do I reference each instance since they have no names? Automatically 1 and 2?
Lastly if I’ve got it completely wrong just give me a small clue and I’m on it. Thank you!
I see that you are being misguided.
Second select has no special meaning. That line is not needed at all, but wouldn't do an harm either.
If it were a view, then 'refreshing' a view is done by using Requery(), not by doing another 1 or more selects.
In fact, 'set filter' is on the list of (almost all VFP developers') "never to use commands" , exceptions like this might happen unfortunately.
If you are doing a conversion by only using code dumps and no VFP environment at all, then your task should be extremely hard. I would instead prefer a rewrite from scratch. That would be faster even for seasoned VFP developers.

It's is possible to do a insert on a mapplet without SQL transformation

It's is possible to do a insert on a mapplet without SQL transformation? Like in an expression?
Thanks
The short answer is ‘no’
A mapplet cannot contain a target, it CAN contain a source, which is kind of counter intuitive I suppose :)
You must always have at least one port going out of the mapplet, but as you suggest, it is possible to do ‘writing’ anyway, using a sql-trans.
Personally I prefer not to do so, and let all the writing happen immediately after the mapplet, since the sql trans is rather difficult to debug, and logging metadata in the repository is non-existing.

What does GET mean in PLSQL?

I recently discovered that GET is a reserved word in SQLDeveloper,but I can't figure out what it's for. Tried oracle help center's list of reserved words but there's no mention of it.
In short: What is the use of GET in PLSQL?
It doesn't mean anything in PL/SQL, unless you have an object with that name. Or in SQL.
It's a SQL*Plus command:
GET [FILE] file_name[.ext] [LIST | NOLIST]
Loads an operating system file into the SQL buffer.
You can get a file into the buffer and edit it there before executing it, rather than just running it directly with start or #.
SQL Developer implements, or at least recognises or allows, most SQL*Plus statements, presumably for compatibility reasons (though some things don't work, such as set embed on).
It seems to silently ignore get.
It's in the documentation's keyword list, rather than the reserved words list. You can use it as an object name etc.; they recommend you don't, but as this is a client keyword rather than a SQL one it wouldn't be as noticeable. At least, if SQL Developer didn't highlight it as a keyword...

Unable to modify this value in Debug

I can't set any value for input data, while debugging my procedure in Oracle SQL Developer.
When I try to change the value from NULL to any other I getting the following error. What is the problem? What does "debugger process may not allow values to be modified", and how can I fix this?
I think the problem is that you cannot modify the value of a parameter. I ran a quick test and was able to change the value of a variable, but got the same error message as you when I tried to modify a parameter.
There's no way to be sure though, Oracle debugging is a mess. The DBMS_DEBUG documentation is wrong. And there isn't any useful information for DBMS_DEBUG_JDWP, which is what SQL Developer uses.
You'll have to change the value before it is passed to the procedure, if possible.

Resources