Adding more statements to the sql commands window

Hi, I'm using oracle database express edition10g and I just started using oracle.
And I'm having a problem adding more then one statement inside the sql commands gui window.
I write:
CREATE TABLE "testTable" (
     "field1" VARCHAR2(2),
     "field2" NUMBER(2,0),
     "field3" NUMBER(2,0),
     CONSTRAINT "Test_PK" PRIMARY KEY("field1")
Oracle reports: table created
I write
DROP TABLE testTable;
CREATE TABLE "testTable" (
     "field1" VARCHAR2(2),
     "field2" NUMBER(2,0),
     "field3" NUMBER(2,0),
     CONSTRAINT "Test_PK" PRIMARY KEY("field1")
Oracle reports: ORA-00911: invalid character
I remove the ; char
ORA-00933: SQL command not properly ended
I look in the help files and it sais that ; / and nothing is allowed to end a operation.
I gues ; is a valid char so it's reporting something else?
I tried pasting my code inside wordpad and even retyping it. Mayby I have a hidden char? =>same error.
When I run drop and create seperatly it works.
When I run both sql statements inside sql+ it works
What m I doing wrong?

To run multiple SQL in one shot, you need to save them as SQL batch file,
Save your statements as recreate.sql
DROP TABLE testTable;
CREATE TABLE "testTable" (
"field1" VARCHAR2(2),
"field2" NUMBER(2,0),
"field3" NUMBER(2,0),
CONSTRAINT "Test_PK" PRIMARY KEY("field1")
);Then call it from SQLPlus,
@recreate.sql

Similar Messages

  • Two or More parameters in the SQL Source Window

    Hi,
    I have a Crystal Reports which uses an SQL Query as the source. I have a Report Date Range in the Crystal Reports but I want to improve the performance by embedding the parameter in the SQL Command. One parameter in the SQL Command is fine but more than that, I'm getting the following error:
    Failed to retrieve data from the database.
    Details: ORA-00911 : invalid character
    Database Vendor Code: 911
    Is there a configuration that I should do before adding two or more parameters?
    Thanks.

    Hi,
    The expression is something like this:
    ... where CLOSED_DATE >= {?Start Date} and CLOSED_DATE <= {?End Date}
    I also tried to use the BETWEEN IN function but got the same error. The CLOSED_DATE, Start Date, and End Date are Date Time.
    Thanks.

  • Does CTAS evaluate "order by" in APEX SQL Command window?

    I need to recreate my table in order to change the column order. When I use the SQL Commands window and run the SQL, it runs successfully, creates the new table, but doesn't reorder the columns.
    Is this expected behavior?

    user648567 wrote:
    Please update your forum profile with a real handle instead of "user648567".
    I need to recreate my table in order to change the column order. When I use the SQL Commands window and run the SQL, it runs successfully, creates the new table, but doesn't reorder the columns.
    What do you mean by "order by"?
    Using an "ORDER BY" clause in a CTAS (in APEX or anywhare else) will have no effect on column order, which is determined by the order in which columns appear in the projection. It will affect the order in which rows are returned by that query, and it will not determine the order in which rows will be returned by querying the new table in the future.
    To change the column order the columns in the SELECT clause of the CTAS would have to be in a different order from those in the original table,

  • 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

  • Read from sql task and send to data flow task - [OLE DB Source [1]] Error: A rowset based on the SQL command was not returned by the OLE DB provider.

    I have created a execut sql task -
    In that, i have a created a 'empidvar' variable of string type and put sqlstatement = 'select distinct empid from emp'
    Resultset=resultname=0 and variablename=empidvar
    I have added data flow task of ole db type and I put this sql statement under sql command - exec emp_sp @empidvar=?
    I am getting an error.
    [OLE DB Source [1]] Error: A rowset based on the SQL command was not returned by the OLE DB provider.
    [SSIS.Pipeline] Error: component "OLE DB Source" (1) failed the pre-execute phase and returned error code 0xC02092B4.

    shouldnt setting be Result
    Set=Full Resultset as your query returns a resultset? also i think variable to be mapped should be of object type.
    Then for data flow task also you need to put it inside a ForEachLoop based on ADO.NET recordset and map your earlier variable inside it so as to iterate for every value the sql task returns.
    Also if using SP in oledb source make sure you read this
    http://consultingblogs.emc.com/jamiethomson/archive/2006/12/20/SSIS_3A00_-Using-stored-procedures-inside-an-OLE-DB-Source-component.aspx
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Short cut to run SQL under SQL Commands window

    Hi people
    what is the keyboard key to run the sql statements under SQL Commands windows in APEX. like in PL/SQL Developer its F8.
    Thanks

    Thanks dccase
    It works
    Appreciate ur help

  • In chrome I'm getting green double underline hyperlinks to ads.  How can I get rid of this without adding more junk to the computer?

    I have both safari and chrome, because I'm used to chrome.  The only extension I have is Google docs.  I started getting green double underline hyperlinks to ads.  How can I get rid of this without adding more junk to the computer?  People suggest programs to do it, but how do I know they won't make it worse?
    Is someone from Apple here and can answer?
    Thanks!

    You may have installed the "VSearch" trojan. Remove it as follows.
    Malware is always changing to get around the defenses against it. These instructions are valid as of now, as far as I know. They won't necessarily be valid in the future. Anyone finding this comment a few days or more after it was posted should look for more recent discussions or start a new one.
    Back up all data before proceeding.
    Step 1
    From the Safari menu bar, select
              Safari ▹ Preferences... ▹ Extensions
    Uninstall any extensions you don't know you need, including any that have the word "Spigot," "Trovi," or "Conduit" in the description. If in doubt, uninstall all extensions. Do the equivalent for the Firefox and Chrome browsers, if you use either of those.
    Reset the home page and default search engine in all the browsers, if it was changed.
    Step 2
    Triple-click anywhere in the line below on this page to select it:
    /Library/LaunchAgents/com.vsearch.agent.plist
    Right-click or control-click the line and select
              Services ▹ Reveal in Finder (or just Reveal)
    from the contextual menu.* A folder should open with an item named "com.vsearch.agent.plist" selected. Drag the selected item to the Trash. You may be prompted for your administrator login password.
    Repeat with each of these lines:
    /Library/LaunchDaemons/com.vsearch.daemon.plist
    /Library/LaunchDaemons/com.vsearch.helper.plist
    Restart the computer and empty the Trash. Then delete the following items in the same way:
    /Library/Application Support/VSearch
    /System/Library/Frameworks/VSearch.framework
    ~/Library/Internet Plug-Ins/ConduitNPAPIPlugin.plugin
    Some of these items may be absent, in which case you'll get a message that the file can't be found. Skip that item and go on to the next one.
    The problem may have started when you downloaded and ran an application called "MPlayerX." That's the name of a legitimate free movie player, but the name is also used fraudulently to distribute VSearch. If there is an item with that name in the Applications folder, delete it, and if you wish, replace it with the genuine article from mplayerx.org.
    This trojan is often found on illegal websites that traffic in pirated content such as movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect more of the same, and worse, to follow.
    You may be wondering why you didn't get a warning from Gatekeeper about installing software from an unknown developer, as you should have. The reason is that the Internet criminal behind VSearch has a codesigning certificate issued by Apple, which causes Gatekeeper to give the installer a pass. Apple could revoke the certificate, but as of this writing has not done so, even though it's aware of the problem. This failure of oversight has compromised both Gatekeeper and the Developer ID program. You can't rely on Gatekeeper alone to protect you from harmful software.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination  command-C. In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

  • Error at Data Flow Task [OLE DB Source [1]]: No column information was returned by the SQL command." error

    I have an .XLSX File that I am trying to Upload into SQL Server.  I use the Source as OLEDB Connection manager and pick OLDEB PROVIDER as MS OFFICE 12.0 ACCESS DATABASE ENGINE. In that I put this query but it gives the foll
    error when I run the SSIS Package.
    [OLE DB Source [1]] Error: No column information was returned by the SQL command.
    Query I use in DATA FLOW TASK  , IS SQL COMMAND:
    Select top 1 [Investor #],[Investor Name], CONVERT (VARCHAR(1000),Delegation)AS DELEGATION ,[Date Added],[Date Revised] from [EXCELSHEET1$]
    Any suggestion to fix this error? i have to do a convert since the excel datayype is DT_TEXT AND SQL TABLE DATATYPE is VARCHAR(1000)  SO Have to do this Convert.

    If the target table's column is not a BLOB/CLOB (e.g. NVARCHAR(MAX)) and you have text longer than the max value it will not fit into the target, if you are allowed you need to trim it and convert, otherwise sure you get the error as the target datatype
    is smaller. 
    Arthur My Blog

  • SQL*PLUS Verus using new Oracle10 xe   SQL commands window

    Can I run all manor of queries in SQL COMMAND as in sql*plus .Put another way
    does the new orcale 10 xe (SQL command window) have any restrictions at all in terms
    of code ?
    P.S. Up to now I think this DATABASE program is great.( still testing large files)
    Thanks
    Bob

    Great that's exactly the answer I was hoping to get, I am new to Oracle products
    but not new to SQL and find the new Oracle interface to be top notch compared to any
    "FREE" programs out there right now! I tried the free microsoft SQL server program
    and found almost no help or free tutorials like Oracle 10 xe has ( Way to go Oracle !)
    Thanks
    Bob

  • How to execute stored procedure in the SQL Commands page

    i'm oracle express edition newbie :) i have this stored procedure. it not belong to a package.
    create or replace procedure "LIST_MEMBERS"
    ("MEMBER_CUR" OUT SYS_REFCURSOR)
    is
    begin
    OPEN MEMBER_CUR FOR
    SELECT * FROM members;
    end;
    now, in the SQL Commands page, how to run the stored procedure and return the records. i do this:
    begin
    execute list_members();
    end;
    but i'm getting some errors. just need some immediate help :) thanks!!!

    Example of using a ref cursor:
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure open_cur(c IN OUT SYS_REFCURSOR) is
      2  begin
      3    open c for 'select rownum rn from dual connect by rownum <= 10';
      4* end;
    SQL> /
    Procedure created.
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    c     SYS_REFCURSOR;
      3    v_val NUMBER;
      4  begin
      5    open_cur(c);
      6    loop
      7      fetch c INTO v_val;
      8      exit WHEN c%NOTFOUND;
      9      dbms_output.put_line(v_val);
    10    end loop;
    11    close c;
    12* end;
    SQL> /
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    PL/SQL procedure successfully completed.
    SQL>

  • A rowset based on the SQL command was not returned by the OLE DB provider.

    Hi
    I am calling a stored procedure using ssis.
    i am creating a work table--temp in the procedure and using that to join and select columns from other tables.
    i am gettig the error
    [Positions [22612]] Error: A rowset based on the SQL command was not returned by the OLE DB provider.
    please help

    SET NOCOUNT ON 
    in the stored procedure and try again.
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • TS1424 i cannot play my videos or shows on itunes any more. i get the message saying "windows can check online for a solution to the problem" " i tunes has stopped working"

    i cannot play my videos or shows on itunes any more. i get the message saying "windows can check online for a solution to the problem" " i tunes has stopped working"

    Hi marymike,
    The crash signature is simalr to that mentioned in the thread: https://forums.adobe.com/thread/644139
    Please try the suggested steps mentioned and check.
    Regards,
    Rave

  • How to echo the SQL command in JDBC?

    When we use a PreparedStatement and execute query, is there a way to get the exact SQL command
    sent to the server without any '?' marks? That would be an aid in debugging. Or is such a facility server-pecific? I am using MySQL with JDBC.
    Thank you.

    Why I want to see the SQL command now is that I am getting a nagging SQLException in the following
    code. Would someone tell me why this code fails?
    //Database connection successful.
    //conn and pstmt are successfully created.
    //variables 'pid' and 'subfolder' are already evaluated, and confirmed that they have valid values
    int sub_id = 0;
    String myquery = null;
    ResultSet rs1 = null;
    try{
    myquery = "SELECT j15c_directory_id FROM j15t_directory WHERE (j15c_parent_id = ? AND j15c_name = ?)";
    pstmt = conn.prepareStatement(myquery);
    pstmt.setInt(1,pid);
    pstmt.setString(2,subfolder);
    rs1 = pstmt.executeQuery();
    rs1.next();
    sub_id =rs1.getInt("j15c_directory_id");
    catch(java.sql.SQLException e1){
    System.err.println("SQLException: " + e1.getMessage());
    The error message I'm getting is "Before start of result set ".

  • Open a command window and send some keystroke to the opened command window

    Hi All,
    I am trying to open command prompt and send some key stroke to that command prompt. Here I am using Robot to send keystroke. But the problem is, the keystrokes are not sent to the prompt. I guess I need to activate progamitically the command prompt to accept the keystrokes . Please find the code below ( as I did).
    try
    String command = "cmd.exe /c start";
    Process child = Runtime.getRuntime().exec(command);
    Robot robot = new Robot();
    Thread.sleep(5000);
    String lol = "indranil";
    for(int i=0;i<lol.length();i++)
    robot.keyPress(lol.charAt(i));
    int g = lol.length() - 1;
    robot.keyRelease(lol.charAt(g));
    catch (Exception e) {}
    I guess I am doing some mistake here while sending the keystroke/openning the command prompt. Can anyone please help me how can I open a command window and send some keystroke to the opened command window. I am in fix.
    Thanks,
    Indranil

    The first thing to do is read the API and examples for the Robot class.
    Also check out this thread with a similar discussion: [http://forums.sun.com/thread.jspa?threadID=5385677]
    The short spoonfed answer - keyPress() and keyReleaseI() do not take chars. Read up on KeyEvent

  • Can the SQL command be echoed in the Results area?

    It would be vary helpful to have the SQL command to be displayed in the Results area before the actual results are displayed.
    If this can be done, how?
    Jim

    Hi Jim,
    In the worksheet, try set echo on. Apparently it has worked since some fairly early SQL Developer versions:
    SET ECHO ON?
    Regards,
    Gary Graham
    SQL Developer Team

Maybe you are looking for

  • Problems Booting from External Drive

    I have a 2009 era Mac Mini (refurb) 2GHZ, 2GB RAM and 320GB internal hard drive and running Snow Leopard. I have been using a 1TB NewerTech miniStack V3 drive to boot from. Last night the computer froze up while watching a show on Hulu.com. Nothing w

  • How to install forms FMX to the server?

    FRM-99999 a network error occured, the client will not be able to continue. java.net.socketException:Connection reset by peer. I tried to setup forms 6.0 server w/ OAS 4.07 on NT 4 Sp3 plateform. Oracle client software is 8.0.5. Db backend on the oth

  • Place images, reassemble slices, layer issues

    I am creating a sprite of images I have in the bridge. I placed button images from the bridge.  I tried to merge the layers so there is only one layer for the sprite.  When I did the merge the images got locked onto the background layer and I can't m

  • HT201210 i cannot load the latest software on my iphone 4 3G

    i cannot load the latest software from itunes into my iphone 4 3G

  • Transferring possibly infected files from Windows to Mac

    Hi, I have recently bought a MacBook Pro, having moved onto it from Windows. However, I have many files that I need to transfer over, primarily photos and documents (i.e. Word and Excel). The problem is that the laptop likely had numerous viruses on