Help! Changing attachment path in SQL database

Changing paths in the dbo.dlnk table isn't too difficult, but I came accross something that has me stumped.
Rather than a straight forward path such as \\servername\documents\ there are many that have a URL in the path such as http://servername/exponline/attachmentframe.jsp?filename=83089.pdf&fullpath=%5C%5Cservername%5Cimagetool%5Carchive%5Chce%5C78%5C83089.pdf&dk=h8Tjf4FcM7Km%2BpwH637w6w%3D%3D
Does anyone have a sql script that will filter out the url crud and leave a simple path.
You can see the path in there, it's \\servername\imagetool\archive\hce\78\5C83089.pdf

SELECT SUBSTRING(REPLACE(SUBSTRING(@path,
PATINDEX('%fullpath=%', @path) + 9,
255), '%5c', '\'), 1,
PATINDEX('%&dk=%',
REPLACE(SUBSTRING(@path,
PATINDEX('%fullpath=%',
@path) + 9, 255),
'%5c', '\')) - 1) AS [absolute_path]
,[description]
,[master_key]
,[parent_key]
,[cr_external_key]
INTO #temp
FROM ATTACHMENT_PATHS
UPDATE attachment_paths
SET ATTACHMENT_PATHS.absolute_path = #temp.absolute_path
FROM ATTACHMENT_PATHS
INNER JOIN #temp ON ATTACHMENT_PATHS.master_key = #temp.master_key
WHERE ATTACHMENT_PATHS.absolute_path LIKE '%/exponloine/%'

Similar Messages

  • How to attach/restore the sql database/file extension (*.File)

    I took backup the database long back ago. Now I
    am unable to attach/restore the sql database/file extension (*.File). I
    have the file type called (*.File) which i need to attach/restore. Can anyone tell me what's are the steps
    taken to do this? 
    Thank in advance.

    Database
    name-->Right Click-->Tasks-->Restore-->Database-->Select "Device" radio button-->Click device Path button-->Click "ADD" button --> I tried with "All Files(*)"--> then i selected my database-->ok-->ok-->ok -->
    then i am getting below error. 
    I am unable to post image. 
    "Restore of database 'Databasename' failed. (microsoft.sqlserver.management.relationalenginetasks)"
    Additional Information:
    System.Data.SqlClient.SqlError: The database was backed up on a server running version 8.00.0194. That version is incompatible with this server, which is running version 11.00.2100. Either
    restore the database on a server that supports the backup, or use a backup that is compatible with this server. (Microsoft.SqlServer.SmoExtended).
    Can
    you please help me to solve this error.
    Thanks,
    Laxmi.

  • Changing installation PATH on SQL Server 2005 with SAP DVD

    Hi experts,
    i would like to install SQL Server 2005 delivered by SAP on another disk, for example D: instead of C:\Program files\
    i read the note 363018 but there's no solution to my problem.
    Thanks in advanced for your help.
    Pascal.

    Hi Markus,
    yes, that's what i have expected but i m not good enought to find the changement to do.
    Am i allowed to post the script?
    Thanks.

  • Help with inserting values to sql database

    Hello everyone I am having this problem with how to fill my values in my sql statement, if you look below you will notice i have set up the values to be the length of the arr (arrayList).
    could someone please let me now how i should put there values in.
    thanks for yr time
    piper3
      try {
                                                    String data = "jdbc:odbc:myProject";
                                                        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                                                        Connection con = DriverManager.getConnection(data,"","");
                                                 StringBuffer sb = new StringBuffer();
                                                 Iterator it1 = arr.iterator();
                                                 while (it1.hasNext())
                                                      if (sb.length() > 0)
                                                           sb.append(",");
                                                           sb.append(it1.next());
                                                      //takes the items of the arInterim
                                                      //int iCountInterim = arInterim.size();
                                                      int er = arr.size();
                                                      String sInterim = new String();
                                                      String sql = new String();
                                                      for(int i2 = 0; i2 < er; i2++){
                                                           sInterim = sInterim + sQuestion;
                                                           if(i2 < (er-1)){
                                                                sInterim = sInterim + sComma;
                                                           sql = "INSERT into Ben (" + sb.toString() + ") values (" + sInterim + ")";
                                                           System.out.println(sql);
                                                           PreparedStatement prepStmt = con.prepareStatement(sql);
                                                           /*prepStmt.setString(1, "hello");
                                                           prepStmt.setString(2, "hi");
                                                           prepStmt.setString(3, "bye");
                                                           prepStmt.executeUpdate();
                                                           prepStmt.close();*/
                                                      con.close();               
                                                 } catch (Exception e1) {
                                                             System.err.println("Got an exception! ");
                                                             System.err.println(e1.getMessage());
                                                      //System.out.println();//.size());//tempkey+"\n"+tempvalue);

    you should write a prepared statement like this:
    PreparedStatement updateSales = con.prepareStatement(
    "UPDATE COFFEES SET SALES = ? WHERE COF_NAME LIKE ?");
    where "?" is a placeholder for the values you want to use.
    Then later when you want to actually update your database, first set the placeholders to your values (stored in your array for example) using a statement like this:
    updateSales.setString(2, "Colombian");
    //sets the 2. placeholder in the statement to the value "Colombian"
    after having set all placeholders to a specific value, execute your statement:
    updateSales.executeUpdate();
    your code should like:
    sql = "INSERT into Ben values (?,?,?)";
    PreparedStatement prepStmt = con.prepareStatement(sql);
    prepStmt.setString(1, "hello");
    prepStmt.setString(2, "hi");
    prepStmt.setString(3, "bye");
    prepStmt.executeUpdate();
    prepStmt.close();
    HTH
    Christine

  • How to connect sql database with Flash

    Dear Friends,
    Iam working on a quessinarie (assesment) for elearning software. i want to connect sql database with flash and save my records in back end like add, delete, modification of student result and details.
    Kindly help me to connect the sql database. or dot net server. I know how to connect PHP and mysql. But my client dont want php. only sql database and do the add, del, modificaiton.
    Thanks in advance,
    Syed Abdul Rahim

    unfortunately no, i do not know ASP well enough to give any code advice, other than the basic concept:  make a request on a server-side script (such as ASP) via URLLoader - the script receives variable values (if required), runs the DB queries you wish to invoke, and 'returns' the results - pick them up in the URLVariables class via the event handler in Flash and assign them to local properties if needed, etc.
    there are quite a few threads that you could find more specific information on the ASP side, here and elsewhere around the net.

  • Help! Need to generate SQL script file in every build of every changes in database project on TFS

    Hi everyone,
                I want to accomplish a task in TFS that I need to auto generate the database changes as SQL script file in drop folder for every build.
    For ex.: If I add a table in a database and then check in the changes, I need to get that create table script in the drop folder as .sql file extension
    I want to automate the build too for every check in. Help me out and guide me a step by step procedure because since I am new to TFS build in visual studio.
    Thanks

    Check out SSDT:
    https://msdn.microsoft.com/en-us/data/tools.aspx
    It can generate a DACPAC which can be used to update a SQL Database through the commandline. To ensure that the .sql file executed is compatible with the target database schema it contains a compiled version of teh schema and will generate the change script
    on-the-fly.
    If you want, you call SqlPackage,exe to generate a SQL script if you want to inspect it before executing.
    https://msdn.microsoft.com/en-us/library/hh550080%28v=vs.103%29.aspx
    My blog: blog.jessehouwing.nl

  • Image path not storing in sql database

    Hello,
    I have read here on the forum how to upload an image to server and store path in  your database, the image uploads correctly to the correct folder on my server but the image path does not get stored on my sql database (not local hosting). I receive the error: The file has been uploaded, and your information has been added to the directory. Column 'image' cannot be null.
    My database has the following columns:
    id
    datum
    image
    sectie
    My code is as follows:
    <?php require_once('Connections/dbTroch.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;
    mysql_select_db($database_dbTroch, $dbTroch);
    $query_rs_aanbod = "SELECT * FROM tblSlideshow ORDER BY id ASC";
    $rs_aanbod = mysql_query($query_rs_aanbod, $dbTroch) or die(mysql_error());
    $row_rs_aanbod = mysql_fetch_assoc($rs_aanbod);
    $totalRows_rs_aanbod = mysql_num_rows($rs_aanbod);
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    $target = "images/slides/";  //This is the directory where images will be saved// 
    $target = $target . basename( $_FILES['image']['name']); //change the image and name to whatever your database fields are called//
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "add-photos-aanbod")) {
      $insertSQL = sprintf("INSERT INTO tblSlideshow (image, sectie) VALUES (%s, %s)",
                           GetSQLValueString($_POST['file'], "text"),
                           GetSQLValueString($_FILES['image']['name'], "text"));
    //This code writes the photo to the server//
    if(move_uploaded_file($_FILES['image']['tmp_name'], $target))
    //And confirms it has worked//
    echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory";
    else {
    //Gives error if not correct//
    echo "Sorry, there was a problem uploading your file.";
      mysql_select_db($database_dbTroch, $dbTroch);
      $Result1 = mysql_query($insertSQL, $dbTroch) or die(mysql_error());
    ?>
    <!doctype html>
    <html>
    <meta charset="utf-8" />
      <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Troch Project Solutions - Admin - Toevoegen</title>
      <link rel="stylesheet" href="css/foundation.css" />
      <link rel="stylesheet" href="css/layout.css" />
      <!-- Fonts
      ================================================== -->
      <script type="text/javascript" src="//use.typekit.net/vob8gxg.js"></script>
      <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
      <!-- jQuery
      ================================================== -->
      <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
      <script src="js/vendor/modernizr.js"></script>
    </head>
    <body>
        <div class="row">
          <div class="large-8 medium-8 small-8 large-centered medium-centered small-centered columns intro">
              <h2 class="subheader text-center">Admin</h2>
              <p><a>Log uit</a></p>
              <p><a href="admin.php">Terug naar Admin menu</a>
              <h4>image toevoegen naar aanbod slideshows:</h4>
              <form action="<?php echo $row_rs_aanbod['']; ?>" method="POST" name="add-photos-aanbod" id="add-photos-aanbod" enctype="multipart/form-data">
              <table>
                    <tbody>
                         <tr>
                              <td><label for="image">Kies foto:</label></td>
                              <td><input name="image" type="file" id="image" value="<?php echo $row_rs_aanbod['image']; ?>" /></td>
                        <tr>
                              <td>Sectie:</td>
                              <td><select name="sectie" id="sectie" option value="sectie">
                                <?php
    do { 
    ?>
                                <option value="<?php echo $row_rs_aanbod['sectie']?>"><?php echo $row_rs_aanbod['sectie']?></option>
                                <?php
    } while ($row_rs_aanbod = mysql_fetch_assoc($rs_aanbod));
      $rows = mysql_num_rows($rs_aanbod);
      if($rows > 0) {
          mysql_data_seek($rs_aanbod, 0);
          $row_rs_aanbod = mysql_fetch_assoc($rs_aanbod);
    ?>
                              </select></td> 
                        </tr>
                        <tr>
                            <td><input type="Submit" name="Add" id="add" value="Toevoegen" /></td>
                        </tr>
                </tbody>
            </table>
            <input type="hidden" name="MM_insert" value="add-photos-aanbod" />
        </form>
          </div><!-- end large-8 -->
        </div><!-- end row -->
    <script src="js/vendor/jquery.js"></script>
    <script src="/js/vendor/fastclick.js"></script>
    <script src="js/foundation.min.js"></script>
    <script>
                $(document).foundation();
            </script>
    </body>
    </html>
    <?php
    mysql_free_result($rs_aanbod);
    ?>
    I cannot work out what is wrong and I would appreciate any help on this. Thanks

    Your form field and array variable names do not match
    <td><input name="image" type="file" id="image" value="<?php echo $row_rs_aanbod['image']; ?>" /></td>
    GetSQLValueString($_POST['file'], "text"),

  • How to attach sql database file to creating .exe setup in c#

    I create a Setup file and put data folder, in data folder i put database file , but the problem is i have to mannualy attach database file in sql server 2005. I have to automatically attach database file when installing setup file.

    Hi
    bhagvad,
    Welcome to MSDN Forums!
    We can implement auto attach database just use the connection string following.
    1)      
    Add a folder named ”DB” to the project, and copy the database file into it after you detach it from your sql server.
    2)      
    Change your connection string like this:
        <connectionStrings>
            <add name="WindowsFormsApplication1.Properties.Settings.BabakConnectionString"
                connectionString="Data Source=.;AttachDbFilename=|DataDirectory|\DB\Babak.mdf;Initial Catalog=test;Integrated Security=True"
                providerName="System.Data.SqlClient" />
        </connectionStrings>
    3)      
    After these, the database file will auto attach to the sql server when you run your application, and the database name is “test”, you can open the sql server
    management studio to find it.
    In addition, you can find the connection in the app.config file through the solution explorer in vs2010. And you also can find this file under your project. With
    these information, you can find it and modify it.
    If there’s anything unclear, please feel free to let me know.
    Best wishes,
    Mike
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually
    answer your question. This can be beneficial to the others community members reading the thread.
    when i try this i have an error from the computer. in my computer just microsoft server 2005 installed. and i need to setup my project. 
    <add name="TelekomEthernetApp.Properties.Settings.TelekomEthernetConnectionString" 
           connectionString="Data Source=.;AttachDbFilename=|DataDirectory|\DB\TelekomEthernet.mdf;Initial Catalog=test;Integrated security=true" providerName="System.Data.SqlClient"/>
    what is the problem?
    http://img31.imageshack.us/img31/2305/asdet.png

  • Need Help/Advice with Photo Web Gallery coming from SQL Database

    This is my first attempt at a database driven website. I assume what I am trying to accomplish should be fairly easy for more experienced but I am stuck at this point.
    First, let me explain what I am trying to accomplish.
    I want to create a thumbnail photo gallery displayed in columns and rows. I want to be able to hover over or click on the thumbnail image and have a lightbox script display the image over the thumb page. I am developing locally right now with intent to upload to the hosting site upon completion.
    I am developing with ASP vbScript pages. I have an SQL database where the paths to the image thumbnails and pictures are stored in a table. On the gallery page, I have created a div tag to hold my image recordset. Within this div, I have inserted 3 absolute positioned divs to hold the pictureID, the pictureName and the image inserted as a datasource. I then inserted the information from the bindings panel of my recordset. Last, I used a horizontal looper extension from Tom Muck to get the thumbnails to display in columns and rows. Everything works up to this point just fine.
    Now, I want to be able to hover or click on a thumnail image and have it displayed in a lightbox. I downloaded and used a javascript called Lightbox 2 which contains 3 javascript files and a css stylesheet. I inserted the files into the head tag like instructed to but could not get things to work properly. Here is where I need help. Currently, I am clicking on the thumbImage binding within the image Div and creating a link holder. I am then binding the larger pictureImage to it with the a.href selected in the bind to. I am then adding the command to call the lightbox javascript. Now, when I test my page, my thumbnail images do not show up (my alt text does in its place) but the links are in place and you can click on the alt text and it will return the correct larger image, but not in the lightbox, just in a new window with no styles.
    Am I going about this correctly? Can you use lightbox scripts with data-driven galleries? Does anybody have any suggestions of what I may be doing wrong or missing? Are there better ways to go about accomplishing this?
    Any help would be appreciated as this dynamic data thing has my head spinning. Although I know a database is needed to simplify the update and maintenance of the photos while allowing them to be searchable by keywords and tags also set up in the database.
    Thanks

    As I explained, I am developing locally a the moment. I will see about getting the databased moved up to the hosting server and then provide a link for an example.
    In the mean time, can you or anyone else explain a way that you would go about displaying an image thumbnail photo gallery laid out in rows / columns, with any lighbox script that would overlay the larger image over the existing page instead of opening a new browser window?
    I don't have to use the method I tried to describe.
    In all of the lightbox examples I have looked at thus far, they give instructions on how to append that javascript to a single static image or a group of static images, not images from a datasource. That is where I am getting confused.
    Don't know if this will help or not but please see code below:
    Javascript and CSS positioned in head tag
    <!--beginning of lightbox script with css -->
    <link href="CSS/lightbox.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/protype.js" type="text/javascript"></script>
    <script src="Scripts/scriptaculous.js?load=effects,builder" type="text/javascript"></script>
    <script src="Scripts/lightbox.js" type="text/javascript"></script>
    <!--end of lightbox script with css -->
    Calling for javascript in the galleryimage div when hovering over thumbnail image
        <!--beginning of gallery div -->
        <div id="gallery">
          <p>
            <!--beginning of galleryImage div -->
          </p>
          <table width="400" border="0" align="center" id="galleryNav2">
            <tr>
              <td width="100" align="center"><% If MM_offset <> 0 Then %>
                  <a href="<%=MM_moveFirst%>">First</a>
              <% End If ' end MM_offset <> 0 %></td>
              <td width="100" align="center"><% If MM_offset <> 0 Then %>
                <a href="<%=MM_movePrev%>">Previous</a>
              <% End If ' end MM_offset <> 0 %></td>
              <td width="100" align="center"><% If Not MM_atTotal Then %>
                <a href="<%=MM_moveNext%>">Next</a>
              <% End If ' end Not MM_atTotal %></td>
              <td width="100" align="center"><% If Not MM_atTotal Then %>
                <a href="<%=MM_moveLast%>">Last</a>
              <% End If ' end Not MM_atTotal %></td>
            </tr>
          </table>
          <p> </p>
          <table align="center" id="HorzLooper">
            <%
    startrw = 0
    endrw = HLooper1__index
    numberColumns = 5
    numrows = 5
    while((numrows <> 0) AND (Not rs_ssfGallery.EOF))
    startrw = endrw + 1
    endrw = endrw + numberColumns
    %>
            <tr align="center" valign="top">
              <%
    While ((startrw <= endrw) AND (Not rs_ssfGallery.EOF))
    %>
              <td><div id="galleryImage">
                <div id="galleryThumb"><a href="images/pic/<%=(rs_ssfGallery.Fields.Item("picture_url").Value)%>"rel="lightbox"><img src="images/thumb/<%=(rs_ssfGallery.Fields.Item("thumb_url").Value)%>" alt="<%=(rs_ssfGallery.Fields.Item("alt_url").Value)%>" /></a></div>
                <div id="galleryImageID"><%=(rs_ssfGallery.Fields.Item("picture_ID").Value)%></div>
                <div id="galleryImageFamily"><%=(rs_ssfGallery.Fields.Item("family").Value)%></div>
              </div></td>
              <%
    startrw = startrw + 1
    rs_ssfGallery.MoveNext()
    Wend
    %>
            </tr>
            <%
    numrows=numrows-1
    Wend
    %>
          </table>
          <p> </p>
          <table width="400" border="0" align="center" id="galleryNav">
            <tr>
              <td width="100" align="center"><% If MM_offset <> 0 Then %>
                  <a href="<%=MM_moveFirst%>">First</a>
              <% End If ' end MM_offset <> 0 %></td>
              <td width="100" align="center"><% If MM_offset <> 0 Then %>
                  <a href="<%=MM_movePrev%>">Previous</a>
              <% End If ' end MM_offset <> 0 %></td>
              <td width="100" align="center"><% If Not MM_atTotal Then %>
                  <a href="<%=MM_moveNext%>">Next</a>
              <% End If ' end Not MM_atTotal %></td>
              <td width="100" align="center"><% If Not MM_atTotal Then %>
                  <a href="<%=MM_moveLast%>">Last</a>
              <% End If ' end Not MM_atTotal %></td>
            </tr>
          </table>
    <!--end of galleryImage div -->
        </div>
        <!--end of gallery div -->
    Thanks for any help or suggestions.

  • Help Needed!! Working with SQL Databases

    Hi All,
    I'm currently working on an application that interfaces with an SQL database, and I seem to have ran into a roadblock.
    I have a multicolumn list box on my front panel which is filled in with data extracted from the database. On selecting any of the rows in the list box, another one is opened displaying another set of data extracted by a generated SQL query. At the moment I am only selecting one row at a time to view it's related data, but I want to expand such that I can select mutiple rows from the list box at a time and see all of their corresponding data.
    With only a single selection, I can pass the index value of the selection to an Index Array Function with the database as the other input and build my SQL statement.
    But with multiple selections, I imagine I would have to build an array on index values and use those as a reference to build the SQL statment. And I am not sure how exactly to go about doing that.
    Here is the code that I currently have working for a single selection from the list box.
    Any help is appreciated. Cheers.
    Solved!
    Go to Solution.

    tdog wrote:
    Hi All,
    I'm currently working on an application that interfaces with an SQL database, and I seem to have ran into a roadblock.
    I have a multicolumn list box on my front panel which is filled in with data extracted from the database. On selecting any of the rows in the list box, another one is opened displaying another set of data extracted by a generated SQL query. At the moment I am only selecting one row at a time to view it's related data, but I want to expand such that I can select mutiple rows from the list box at a time and see all of their corresponding data.
    With only a single selection, I can pass the index value of the selection to an Index Array Function with the database as the other input and build my SQL statement.
    But with multiple selections, I imagine I would have to build an array on index values and use those as a reference to build the SQL statment. And I am not sure how exactly to go about doing that.
    Here is the code that I currently have working for a single selection from the list box.
    Any help is appreciated. Cheers.
    Regarding building the array:
    I can see hat you multicolumn listbox has not multiselection enabled, and is limited to one or zero selected item at once. To enable multiselction; simply rightclick your multicolumn listbox and change your selection mode to support multiple selected items. The NewVal at the event structure should change from a single index number to a 1D array of indexed numbers. No coding needed. Then just retrive out all the items (since you know the indexes) and create the quiry. The quiry part I dont really know (long time no see SQL), but it looks like a for loop to create the string should do the trick?

  • Changing user permissions SQL Database Server for OBIEE repository

    Hi All
    We have installed OBIEE 11g and are using database SQL Server 2008 R2.
    The users of the repositories are connected to the master database, and our client query if these users can be disconnected from the master database, so that only stay connected to their corresponding repositories.
    Please help with this question.
    Regards
    Pedro

    Hi,
    You can move out of Master database with SQL server. If such a case is being considered then you have to create a database with SQL server then move all the existing OBI repository's and its users to the new Database. Once this change is complete on the Database side on Weblogic Database connect strings needs to be changed.
    Let me know if this helped.
    Regards,
    Jay

  • SQL Database is corrupted....... plz help.

    Respected Sir,
    unfortunately hard disk of my system is damaged, now i recovered my database. but it cannot be attached again to SQL management
    studio 2005.
    the error is myfile.mdf is not a primary database file. (SQL server , error 5171)
    plz sir help me...

    Corruption in SQL server database can happen due to any uncertain like virus attack, power
    failure, hardware issue, OS malfunction, sudden system shutdown, so on. When a SQL server data file (.mdf) is corrupt then DBAs can try several methods to repair and recover data from it. 
    Run DBCC CHECKDB: It checks & reports all the error message
    in errorlog, if there is any problem with the database. Try to analyze & understand the error message logged in the errorlog. Re-run DBCC CHECKDB with the recommended minimum repair option to repair the file. 
    Detailed information about DBCC CHECKDB is available here: http://www.techrepublic.com/forums/discussions/sql-database-recovery-from-corrupt-database-file/
    Restore from backup: If above command fails to fix the error
    message the try to restore the database from clean backup. 
    3rd party tool: Try 3rd party
    Recovery Toolbox for SQL Server to recover data from corrupt mdf file. Most of the software have demo version that shows the preview of corrupt SQL server data file. 
    http://www.sql.recoverytoolbox.com/

  • Help me on CVP class to query a SQL database

    Dear friends,
    I try to create a class extends to Action element. But when I do deploy, it return no result.
    I want this class receive Calling Number and do the query to database (SQL as I test, later if it works I will do for another database). After query I will get Name, Address, Email of this Customer based on Calling Number (ANI).
    Please help to take a look on my program and help me to fix it.
    Thank you very much.
    import com.audium.server.AudiumException;
    import com.audium.server.voiceElement.ActionElementBase;
    import com.audium.server.session.ActionElementData;
    import java.sql.*;
    * This class is called when a standard action has been configured to use a
    * Java class. Since this is a standard action element, it applies to a
    * specific application and does not have a configuration. As a result, the
    * only method needed in this class is the doAction method.
    public class DBLookupStandardAction extends ActionElementBase
    class WhatIGot
    String ANI = null;
    String Name = null;
    String Address = null;
    String Email = null;
    public void doAction(String name, ActionElementData data) throws AudiumException
    Connection conn = null;
    String Name = null;
    String Address = null;
    conn = connectToDatabase();
    String ani = data.getAni();
    WhatIGot whatigot = new WhatIGot();
    whatigot = QueryDatabase(conn, ani);
    Name = whatigot.Name;
    Address = whatigot.Address;
    data.setSessionData("Name",Name);
    data.setSessionData("Address",Address);
    // PUT YOUR CODE HERE.
    private Connection connectToDatabase()
    Connection conn = null;
    try
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    conn = DriverManager.getConnection("jdbc:sqlserver://172.16.3.5:1433;DatabaseName=hcmpt","sa","");
    catch (ClassNotFoundException e)
    e.printStackTrace();
    System.exit(1);
    catch (SQLException e)
    e.printStackTrace();
    System.exit(2);
    return conn;
    /*Query*/
    private WhatIGot QueryDatabase(Connection conn, String ANI)
    WhatIGot WhatIGot = new WhatIGot();
    try
    Statement st = conn.createStatement();
    ResultSet rs = st.executeQuery("SELECT prefixnos, Name, Address, Email FROM customer_info where prefixnos = ANI");
    WhatIGot.ANI = rs.getString ("prefixnos");
    WhatIGot.Name = rs.getString ("Name");
    WhatIGot.Address = rs.getString ("Address");
    WhatIGot.Email = rs.getString ("Email");
    rs.close();
    st.close();
    catch (SQLException se) {
    System.err.println("Threw a SQLException creating the list of blogs.");
    System.err.println(se.getMessage());
    return WhatIGot;

    Thank you Geoff,
    I have made some changes and now it's working fine with SQL database.
    I go forward to Oracle database. But can you show me how can I copy a new library (ojdbc14.jar) to the CVP server:
    - which folder?
    - and how apply it for all other application can use the same lib here?
    waiting for you answer...
    Thank you,
    This code I have tested, it can connect and query and I try to put to screen. It is working. But when I apply to CVP xml server, it not work. And the CVP VXML server got "stop" (maybe on the fail state)
    package com.dts.db;
    * @author Doan Khanh Tan Thanh
    // These classes are used by standard action elements.
    import com.audium.server.AudiumException;
    import com.audium.server.voiceElement.ActionElementBase;
    import com.audium.server.session.ActionElementData;
    import java.sql.*;
    * This class is called when a standard action has been configured to use a
    * Java class. Since this is a standard action element, it applies to a
    * specific application and does not have a configuration. As a result, the
    * only method needed in this class is the doAction method.
    public class OracleDBLookupAction extends ActionElementBase
    class WhatIGot
    String Name = null;
    String Address = null;
    String Email = null;
    public void doAction(String name, ActionElementData data) throws AudiumException
    String NameWhatIGot = null;
    Connection conn = null;
    String AddressWhatIGot = null;
    //String EmailWhatIGot = null;
    String ani = null;
    conn = connectToDatabase();
    ani = (String)data.getSessionData("ANI");
    WhatIGot whatigot = new WhatIGot();
    whatigot = QueryDatabase(conn, ani);
    NameWhatIGot = whatigot.Name;
    AddressWhatIGot = whatigot.Address;
    //EmailWhatIGot = whatigot.Email;
    data.setSessionData("Name",NameWhatIGot);
    data.setSessionData("Address",AddressWhatIGot);
    // PUT YOUR CODE HERE.
    private Connection connectToDatabase()
    Connection conn = null;
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    conn = DriverManager.getConnection("jdbc:oracle:thin:@172.16.5.134:1521:dbkttt","CUOC1080","123456");
    catch (ClassNotFoundException e)
    e.printStackTrace();
    System.exit(1);
    catch (SQLException e)
    e.printStackTrace();
    System.exit(2);
    return conn;
    /*Query*/
    private WhatIGot QueryDatabase(Connection conn, String ANI)
    WhatIGot WhatIGot = new WhatIGot();
    try
    Statement st = conn.createStatement();
    ResultSet rs = st.executeQuery("SELECT * FROM CUSTOMER_INFO where ANI = '838232822'");
    while ( rs.next() )
    WhatIGot.Name = rs.getString ("NAME");
    WhatIGot.Address = rs.getString ("ADDRESS");
    WhatIGot.Email = rs.getString ("EMAIL");
    rs.close();
    st.close();
    catch (SQLException se) {
    System.err.println("Threw a SQLException creating the list of blogs.");
    System.err.println(se.getMessage());
    return WhatIGot;

  • Script help -- to change the path of some script

    hi
    is it possible to make a script(perl or shell) which will change the location of sql script those are called from different shell script?
    i have some shell script which is calling some sql scripts.now i need one script which will ask for the path of those script once and set the path of those sql script in those shell script.these shell script only containing a line
    "sqlplus / as sysdba @<path of the sql script>/script.sql" now i need one script which will change <path of the sql script> .is it possible to do ??
    i need some help from gurus ...
    rgrds
    Edited by: new2appsdba on Aug 20, 2010 7:16 PM

    Hi
    can you say how to pass this mpath to n number of shell script??
    i need to update n number of script.ie. i need to pass $mpath variable to n number of script.
    example:
    profile_chk.sh contain only :
    sqlplus apps/<pass> @/u02/uatdb/.DBA-Scripts/profile_chk.sqlprofile_chk.sql contain:
    SELECT A.PROFILE_OPTION_ID,A.LEVEL_ID,A.LEVEL_VALUE,A.PROFILE_OPTION_VALUE,V.USER_PROFILE_OPTION_NAME
    FROM APPS.FND_PROFILE_OPTION_VALUES A, APPS.FND_PROFILE_OPTIONS_VL V
    WHERE A.PROFILE_OPTION_ID =V.PROFILE_OPTION_ID
    AND V.USER_PROFILE_OPTION_NAME like '%Debug Log%';
    select t.user_profile_option_name, profile_option_value
    from apps.fnd_profile_options o
    ,apps.fnd_profile_option_values v
    ,apps.fnd_profile_options_tl t
    where o.profile_option_id = v.profile_option_id
    and o.application_id = v.application_id
    and profile_option_value = 'Y'
    and start_date_active = SYSDATE
    and o.profile_option_name = t.profile_option_name
    and level_id=10001
    and (upper(t.user_profile_option_name) like '%PERSONALIZ%'
    and upper(t.user_profile_option_name) not like '%PERSONALIZ%WYSIWYG%'
    order by user_profile_option_name;
    select t.user_profile_option_name, profile_option_value, application_name
    from apps.fnd_profile_options o
    ,apps.fnd_profile_option_values v
    ,apps.fnd_profile_options_tl t
    ,apps.fnd_application_tl a
    where o.profile_option_id = v.profile_option_id
    and o.application_id = v.application_id
    and profile_option_value = 'Y'
    and start_date_active = SYSDATE
    and o.profile_option_name = t.profile_option_name
    and a.application_id = level_value
    and level_id=10002
    and t.language = a.language
    and upper(t.user_profile_option_name) like '%PERSONALIZ%'
    order by user_profile_option_name, application_name;now i need a script say install.sh
    which will update the location of profile_chk.sql in the profile_chk.sh.
    this install.sh will contain n numbers of
    install -c profile_chk.sh /usr/bin so that all user can access this shell script as a command.
    whenever the testing goes one server contains two instance so each everytime i need to monitor locks and invalid objects and etc so i need to use this scripts as a commands.for that reason i need this install -c for each scripts.and i need to visit different places also.so ineed this install.sh.my idea is basically work properly once and enjoy times lazily :-) so whenever i move to new place i shall only run this install.sh once and use those scripts lazily.
    rgrds

  • How to change the default password file's name and path when the database created?

    how to change the default password file's name and path when the database created?
    null

    Usage: orapwd file=<fname> password=<password> entries=<users>
    where
    file - name of password file (mand),
    password - password for SYS and INTERNAL (mand),
    entries - maximum number of distinct DBA and OPERs (opt),
    There are no spaces around the equal-to (=) character.

Maybe you are looking for

  • White line in Display...

    Hi all, Ok, so i could have a PBG4 12" for cheap(300$) but the owner tells me there's a white line on the display that you can see through, about a centimeter wide. Any idea, anyone, if it's a sign of future troubles or if i decide to live with it, t

  • No preview in column view

    Until now I could see jpg-pictures and documents in column view in Finder, but seemingly without reason the preview column only shows the attributes but no more the preview. All three options (symbols, preview and preview column) in column view are '

  • Static JNLP vs Dynamic one generated via PHP

    I have an issue with our application not updating when we make changes to our JNLP file that is dynamically generated using PHP. We use a versioned file using the "<property name="jnlp.versionEnabled" value="true">" in our JNLP file. I have tested us

  • Is there  any free update for logic pro x version 10.0

    Can logic pro X version 10.0 update to 10.1 for free ? How please !?

  • No thumbnails in organizer (was B Saggo)

    In my new Elements 12 I can not see thumbnails in the ALL MEDIA screen. Only rectangles with an hour glass. If I double click one of these I get a full size picture. What is wrong?