SQL Workshop - SQL Commands - Saved SQL:  Saved set of commands

Has any thought been given to this, or perhaps this has already been done.....
A saved set of SQL commands as a template
For example, when I'm in Excel and I start writing a lookup formula, a guide appears below the cell, reminding me of the format of what comes next. When I know what I'm doing, I simply ignore the guide. When I don't know what I'm doing, the guide is helpful - even linkable to more information.
Perhaps there are too many variables here to do that....
In the meantime, I'm creating my own 'set' as I learn - perhaps that's even better.
Marion in NY

Hi Kirsten,
this could be controlled at the database level whereby you create a schema that doesn't own the objects your users are querying but has the appropriate grants and privileges made to it and synonyms or views created to represent the objects. This schema then becomes the parsing schema for the workspace you let your users use. This wont prevent them from creating update statements, but at the database level it will not allow them to be executed.
Regards
Andre

Similar Messages

  • Setting the command prompt...

    Can anyone tell me what I would use to set the command prompt?
    On HP-UX, I would reset the PS1 variable...
    i.e. PS1="
    \$ID @ \$HOST | \$PWD
    --> "
    On Linux, I would reset it as follows:
    i.e. PS1="
    \u @ \h | \W
    --> "
    Neither of these seems to work here...
    I tried the following, and it give me the correct visual layout, but the values don't change when you change directories:
    i.e. PS1="
    `whoami` @ `uname -n` | `pwd`
    --> "
    Any help would be greatly appreciated...

    Hi,
    Changing Your Command Prompt
    The syntax you use to change your command prompt depends on whether you are using the Bourne,
    Korn or C shell.
    Bourne and Korn Shells
    For the Bourne or Korn shells, you redefine your command prompt with the PS1 command. The
    following are three examples:
    PS1=": "
    PS1="`hostname`: "
    PS1="`hostname`{`id`}}: "
    The first example sets the prompt to a colon (:), followed by a space.
    The second example creates a prompt consisting of your machine name followed by a colon and a
    space.
    The third example sets the prompt to your machine name, followed by your login name in braces
    {}, a colon, and a space.
    Type any of the examples above to change your current command prompt. The prompt will remain until
    you change it again, or logout.
    If you want to make your changes more permanent, add one of the above examples (or a prompt of your
    own creation) to your .profile file. If you do this, the prompt you specify will appear each time you
    login in or start a new shell.
    C Shell
    For the C shell, you personalize your command prompt with the set prompt command. The following
    are three examples:
    set prompt="% "
    set prompt="`hostname`\!: "
    set prompt="`hostname`{`id`}}: "
    The first example sets the prompt to the percent sign, followed by a space.
    The second example creates a prompt consisting of your machine name followed by the history
    number of the command (hostname1, hostname2, hostname3, and so on).
    The third example sets the prompt to your machine name, followed by your login name in braces, a
    colon, and a space.
    Type any of the examples above to change your current command prompt. The prompt will remain until
    you change it again, or logout.
    If you want to make your changes more permanent, add one of the above examples (or a prompt of your
    own creation) to your .cshrc file. If you do this, the prompt you specify will appear each time you login
    in or start a new shell.
    Revert back.
    Thanks.
    Senthilkumar
    SUN - DTS

  • Access to Previously-saved SQL in SQL Commands Window

    Hi all,
    If I've saved some SQL in the SQL Commands window, shouldn't that be available to other developers when they click on the Saved SQL tab? I saved a sample query and one of my other developers doesn't see it. I don't see any setting available in the developer account that controls whether or not the account can see others' saved SQL.
    If this isn't allowed, then I don't really see the point of the Owner drop-down in the Saved SQL tab.
    Any advice?
    Thanks!!
    John

    Hi Sc0tt,
    I think you may be referring to the Schema drop-down that appears in the upper-right area in SQL Commands, Object Browser, etc. That isn't the drop-down I'm referring to. I'm referring to the Owner drop-down that appears in the lower-half of the SQL Commands window then you click the Saved SQL link. I understand that to be the ApEx developer who saved the SQL - nothing to do with database schemas.
    I saved some SQL using the Save button assuming I could tell my other developers that if they click Saved SQL they'd see it listed. They don't, and the only choices in the Owner drop-down for any of us are "-- All Users --" or our own user. I don't see any setting I can change for our accounts to allow/prevent seeing others' Saved SQL, so either it's a bug, or if it's intentional that a user can only bring back their own saved SQL then there doesn't appear to be any point in having an Owner drop-down.
    Thanks,
    John

  • Use saved sql in report

    Hello specialists,
    I'm just starting with Apex, so sorry in advance for stupid questions, and posts on the wrong topics.
    I am making an application in which the user may only view his own records, so I thought I'd make a userdatabase, and put in every SQL
    'select * from tablename where "user" = V('APP_USER')', whereas the field user is also in de table with records.
    This seems to work, but I have 2 questions about that:
    - is this the best method?
    - instead of putting the SQL mentioned above, I've put it in a 'saved SQL'; is it possible to base a reportregion on this saved SQL, instead of always repeating this SQL in every report I make?
    I've tried to base my source of the region on 'select * from mysaved_SQL', but that doesn't work.
    Thank you for any reply, and remember I'm just a beginner... ;-)

    You might have better luck on the Apex forum
    Oracle Application Express (APEX)
    I have no APEX experience, but just in a general, database development comment - I do not think that making a database table full of SQL statements is a good approach. There are much more knowledgeable people on this forum that could explain the technical reasons why, but it just raises a red flag of "bad idea" when I even think about it. This may be totally off base for how Apex works, I don't know.

  • Run procedure from SQL Workshop Command window?

    hi, this one is simple.
    how to run a created procedure from APEX SQL Workshop SQL Command window?
    simon

    Simon,
    begin [proc_name]; end;
    -Carsten

  • HTML DB SQL Workshop Output to csv Max Row Count

    I am using HTML DB 1.6 with Oracle 10g 10.1.0.3.0 On SuSE Linux Enterprise Server 9.
    When I execute a query in SQL Workshop SQL Command Processor that returns a result set of greater than 5,000 rows and click the Output to Excel link, it exports NO MORE than 5,000 records.
    In working through Metalink with Oracle Tech Support, apparently for Reports in HTML DB there is a way to change the Max Row Count default limitation of 5,0000. However, this isn't in a report. It is simply from the query results page in SQL Workshop. Tech Support has been unable to idnetify ANYWHERE where I can change the default Max Row Count for simply outputting the results to csv format through the Output to Excel link.
    I am desperately looking for where I can globally change this default that will allow me to use SQL Worskshop to output greater than 5,000 records from within SQL Workshop.
    Thanks for you help!
    Mike

    hi mikes--
    that sqlworkshop 5k row limit issue was corrected in htmldb 2.0. in 1.6.x, i'm pretty sure you're always limited to 5k no matter what you select for that Max Rows attribute.
    regards,
    raj

  • SQLPLUS commands in SQL Developer

    We are using 11g with Sql Developer. We have some script such as healthcheck etc provided by oracle support, which has SQLPLUS commands in it.
    We are not able to run those in SQL Developer. We are getting errors.
    Are there any way, we could invoke SQLPLUS shell within SQL Developer?
    Thanks in helping.

    Hi qwe16235
    SQLPLUS command failed - not enough arguments
    line 36: SQLPLUS Command Skipped: set lines 300
    line 37: SQLPLUS Command Skipped: set pages 999
    These are formatting commands we do not do yet.
    The other command seems like an error in the middle of a PL/SQL block which we should have covered, just the start of it is not enough to know what the error is.
    An example of bad pl/sql error reporting:
    input:
    show parameter error <-------------- Dummy command so the plsql block does not begin at 1
    begin <----------------starting at line 3
    broken plsql; <------------- bad plsql at line (start)3+(from ora error)2 = 5 (should be 4 - must be one off)
    end;
    output:
    NAME TYPE VALUE
    sec_protocol_error_further_action string CONTINUE
    sec_protocol_error_trace_action string TRACE
    Error starting at line 3 in command:
    begin
    broken plsql;
    end;
    Error report:
    ORA-06550: line 2, column 8:
    PLS-00103: Encountered the symbol "PLSQL" when expecting one of the following:
    := . ( @ % ;
    The symbol ":=" was substituted for "PLSQL" to continue.
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    -Turloch
    SQLDeveloper team

  • SPOOLing in sql developer does not take into consideration SET ECHO OFF

    I'm running SQL Developer 3.1.07.42 on Windows 7 64 bit with java 1.7
    I have the following very simple script just to show the problem:
    SET ECHO OFF;
    SET FEEDBACK OFF;
    SET SERVEROUTPUT ON;
    SET VERIFY OFF;
    SET PAGES 0;
    SET HEAD OFF;
    SPOOL c:\test.sql
    SELECT 1, 2, 3 FROM DUAL;
    SPOOL OFF;
    /if I run it in TOAD 10.6.0.42 it creates the file with
             1          2          3This is as expected (by me)
    if I run the exact same query in SQL Developer 3.1.07.42 , it creates the file with:
    < SELECT 1, 2, 3 FROM DUAL
    1 2 3(the < above is actually ">" but the CODE formatting software is screwing ">")
    but I don't want the ECHOed command to be spooled. For the life of me, I cannot find a way to disable the ECHO from spooling in sql developer.
    Tried the same in 3.0.4 and 2.1.1 with the same (bad) result (plus some warning on some of the unsupported SET commands).
    Am I missing something obvious? Cause like this, the spool command cannot be used in sql developer to generate a CSV file for example, because of the echoed command. And windows doesn't come with SED by default so that is out. (plus that my original script is integrated into a much larger and complex set of scripts and the main script using them is executed from SQL Developer as a company policy (so that everybody uses the same tool and the code runs the same for everybody))
    Any ideas/suggestions are welcome
    Thanks.

    Hi Gary, you seem to have some extensive knowledge. I'd like to follow-up on this thread and try to understand why SQL Developer won't hide the code even though I'm already running the code as a Worksheet (I assume you mean Run Script F5 button in SQL Developer).
    I generally develop in SQL Developer that does a lot of dbms_output to echo data using a Spool command. When I'm in SQL Developer I can't get the code NOT to spool, it typically is echoed directly in the spool file at the top followed by the dbms_output data. If I save the sql file and run in in sqlplus it only outputs the data (good). If I use @C:\xyz_script.sql and hit F5 in SQL Developer it only outputs the data (per your previous answer) -- good.
    So why can't I hit F5 in SQL Developer in the script file and have it only output the data? It just doesn't work no matter how many "SETs" you turn-off.
    Looks like Echo, Term, Feed are supported in SQL Developer, maybe supported means something other than work.
    http://www.oracle.com/technetwork/developer-tools/sql-developer/sql-worksheet-commands-097146.html

  • Copy and Paste in an Application (like sql-workshop)

    Hey,
    i would like to implement a functionality to copy & paste (similar to sql workshop) data from an excell sheet into a formular.
    by submitting this formular i want to create a set of data after the 'tab' dividing.
    its not comma seperated. because its coming from an excelll-sheet.
    Does anybody know a solution
    PS: Or how i read an array to the tab sign and put this string in a select statement.
    greets phil
    Message was edited by:
    user557004

    Hi,
    How about the issue now, is it solved?
    This issue might be caused by her user profile. What the result would be if using another user account to log on her computer to test this issue.
    Also do you have the same problem when you open excel in Safe Mode?
    Try opening Excel without any Add-ins or hidden workbooks:
    Press and hold the CTRL key, and then click the excel program.
    Best Regards,
    Wind

  • Executing pl/sql procedure in SQL Workshop

    Hello.
    My understanding is that the only way to execute a pl/sql procedure in the SQL Workshop is via SQL Scripts, because running it under SQL Commands causes
    "ORA-00900: invalid SQL statement".
    Here is the statement I would like to run:
    execute efax_letter_to_pharmacist ('8888888888','ASDFSFSFSF','1','APN123456789','81');
    and here is the message I get when I run it under SQL Scripts:
    You have requested to run a script that does not contain any runnable statements.
    Script Name TEST
    Created on 02/14/2008 10:47:15 AM by ADMIN
    Updated on 02/14/2008 10:56:45 AM by ADMIN
    Number of Statements 0
    Script Size in Bytes 86
    thanks
    Boris

    Boris,
    Execute is a SQL*Plus command.
    It should work if you call your procedure in a begin-end block. e.g:
    begin
      efax_letter_to_pharmacist ('8888888888','ASDFSFSFSF','1','APN123456789','81');
    end;

  • Added Schemas can be viewed in SQL workshop but can't while creating Form

    Hi Friends
    We are using APEX 3.1 and Oracle 10.2.0 at back end.
    I can assign other schemas to a work space successfully.
    The Problem is that
    Added schemas can be viewed in SQL Workshop (SQL commands)
    But can not view the added schemas in the list when want to create a form based on table
    Regards
    Jazib

    Jazib,
    When you select an application the application's Owner attribute determines which tables/views you see in the wizard LOVs. If your application owner (parsing schema) is FOO and you want to create a form on table BAR.T then you have to grant select on BAR.T to FOO.
    Scott

  • Added can be viewed in SQL Workshop but can't when want to create form

    Hi Friends
    We are using APEX 3.1 and Oracle 10.2.0 at back end.
    I can assign other schemas to a work space successfully.
    The Problem is that
    Added schemas can be viewed in SQL Workshop (SQL commands)
    But can not view the added schemas in the list when want to create a form based on table
    Regards
    Jazib

    Closed: duplicate post.

  • Works in SQL Workshop, not in LOV Definition

    I developed a query
    select distinct b.pointname display_value,a.pointnumber return_value
    from e_sub08@scadahst_xajardb a, analogpoint@scadahst_xajardb b
    where a.pointnumber = b.pointnumber
    in SQL Workshop and I get the dataset that I need when I run it there. When I went to plug it into an LOV as a shared component in an application, I get the message "LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query."
    Why in one, but not the other? Any suggestions as to what I need to change?
    Thanks!

    Hi Kofi,
    Many thanks for that, Kofi - I hadn't even noticed that that option was available!!!!
    In order to set this up, you need to define the LOV through Shared Componets, Lists of Values rather than on the page item itself. (Note that there is a typo in the example code - depno should be DEPTNO :D )
    I've just set up an example using this: [http://apex.oracle.com/pls/otn/f?p=34398:12] - pick any dept apart from the one shown at the top as being deptno = 10 and the second list is empty. Select the department that is deptno = 10 and you get the employees.
    The LOV is defined as:
    IF v('P12_DEPTNO') = '10' THEN
      RETURN
      'SELECT ename d, empno r '||
      'FROM emp '||
      'WHERE DEPTNO = 10 ORDER BY 1';
    ELSE
      RETURN
      'SELECT ename d, empno r '||
      'FROM emp '||
      'WHERE DEPTNO = 1234 ORDER BY 1';
    END IF;Therefore, you could have as many SELECT statements as you like provided all of them return a valid LOV recordset
    Andy

  • Copy command for SQL*Plus

    Am trying to use the copy command in SQL*Plus to copy a table
    from an Oracle database to a local table on my machine in
    another format. Keep getting errors. It seems to contact the
    remote machine fine, but can't locate my local machine or figure
    out where to put it. Any suggestions on how to set up my
    Windows 95 machine to get the copy command working would be
    greatly appreciated. Thank you.
    null

    Hi,
    Here is an example :
    SQL> copy from scott/tiger@q4_production_server create ord -
    using select * from ord;Array fetch/bind size is 15. (arraysize is 15)
    Will commit when done. (copycommit is 0)
    Maximum long size is 80. (long is 80)
    Table ORD created.
    21 rows selected from scott@q4_production_server.
    21 rows inserted into ORD.
    21 rows committed into ORD at DEFAULT HOST connection.
    Hope this helps,
    Bala
    Laura Michaels (guest) wrote:
    : Am trying to use the copy command in SQL*Plus to copy a table
    : from an Oracle database to a local table on my machine in
    : another format. Keep getting errors. It seems to contact the
    : remote machine fine, but can't locate my local machine or
    figure
    : out where to put it. Any suggestions on how to set up my
    : Windows 95 machine to get the copy command working would be
    : greatly appreciated. Thank you.
    null

  • Trying to run simple procedure in SQL Workshop

    Hello,
    I'd like to test how procedures work and APEX so I setup a simple one that I'd like to run in SQL Workshop (below). I try the follow to execute the procedure:
    begin
    MY_TEST_PROC;
    end;
    But it results in the following error:
    ORA-06550: line 2, column 1:
    PLS-00306: wrong number or types of arguments in call to 'MY_TEST_PROC'
    ORA-06550: line 2, column 1:
    PL/SQL: Statement ignored
    I've spelled the procedure name correctly, and there are no input parameters required. Why is it erring?
    Steve
    Procedure:
    create or replace procedure "MY_TEST_PROC"
    *(p_contract_number OUT VARCHAR2)*
    is
    begin
    select
    contract_number
    into
    p_contract_number
    from contracts
    where id='5';
    end;

    dbms_output will display a variable's contents. I don't recall if you need set serveroutput on for APEX SQL Workshop or not (I don't have it up right now)
    set serveroutput on size 1000000
    declare
      result varchar2(4000);
    begin
       MY_TEST_PROC(result);
       dbms_output.put_line('My proc result = '||result);
    end;The documentation for all the variations of development (11gR2) is here: http://www.oracle.com/pls/db112/portal.portal_db?selected=5&frame= It can be overwhelming starting out. Since you are jumping into stored procedures with APEX, I suggest starting with the 2-day developers guide, then the PL/SQL Language Reference.

  • How to drop multiple tables in SQL Workshop

    Hi,
    I'd like to drop multiple tables in one time but
    SQL command processor returnes error message: ORA-00933.
    Could you please tell me how to drop multiple tables in
    one time?
    My trial was follows
    Drop table "table1", "table2"
    Result
    ORA-00933: SQL command not properly ended
    Regards,
    Hideki Sakamoto

    Hideki,
    SQL syntax permits you to specify only one table in a DROP TABLE command.
    The SQL Command Processor permits you to run one statement or PL/SQL block per submission.
    So there are at least two ways you can do this. You could either upload or create a SQL script in SQL Workshop which contains your multiple statements:
    drop table "table1"
    drop table "table2"
    or you could execute a single anonymous PL/SQL block in the SQL Command Processor, as in:
    begin
    execute immediate 'drop table "table1"';
    execute immediate 'drop table "table2"';
    end;
    Joel

Maybe you are looking for

  • No More Chipmunks?

    Theodore..? Simon..? Alvin..? Alvin? ALVIN! I just discovered one more new and great enhancement to GarageBand 08. I inadvertently imported a 22khz AIFF file. As HangTime was quick to answer, this used to lead to chipmunk audio. Not any more! GarageB

  • Does any one here know about "Elink"

    Dear all, We are using WebLogic. We have a requirement to turn SQL based structures into XML messages. In essence we have to build up an XML doc representing something like (say) a PO (Purchase Order) which itself has PO lines etc.etc such that you m

  • Can't see payload for the ws that is source of data for an omniportlet

    Hi, I have created a simple omniportlet and want to be able to retrieve information from a web service. In the "Source" step of the Omniportlet definition wizard, I specify the wsdl for the web service. I am able to see the method on the web service

  • Windows XP system not getting good connection with Airport Extreme

    I just moved into a house that already has a Mac system with an apple wireless network. I have a Dell 3.2 GHz system and I just bought a D-Link wireless card 108G with Mimo technology which is supposed to increase the range of the card. The airport e

  • Telemarketer calls like crazy??

    In the past 30 hours, I have received nearly 25 telemarketer calls to my cell phone.  This has never happened before!  Has anyone else had this problem??