Syntax error when creating database

Not sure if this is the correct forum, but here goes..
Using a sample at:
Technet Link
I get a "Syntax error near GO" when I try to execute the following SQL Command.
USE master
GO
CREATE DATABASE testdb
ON
( NAME = testdb,
FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\testdb.mdf' )
GO
I am using a function to create this database.  It is a temporary database that gets recreated or altered frequently.
The code checks for SQL Server, gets it's version number in order to use the default SQL Server path.  If SQL Server isn't available, ACE / OLEDB is used to create and manage the database (this part works fine).
The code used to check for and create the database follows.
private Boolean CheckForSQLServer()
SqlConnection cnx = null;
Int32 dbExists = 1;
SqlCommand sql;
String SSData = String.Empty;
// Check for SQL Server. If it exists, use it.
String login = UserPrincipal.Current.UserPrincipalName;
login = login.Substring(0, login.IndexOf("@"));
try {
cnx = new SqlConnection(
String.Format("server={0};user={1};Trusted_Connection=Yes;", Prop.SQLConnection, login));
cnx.Open();
hasSQLServer = true;
} catch (Exception) {
hasSQLServer = false;
return true;
if (hasSQLServer) {
try {
String ServerVersion = cnx.ServerVersion;
String SSPath = String.Format(@"C:\Program Files\Microsoft SQL Server\MSSQL{0}.MSSQLSERVER\MSSQL\DATA\",
ServerVersion.Substring(0, ServerVersion.IndexOf('.')));
SSData = String.Format(
"USE master\nGO\nCREATE DATABASE {0}\nON\n( NAME = '{1}',\nFILENAME = '{2}{1}.mdf' )\nGO",
Prop.SQLDBName, Prop.SQLDBName, SSPath);
String s = String.Format(
"SELECT COUNT(*) FROM (SELECT DB_ID('{0}') AS DbID) t WHERE DbID IS NOT NULL", Prop.SQLDBName);
sql = new SqlCommand(s, cnx);
SqlDataReader sr = sql.ExecuteReader();
if (sr.Read())
dbExists = (Int32)sr[0];
sr.Close();
} catch (Exception) { }
if (dbExists == 0) {
try {
sql = new SqlCommand(SSData, cnx);
sql.ExecuteNonQuery();
} catch (Exception) { }
} else {
try {
sql = new SqlCommand(String.Format("drop database {0};", Prop.SQLDBName), cnx);
sql.ExecuteNonQuery();
sql = new SqlCommand(SSData, cnx);
sql.ExecuteNonQuery();
} catch (Exception) { }
cnx.Close();
return false;
Comparing the generated SQL string to sample E at the link above shows them to be identical except for the database name and file pathname, but the paths do exist although the files do not.
The SQL Exception occurs at the first
sql = new SqlCommand(SSData, cnx);
statement in the code.  I would think this can be done as a single string even though a .sql file is referenced in the article.
Andy

Works correctly in SQL Server 2014 Management Studio:
USE master
GO
CREATE DATABASE testdb
ON
( NAME = testdb,
FILENAME = 'F:\temp\testdb.mdf' )
GO
DROP DATABASE testdb
GO
Kalman Toth Database & OLAP Architect
SQL Server 2014 Database Design
New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

Similar Messages

  • Syntax error when creating a user-defined table type in SQL Server 2012

    Why am I getting a syntax error when creating a user-defined table type in SQL Server 2014?
    CREATE TYPE ReportsTableType AS TABLE 
    ( reportId INT
    , questionId INT
    , questionOrder INT );
    Results:
    Msg 156, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'AS'.

    Hope these posts could help, 
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/37a45a9a-ed8c-4655-be93-f6e6d5ef44be/getting-incorrect-syntax-while-creating-a-table-type-in-sql-server-2008-r2?forum=transactsql
    Regards, Dineshkumar,
    Please Mark as Answer if my post answers your question and
    Vote as Helpful if it helps you

  • Error when creating database

    when installing 9i server i couldn't create database and after installation i tried to create database using DBCA but same errors occured.
    it says null sid name error=2. and then says tns protocol problem.
    what should i do?

    Kim Gabrielsen (guest) wrote:
    : Hi,
    : I have tried to install O8 on Linux several times but all have
    : failed. I follow the doc written by Tom Bissett which I find
    very
    : informative on this subject.
    : I have the correct env setting, have created oracle user as
    : member of the dba group and the install program runs nicely
    until
    : it starts to create the database. It stops with an error
    message.
    : The log files look like this (excerpts):
    : CRDBORCL.LST
    : ORA-06413: Connection not open.
    : LCC-00161: Message 161 not found; product=SVRMGR; facility=MGR
    : ORA-06413: Connection not open.
    : create database "ORCL"
    : ORA-03114: not connected to ORACLE
    : ORA-06413: Connection not open.
    : which is the same results I see if I invoke svrmgr manually
    : and tries to connect as 'internal'. BTW srvmgr prompts me for a
    : password even though I'm logged on as 'Oracle' which is a
    member
    : of DBA.
    : INSTALL.LOG
    : - Entering database actions section.
    : - Creating initORCL.ora file
    : - Creating crdb2ORCL.sql database catalog and file
    creation
    : script
    : - ERROR: The 'CREATE DATABASE' statement for the ORCL
    : database failed.
    : egrep failed to find 'ORA-' error in the file:
    : /u01/app/oracle/admin/ORCL/create/crdbORCL.lst
    : I hope someone can help 'cause I'm stock here...
    : Best regards
    : Kim Gabrielsen
    If you followed the instructions on setting the shared memory
    parameters you may have a problem.
    In the 'shmparam.h' file set SHMMAX to something smaller than 4G.
    I just set mine to 2G or 0x7FFFFFFF and now it works fine.
    I have done the Oracle 8.0.5 installation twice now on 2
    different machines with success(1 Compaq Proliant 1500 -
    RH5.2/2.0.36 kernel and 1 GW2K - RH5.2/2.2.1 kernel) I ran into
    several problems along the way but all problems were solvable.
    Mark
    null

  • Syntax error when creating input-ready query

    Hi,
    When creating an input-ready query, I set the key-figure to 'Data can be changed by user entries or Planning Functions' in the Planning Properties in the query designer.
    When I execute the query, I get the following error:
    Syntax Error in : CL_RSR_RRK0_KEYFIGURE
    In se24, the class has a syntax error in its Constructor method.
    The error is not occuring when I change the Planning property to 'Data Cannot be changed' or 'Data can be changed via Planning Functions'.
    Has anyone encountered such an error. If yes, how to proceed further?
    Anything do with the the ABAP Patches. Currently I am in Patch13.
    Thanks,
    Balaji

    Hi,
    Plz apply the notes 1042924 and 1043103.After appling the notes regenerate the
    query.
    This should solve the error.
    Regards,
    Srikanth.

  • JDeveloper shows a fatal error when create Database or UML Diagrams

    My Platform is Windows 7 x64 with JDeveloper 11.1.2.3
    JDeveloper shows an error when I do this:
    1) Create a new Database Diagram.
    2) Create a Table in this Database Diagram.
    3) Delete the Database Diagram.
    4) Try to create a new Database Diagram again.
    5) JDeveloper shows a Fatal Error, and the ADF Model Project still to be corrupt after restart JDeveloper.
    The same happens with UML diagrams.
    Do you know any solution for that?
    Best Regards,

    I found the reason of this error.
    This error happens, if you store your ADF Application Project in a Network Drive, if you store your projects in local drives all works fine.
    Regards,

  • SQL syntax error when creating record insertion form

    Good day,
    I was hoping someone could help me.  I am trying to create a record insertion form on a website to insert data into a database table.  When attempting to create the form, I am getting the following error: 
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' Organization, Office, Department, Phone, EmailAddress, JobTitle, `OfficialMaili' at line 1
    Not sure what is going on.  I am running windows 8 and DW cs5 w/ MYSQL.  I am testing on a local server prior to pushing to the remote server.
    Thank you for your assistance and please advise any code you would like me to send.

    Here is all the code from this particular webpage.  I apologize, I am too stupid to realize which parts are SQL vice PHP vice HTML:
    <?php require_once('Connections/group4.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
       if (PHP_VERSION < 6) {
         $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
         case "text":
           $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
           break;   
         case "long":
         case "int":
           $theValue = ($theValue != "") ? intval($theValue) : "NULL";
           break;
         case "double":
           $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
           break;
         case "date":
           $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
           break;
         case "defined":
           $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
           break;
       return $theValue;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
       $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
       $insertSQL = sprintf("INSERT INTO individual (Grade, LastName, FirstName, M.I., Organization, Office, Department, Phone, EmailAddress, JobTitle, `OfficialMailing Address`, Citizenship, Designation, IATrainingComplete, IADate) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                            GetSQLValueString($_POST['Grade'], "text"),
                            GetSQLValueString($_POST['LastName'], "text"),
                            GetSQLValueString($_POST['FirstName'], "text"),
                            GetSQLValueString($_POST['MI'], "text"),
                            GetSQLValueString($_POST['Organization'], "text"),
                            GetSQLValueString($_POST['Office'], "text"),
                            GetSQLValueString($_POST['Department'], "text"),
                            GetSQLValueString($_POST['Phone'], "double"),
                            GetSQLValueString($_POST['EmailAddress'], "text"),
                            GetSQLValueString($_POST['JobTitle'], "text"),
                            GetSQLValueString($_POST['OfficialMailing_Address'], "text"),
                            GetSQLValueString($_POST['Citizenship'], "text"),
                            GetSQLValueString($_POST['Designation'], "text"),
                            GetSQLValueString($_POST['IATrainingComplete'], "text"),
                            GetSQLValueString($_POST['IADate'], "text"));
      mysql_select_db($database_group4, $group4);
       $Result1 = mysql_query($insertSQL, $group4) or die(mysql_error());
      $insertGoTo = "index.php";
       if (isset($_SERVER['QUERY_STRING'])) {
         $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
         $insertGoTo .= $_SERVER['QUERY_STRING'];
       header(sprintf("Location: %s", $insertGoTo));
    mysql_select_db($database_group4, $group4);
    $query_rsIndividual = "SELECT * FROM individual ORDER BY IndividualNumber ASC";
    $rsIndividual = mysql_query($query_rsIndividual, $group4) or die(mysql_error());
    $row_rsIndividual = mysql_fetch_assoc($rsIndividual);
    $totalRows_rsIndividual = mysql_num_rows($rsIndividual);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Contact Us</title>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    .header {
      font-size: 36px;
      text-decoration: underline;
    .quote {
      font-size: 18px;
      font-style: italic;
    .tablethisone {
      margin: 5px;
      padding: 25px;
      border: medium none #000;
      text-align: center;
    </style>
    </head>
    <body>
    <p><img src="Images/EGA.png" width="227" height="222" alt="EGA" /><span class="header">SAAR Tracking System
    </span></p>
    <ul id="MenuBar1" class="MenuBarHorizontal">
       <li><a href="index.php">Home</a>  </li>
       <li><a href="search.php">Search</a></li>
       <li><a href="contact.php">Contact Us</a>  </li>
    </ul>
    <p> </p>
    <p>PRIVACY ACT STATEMENT</p>
    <p>Executive Order 10450, 9397; and Public Law 99-474, the Computer Fraud and Abuse Act.
       To record names, signatures, and other identifiers for the purpose of validating the trustworthiness of individuals requesting
       access to Department of Defense (DoD) systems and information. NOTE: Records may be maintained in both electronic
       and/or paper form.</p>
    <p> </p>
    <p> </p>
    <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
       <table align="center">
         <tr valign="baseline">
           <td nowrap="nowrap" align="right">Grade:</td>
           <td><input type="text" name="Grade" value="" size="32" /></td>
         </tr>
         <tr valign="baseline">
           <td nowrap="nowrap" align="right">LastName:</td>
           <td><input type="text" name="LastName" value="" size="32" /></td>
         </tr>
         <tr valign="baseline">
           <td nowrap="nowrap" align="right">FirstName:</td>
           <td><input type="text" name="FirstName" value="" size="32" /></td>
         </tr>
         <tr valign="baseline">
           <td nowrap="nowrap" align="right">M.I.:</td>
           <td><input type="text" name="MI" value="" size="32" /></td>
         </tr>
         <tr valign="baseline">
           <td nowrap="nowrap" align="right">Organization:</td>
           <td><input type="text" name="Organization" value="" size="32" /></td>
         </tr>
         <tr valign="baseline">
           <td nowrap="nowrap" align="right">Office:</td>
           <td><input type="text" name="Office" value="" size="32" /></td>
         </tr>
         <tr valign="baseline">
           <td nowrap="nowrap" align="right">Department:</td>
           <td><input type="text" name="Department" value="" size="32" /></td>
         </tr>
         <tr valign="baseline">
           <td nowrap="nowrap" align="right">Phone:</td>
           <td><input type="text" name="Phone" value="" size="32" /></td>
         </tr>
         <tr valign="baseline">
           <td nowrap="nowrap" align="right">EmailAddress:</td>
           <td><input type="text" name="EmailAddress" value="" size="32" /></td>
         </tr>
         <tr valign="baseline">
           <td nowrap="nowrap" align="right">JobTitle:</td>
           <td><input type="text" name="JobTitle" value="" size="32" /></td>
         </tr>
         <tr valign="baseline">
           <td nowrap="nowrap" align="right">OfficialMailing Address:</td>
           <td><input type="text" name="OfficialMailing_Address" value="" size="32" /></td>
         </tr>
         <tr valign="baseline">
           <td nowrap="nowrap" align="right">Citizenship:</td>
           <td><input type="text" name="Citizenship" value="" size="32" /></td>
         </tr>
         <tr valign="baseline">
           <td nowrap="nowrap" align="right">Designation:</td>
           <td><input type="text" name="Designation" value="" size="32" /></td>
         </tr>
         <tr valign="baseline">
           <td nowrap="nowrap" align="right">IATrainingComplete:</td>
           <td><input type="text" name="IATrainingComplete" value="" size="32" /></td>
         </tr>
         <tr valign="baseline">
           <td nowrap="nowrap" align="right">IADate:</td>
           <td><input type="text" name="IADate" value="" size="32" /></td>
         </tr>
         <tr valign="baseline">
           <td nowrap="nowrap" align="right"> </td>
           <td><input type="submit" value="Insert record" /></td>
         </tr>
       </table>
       <input type="hidden" name="MM_insert" value="form1" />
    </form>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p>Disclosure of this information is voluntary; however, failure to provide the requested information may impede, delay or
    prevent further processing of this request.</p>
    <p class="quote">&quot;Be polite, be professional, but have a plan to kill everybody you meet&quot; General James Mattis</p>
    <p> </p>
    <script type="text/javascript">
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    </script>
    </body>
    </html>
    <?php
    mysql_free_result($rsIndividual);
    ?>

  • Error when creating database after oracle 8.1.6 is installed.

    Hi,
    I used Redhat 6.1 and installed Oracle 8.1.6. I think the oracle software is installed successfully. However, when I attempted to create the database by Database Configuration Assistant, I got an error message when I click on 'start' button.
    The message is ORA-01031: insufficient privileges and ORA-01012: not logged.
    How can I solve the problem to create my first database?
    Thanks a lot.
    Regards,
    Tony

    Make sure svrmgrl still works.
    To startup a database, you must login as oracle, and oracle must also be a member of the dba group.
    Also, make sure you set the following environment variables: $ORACLE_HOME, $ORACLE_SID.
    Good Luck!
    null

  • Syntax error when creating Overwrite method - implicit enhancement

    Hi,
    I am working at a customer site, and need to implicitly enhance certain methods. I would like to create an Overwrite Method for the following class/method:
    CL_CRM_MKTDEF_DEFAULTS_PERSIST -> HEADER_WITH_KEY_EXITS_IN_DBASE( )
    I proceeded in the following way:
    Open class CL_CRM_MKTDEF_DEFAULTS_PERSIST in class builder (SE24)
    Select menu path Class -> Enhance
    Create, or select, enhancement implementation ZCRM_MKTDEF_PRD
    Select method HEADER_WITH_KEY_EXITS_IN_DBASE, select menu path Edit -> Enhancement Operation -> Add Overwrite Method
    Click on u201CNavigation to Overwrite Exitu201D
    After navigating to the Overwrite Exit, I click on "Check" to perform a syntax check (notice, I have not yet implemented any code. Everything so far has been done by the wizard).
    Now, I get the following error:
    Enhancement Implementation ZCRM_MKTDEF_PRD
    Unable to interpret "IS_DEFAULTS_ATTR". Possible causes: Incorrect
    spelling or grammar.
    When I create Overwrite methods for any other method in the same class, the same error does NOT occur. As far as I can tell, there is nothing special about this method that should cause this error.
    I would greately appreciate any help that any of you could give me on this one.
    thank you and best regards,
    - Marius
    PS: Here is my code (which was generated after I followed the outlined steps above) for your reference:
    CLASS LCL_ZCRM_MKTDEF_PRD DEFINITION.
    PUBLIC SECTION.
    CLASS-DATA OBJ TYPE REF TO LCL_ZCRM_MKTDEF_PRD.
    DATA CORE_OBJECT TYPE REF TO CL_CRM_MKTDEF_DEFAULTS_PERSIST .
    INTERFACES  IOW_ZCRM_MKTDEF_PRD.
      METHODS:
       CONSTRUCTOR IMPORTING CORE_OBJECT
         TYPE REF TO CL_CRM_MKTDEF_DEFAULTS_PERSIST OPTIONAL.
    ENDCLASS.
    CLASS LCL_ZCRM_MKTDEF_PRD IMPLEMENTATION.
    METHOD CONSTRUCTOR.
      ME->CORE_OBJECT = CORE_OBJECT.
    ENDMETHOD.
    METHOD IOW_ZCRM_MKTDEF_PRD~HEADER_WITH_KEY_EXITS_IN_DBASE.
    *" Declaration of Overwrite-method, do not insert any comments here please!
    *"methods HEADER_WITH_KEY_EXITS_IN_DBASE
    *"  importing
    *"    !IS_DEFAULTS_ATTR type CRMS_MKTDEF_DEFAULTS_DATA
    *"  returning
    *"    value(EV_EXISTS) type CRMT_BOOLEAN
    *"  exceptions
    *"    FAILURE .
    ENDMETHOD.
    ENDCLASS.

    Note 1256889

  • Error when creating database instance

    Hi,
    When trying to install R3 4.7, I came to a error while system creating tablespaces. The log is as follows.
    TRACE      [iaxxcwalker.cpp:296]
               CDomWalker::processStep()
    Executing installation step SAPSYSTEM_DB|ind|ind|ind|ind|ind|0|SAPSYSTEM|ind|ind|ind|ind|ind|0|SAPComponent|ind|ind|ind|ind|ind|0|DatabaseServer|ind|ind|ora|ind|ind|0|DatabaseServerOra|ind|ind|ora|ind|ind|0|TablespacesAndRollbacksegments|ind|ind|ora|ind|ind|0|DatabaseTablespaces|ind|ind|ora|ind|ind|0|OraDatabaseTablespaces2|ind|ind|ind|ind|ind|0|checkFreeDiskSpace
    TRACE      [iaxxgenimp.cpp:775]
               showDialog()
    waiting for an answer from gui
    Is it a problem of disk space? I have 90G.I think it is enough for 470. How should I proceed?
    Thanks and regards,
    Larry

    Hi Beck,
    Thanks for your reply. I have solved this issue myself. But I come into another issue that during R/3 database reload, system terminate with a message "File SAPSSEXC.012 is missing."
    It is very strange cause I only have SAPSSEXC.011 in my folder /51030584_4/EXPORT4/DATA/. Do you have this file?
    Thanks and regards,
    Larry

  • Syntax Error after creating enhancements for subroutine

    Problem:
    Creating enhancement sections gives a syntax error when creating enhancement options and implementations for a subroutine and then ceating enhancement options and implementations for the call to that same subroutine.
    <p>
    Syntax Error:
    "Different number of parameters in FORM and PERFORM (routine: SET_LAYOUT, number of formal parameters: 2, number of actual parameters: 1)
    </p>
    <p>
    Here's the following scenario:
    </p>
    <p>
    A subroutine is defined in a program.
    The subroutine is called within the same program.
    </p>
    <p>
    I then executed these steps:
    <br>     1. Defined an enhancement section around the subroutine definition
    <br>     2. Defined an enhancement section around the subroutine call.
    <br>     3. Implemented the enhancement section around the subroutine definition and add an additional parameter.
    </p>
    <p>
         Currently, this gives a syntax error as expected, since the call to the subroutine needs 1 more parameter.
    </p>
    <p>
         4. Implemented the enhancement section for the subroutine call.  I change the call in the implementation so it passes the new parameter.
    </p>
    <p>
    A syntax check to this gives an error.  The syntax checker is not only checking the new implementation, but also the original subroutine that should have been overwritten.
    </p>
    <p>
    The enhancement sections use the same enhancement spot, and the enhancement implementations use the same implementation.
    </p>
    <p>
    I tried various combinations of using different enhancement spots and/or implementations, but all give the same syntax error.  I tried separating the subroutine in a different include and  retried my testing, but it still gave the same syntax error.
    </p>
    <p>
    Here's the sample code I first created to try troubleshooting the problem:
    </p>
    <p>
    <pre>
    ENHANCEMENT-SECTION ZEP_Z_MICHAEL_02 SPOTS ZES_Z_MICHAEL .
         PERFORM set_layout
              CHANGING
              wa_layout.
    END-ENHANCEMENT-SECTION.
    $$-Start: ZEP_Z_MICHAEL_02----
    $$
    ENHANCEMENT 2  ZEI_TEST_SECTIONS.
         "inactive version
         PERFORM set_layout
         using 'X'
              CHANGING
              wa_layout.
    ENDENHANCEMENT.
    $$-End:   ZEP_Z_MICHAEL_02----
    $$
    ENHANCEMENT-SECTION ZEP_Z_MICHAEL_01 SPOTS ZES_Z_MICHAEL STATIC .
    FORM set_layout
    CHANGING p_wa_layout TYPE slis_layout_alv.
    p_wa_layout-zebra = 'X'.
    wa_layout-no_colhead = 'X'..
    p_wa_layout-colwidth_optimize ='X'.
    wa_layout-window_titlebar = 'Woot'.
    ENDFORM. "set_layout
    END-ENHANCEMENT-SECTION.
    $$-Start: ZEP_Z_MICHAEL_01----
    $$
    ENHANCEMENT 1  ZEI_TEST_SECTIONS.
         "inactive version
    FORM set_layout
    using p_test type boolean
    CHANGING p_wa_layout TYPE slis_layout_alv.
    p_wa_layout-zebra = 'X'.
    wa_layout-no_colhead = 'X'..
    p_wa_layout-colwidth_optimize ='X'.
    wa_layout-window_titlebar = 'Woot'.
    ENDFORM. "set_layout
    ENDENHANCEMENT.
    $$-End:   ZEP_Z_MICHAEL_01----
    $$
    </pre>
    </p>
    <p>
    Please let me know if you think I am doing something wrong. 
    </p>
    <p>
    Thanks, <br>
    Mike
    </p>
    Edited by: Michael Herman on Mar 8, 2010 8:11 PM

    Yes, Sandra.  That is what did and it worked with no syntax errors!
    I'm not sure if this is getting off topic or not, but the SAP documentation(taken from the SAP help after pressing F1 on the keyword static in ERP6) seems misleading:
    "The STATIC addition is intended for the enhancement of data declarations, while the statement ENHANCEMENT-POINT without the STATIC addition is designed for the enhancement of executable coding."
    I would think the enhancement section ZEP_Z_MICHAEL_02 would fall under the category of executable code, while the enhancement section ZEP_Z_MICHAEL_01 would fall under the category of declarative code.
    Unfortunately, all the SAP enhancement sections I come accross are dynamic.  The SAP help explains the reasoning for this:
    "In contrast to the statement ENHANCEMENT-POINT, the addition STATIC of the statement ENHANCEMENT-SECTION can only be used with maximum caution for changes of data declarations, because a replacement and no completion is carried out. Especially application development within SAP should not use the addition STATIC at all with ENHANCEMENT-SECTION as the change will be active in the entire customer system. "
    I do not know what the word "completion" means in the previous quote, so I can't determine why it would matter.  Regardless, if a developer wanted to change a standard subroutine declaration, they would also have to mod an enhancement section to change it to static.  This seems to defeat the purpose of using enhancements, but maybe this scenario is not what enhancements were intended for.

  • Sntax error when creating a temp table

    Hi All,
    I get a syntax error when I try to create a  temporary table using the below sql statement.
    create global temporary column table prc as table precipitation;
    The  table precipitation exists in the database under my ID.
    Could anyone please let me know what is wrong with the above statement.
    Thanks,
    Goutham

    Try:
    create global temporary column table prc like precipitation;
    or
    create global temporary column table prc as (select * from precipitation);
    Cheers,
    Jody
    (HANA SQL Reference Manual:  https://websmp201.sap-ag.de/~sapidb/011000358700000604922011)

  • Error while creating database in classic appln

    Hi All,
    I am getting this error while creating database in classic application.
    com.hyperion.planning.olap.EssbaseException: Failed to create database, error code [%s] (1013221).
    Can anyone please let me know why I am getting it?
    Thanks in advance

    Can you check for a more specific error code in the Application log? There can be various reasons for this:
    1. For data storage and binary installation, Essbase supports the use of any disk array device mounted with a local file system interface (for example, NTFS, HPFS, JFS, VxFS, and UFS). A disk array mounted using NFS or CIFS is not supported.Use any disk array device mounted with a local file system interface (for example, NTFS, HPFS, JFS, VxFS, and UFS).
    2. Error occurs when deploy Planning application with double byte enabled. When the plan name is changed to English, deploy will be successful. This issue can be fixed by setting Correct Essbase ESSLANG system value.
    3. The Essbase User that creates the application and DB folders has default ACL rw-rw-rw which does not allow the essbase app to create files inside the folder.
    HTH-
    Jasmine.

  • Vehicle Scheduling Error:Error when creating transport structures in live C

    HI Gurus,
    We have one background job defined for Vehicle scheduling, which shows completed successfully but in log it says that :
    : Error when creating transport structures in liveCache and Not possible to schedule shipment in the planning horizon.
    My planning horizon is for 90 days from current date and demand horizon is for 30 days.
    I have checked the VS profile and i dont find any problem with profile.
    Can you please help me in finding what exaclty went wrong
    Thanks,
    AMol

    Try This..
    1. Open the crystal client on your local machine and import that particular report.
    2. Do Database -> Verify Database. Then refresh the report on your PC and make sure that it returns data as expected.
    3. Export it back to repository and try scheduling it again. You can verify through CMC for Crystal Reports under " Database Configuration" property to make sure it points to the right ODBC.
    Let us know.

  • Problem when creating Database (Database, OS and hardware Configuraiton included)

    Problem when creating Database:
    Below are the problems, which I faced during creation of database. I have mentioned both the problem separately. Plus the log file maintained by Oracle during installation. It might help in diagnosing the error. Plus a little conclusion with I turned up to.
    There are two problems, when creating database with Oracle Database Assistant. One when creating pre tuned database from CD. And second when creating customized database giving options your self.
    Problem # 1:
    When creating pre tuned database from CD. The process of creating Database is 90 % complete and is at step # 3 Initializing Database. It gives error ORA-03113: end-of-file on communication channel.
    I searched following oracle help for this problem.
    ORA-03113: end-of-file on communication channel
    Cause: An unexpected end-of-file was processed on the communication channel. The problem could not be handled by the Net8, two-task software. This message could occur if the shadow two-task process associated with a Net8 connect has terminated abnormally, or if there is a physical failure of the interprocess communication vehicle, that is, the network or server machine went down.
    Action: If this message occurs during a connection attempt, check the setup files for the appropriate Net8 driver and confirm Net8 software is correctly installed on the server. If the message occurs after a connection is well established, and the error is not due to a physical failure, check if a trace file was generated on the server at failure time. Existence of a trace file may suggest an Oracle internal error that requires the assistance of customer support.
    Conclusion:
    What I conceive from this problem and the help available is that, I have to install NET8 again. But I am not sure about the solution, please tell me whether I am rite or not.
    Problem # 2:
    When creating database with custom option. The process of creating Database is 2 % complete and is at step # 2 Creating Database Files. It gives error ORA-12571: TNS:packet writer failure.
    I searched following oracle help for this problem.
    ORA-12571: TNS:packet writer failure
    Cause: An error occurred during a data send.
    Action: Not normally visible to the user. For further details, turn on tracing and re-execute the operation. If error persists, contact Worldwide Customer Support.
    Conclusion:
    What I conceive from this problem and the help available is that, I have to install NET8 again. But I am not sure about the solution, please tell me whether I am rite or not.
    Log File Showing Error :
    Result code for launching of configuration tool is 0
    Launched configuration tool Oracle Database Configuration Assistant
    Command which is being spawned is C:\Program Files\Oracle\jre\1.1.7\bin/jrew.exe -Duser.dir=d:\oracle\ora81\assistants\dbca\jlib -classpath ";C:\Program Files\Oracle\jre\1.1.7\lib\rt.jar;C:\Program Files\Oracle\jre\1.1.7\lib\i18n.jar;d:\oracle\ora81\jlib\ewt-3_3_6.jar;d:\oracle\ora81\jlib\share-1_0_8.jar;d:\oracle\ora81\jlib\swingall-1_1_1.jar;d:\oracle\ora81\assistants\dbca\jlib\dbassist.jar;d:\oracle\ora81\assistants\jlib\jnls.jar;d:\oracle\ora81\assistants\jlib\acc.jar;d:\oracle\ora81\jlib\help-3_1_8.jar;d:\oracle\ora81\jlib\ice-4_06_6.jar;d:\oracle\ora81\jlib\netcfg.jar;" DBCreateWizard -progress_only -responseFile NO_VALUE -createtype seed -numusers NO_VALUE -apptype NO_VALUE -cartridges NO_VALUE -options NO_VALUE -demos NO_VALUE -seedloc d:\oracle\ora81\starterdb -sid ora8i -orabase d:\oracle -clususer NO_VALUE -cluspswd Protected value, not to be logged -nodeinfo NO_VALUE -gdbName ora8i
    Invalid Exit Code. The following result code will be used for configuration tool: 1
    Configuration tool Oracle Database Configuration Assistant failed
    The datafiles will be copied from the CD to d:\oracle\oradata\ora8i. The Oracle Database Configuration Assistant will begin creating the database.
    An Oracle database will be created for you. The database name will be ora8i. The system identifier for the database will be ora8i. The password for the INTERNAL account will be ******, the SYS account will be change_on_install and the SYSTEM account will be manager.
    Log File of Installation:
    The above code is a part of the log file, which is generated by Oracle installer at C:\Program Files\Oracle\Inventory\Log\..
    I just pasted the part of code, highlighted is the code showing error with Oracle Database Configuration Assistant.
    Software & Hardware Configuration are as follow:
    Software:
    Database
    Oracle 8.1.7.0.0 (Oracle8i)
    Operating System
    Microsoft Windows 2000
    5.00.2195
    Service Pack 2
    Hardware:
    x86 Family 6 Model 8 stepping
    10
    AT/AT COMPITABLE
    260,400 KB RAM

    Dont't worry about that. Before you
    create a table(or view), it is wise to
    drop the table(or view) with the same name.
    If the name doesn't exist, of course there
    is an error message. See the following script:
    -------------------begin-----------
    drop table students cascade constraints;
    create table students (
    sid varchar2(5),
    fname varchar2(20),
    lname varchar2(20) not null,
    minit char,
    primary key (sid));
    --------------end-----------------
    Good day!
    null

  • Problem when creating Database:

    There are two problems, which I faced during creation of database. When creating database with Oracle Database Assistant. One when creating pre tuned database from CD. And second when creating customized database giving options your self.
    Problem # 1:
    When creating pre tuned database from CD. The process of creating Database is 90 % complete and is at step # 3 Initializing Database. It gives error ORA-03113: end-of-file on communication channel.
    I searched following oracle help for this problem.
    ORA-03113: end-of-file on communication channel
    Cause: An unexpected end-of-file was processed on the communication channel. The problem could not be handled by the Net8, two-task software. This message could occur if the shadow two-task process associated with a Net8 connect has terminated abnormally, or if there is a physical failure of the interprocess communication vehicle, that is, the network or server machine went down.
    Action: If this message occurs during a connection attempt, check the setup files for the appropriate Net8 driver and confirm Net8 software is correctly installed on the server. If the message occurs after a connection is well established, and the error is not due to a physical failure, check if a trace file was generated on the server at failure time. Existence of a trace file may suggest an Oracle internal error that requires the assistance of customer support.
    Conclusion:
    What I conceive from this problem and the help available is that, I have to install NET8 again. But I am not sure about the solution, please tell me whether I am rite or not.
    Problem # 2:
    When creating database with custom option. The process of creating Database is 2 % complete and is at step # 2 Creating Database Files. It gives error ORA-12571: TNS:packet writer failure.
    I searched following oracle help for this problem.
    ORA-12571: TNS:packet writer failure
    Cause: An error occurred during a data send.
    Action: Not normally visible to the user. For further details, turn on tracing and re-execute the operation. If error persists, contact Worldwide Customer Support.
    Conclusion:
    What I conceive from this problem and the help available is that, I have to install NET8 again. But I am not sure about the solution, please tell me whether I am rite or not.

    user563502 wrote:
    I am working on Solaris 8. What is Alert_SID.log? where can I find it?
    ThanksFor the responsible of the upgrade of Oracle database, not even know what Alert log is?
    to be honest with you, this is not your work.

Maybe you are looking for