Ozzie.eu

Love to code, although it bugs me.

ORA-01704: string literal too long

2 comments
Having an Oracle database with a given table storing long strings as binary data types (BLOB/CLOB), one might need to perform manual updates on those columns:
update myTable set lobColumn='Some String Value' 
where somekey=somecriteria;
The following error might occur while performing the direct update on that column:
ORA-01704: string literal too long
Cause: The string literal is longer than 4000 characters.
Action: Use a string literal of at most 4000 characters. 
Longer values may only be entered using bind variables.
The origin of the error is that the string value passed is indeed over 4000 characters long. A simple workaround script that works like a charm is:
DECLARE
  vString myTable.lobColumn%type;
BEGIN
  vString := 'Some very long string value'
  update myTable set lobColumn=vString where somekey=somecriteria;
END;
Don't forget to replace "myTable" and "lobColumn" with your table and column.
HTH.

2 comments :

Post a Comment

Your backup is from a different version of Microsoft SharePointFoundation

3 comments
Given the task of migrating a Sharepoint 2010 web application, from quality assurance to the live environment, our team backed up the site using the Powershell  Cmdlet "Backup-SPSite". Afterwards, we copied the backup file to the live farm and executed the "Restore-SPSite" Cmdlet. The following error message appeared:
Restore-SPSite : Your backup is from a different version of
Microsoft SharePoint Foundation and cannot be restored to a 
server running the current version. The backup file should be 
restored to a server with version '4.0.145.0' or later.
After comparing the patch level on both farms, a missing security update was identified on the live farm. Having multiple applications hosted on the farm, the update roll-out was not an option.
So one of my colleagues found that the old school "stsadm" command allows the backup and restore of Sharepoint sites without checking the build number on the farm.
The solution was to use the following commands:

  1. On the Q&A server, open a command prompt and enter "cd C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN>"
  2. Execute the following command:
  3. STSADM.EXE -o backup -url http://server/site 
    -filename backup.dat
  4. Copy the resulting file to the live farm.
  5. On the live farm, open a command prompt and enter "cd C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN>"
  6. Execute the following command:
  7. STSADM.EXE -o restore -url http://server/site -filename 
    backup.dat -overwrite
  8. Open the desired URL and check for your site's correct update.
HTH.

Thanks to Nelson!

3 comments :

Post a Comment