WRITE BACK ERROR URGENT HELP

Hi Experts,
Below is the xml code for the write back and i am getting the error .
Please go through and let me know how shud i correct the code if it is wrong,...
<?xml version="1.0" encoding="utf-8"?>
<WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
<WebMessageTable lang="en-us" system="writeBack" table="Messages">
<WebMessage name="CUST_FPP_REV1">
<XML>
<writeBack connectionPool="RecoPool">
<insert>INSERT into DAILY.REVRECAT (SERVICE_REV) values (@{c4})</insert>
<update> UPDATE DAILY.REVRECAT set SERVICE_REV=@(c4) where COMBI='@(c17)'</update>
</writeBack>
</XML>
</WebMessage>
</WebMessageTable>
</WebMessageTables>
The error I am getting when I click on the write back button is
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. NQODBC SQL_STATE: HY000 nQSError: 10058 A general error has occurred. nQSError: 43093 An error occurred while processing the EXECUTE PHYSICAL statement. nQSError: 17001 Oracle Error code: 904, message: ORA-00904: "C4": invalid identifier at OCI call OCIStmtExecute: UPDATE DAILY.REVRECAT set SERVICE_REV=(c4) COMBI='(c17)'. nQSError: 17011 SQL statement execution failed. (HY000)
SQL Issued: EXECUTE PHYSICAL CONNECTION POOL RecoPool UPDATE DAILY.REVRECAT set SERVICE_REV=(c4) where COMBI='(c17)' "Also can we pass prsentation variables in the write back xml template..(.in the where clause in the SQL query)
Appreciate your immediate reponse as this has become a work stopper for me ...
Please let me know where I am going wrong.
Regards,
Veena A
Edited by: mithuu on Mar 3, 2009 3:17 AM
Edited by: mithuu on Mar 3, 2009 3:19 AM

Hi Nico,
Thanks for your reply but i am really confused...
I tried with the points you told but not now gettig the error as
" Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. NQODBC SQL_STATE: HY000 nQSError: 10058 A general error has occurred. nQSError: 43093 An error occurred while processing the EXECUTE PHYSICAL statement. nQSError: 17001 Oracle Error code: 904, message: ORA-00904: "C4": invalid identifier at OCI call OCIStmtExecute: UPDATE DAILY.REVRECAT set SERVICE_REV=(c4) COMBI='(c17)'. nQSError: 17011 SQL statement execution failed. (HY000)
SQL Issued: EXECUTE PHYSICAL CONNECTION POOL RecoPool UPDATE DAILY.REVRECAT set SERVICE_REV=(c4) where COMBI='(c17)' "
Please help as i am new to this tool.
Appreciate your help.
Regards,
Veena A
Edited by: mithuu on Mar 3, 2009 3:20 AM

Similar Messages

  • Write Back Error in  OBIEE 11.1.1.7.150120

    Hello everybody,
    i have a problem with the writeback capabilities of OBIEE 11.1.1.7.150120.
    After the Migration from 10g to 11g i would like to customize the write back in 11g. I go like Oracle BI Practice: OBIEE 11g Configure Writeback this, but getting an OBIEE error:
    "Write Back Error
    An error occurred while writing to the server. Please check to make sure you have entered appropriate values. If the problem persists, contact your system administrator."
    The table does not have any constraint. I would like to insert for example the value "2".
    In my table properties i fill in "filling".
    My ...\bifoundation\OracleBIPresentationServicesComponent\coreapplication_obips1\analyticsRes\customMessages\writeback.xml looks like that:
    <?xml version="1.0" encoding="utf-8" ?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="filling">
    <XML>
    <writeBack connectionPool="Connection Pool">
    <insert> </insert>
    <update>update analyticmodel.last_runtimes set laru_exec = @1, laru_runtime_start = sysdate </update>
    </writeBack>
    </XML>
    </WebMessage>
    <WebMessage name="machine_filling">
    <XML>
    <writeBack connectionPool="Connection Pool">
    <insert> </insert>
    <update>update analyticmodel.machine_filling set mf_mach_id = @{c0}</update>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    Thank you very much
    Best regards
    Christian

    Hi Cristian,
    You must use '' at script when call some column value. (use '@1' instead of @1)
    Tip.. note you can use your "WebMessage Name" (from your script, like "filling", "machine_filing") into your analisys.
    Hope this help
    Felipe Idalgo

  • OBIEE 11G Write Back Error

    Hi All:
    I am testing the OBIEE 11G write back function. After all the steps , there's an Error message said "Write back Error" . No other detail information. Do you have any idea about where's the problem of it?
    My xml file was under the folder of 'C:\OBIEE11\Oracle_BI1\bifoundation\web\msgdb'. and the detail is as below.
    <?xml version="1.0" encoding="utf-8" ?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="write_back_test">
    <XML>
    <writeBack connectionPool="Connection Pool">
    <insert> </insert> <update>FACT_Writeback set MAX_LY2 = '@{c1}' where PERIOD_KEY = '@{c0}'
    </update>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    Really Thanks for your help.
    Sunny.Sun

    Hi,
    I think these is a problem with your connection pool name, please check it. It's a name of connection pool in BI administrator.
    if it's not problem, Can you try my way, replace '@{c1}', '@{c0}' by @1, @2...with 1,2 is a number of column in Criteria.
    It's my template :
    <?xml version="1.0" encoding="utf-8" ?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="SetQuotaUseID">
    <XML>
    <writeBack connectionPool="WB_CONN">
    <insert> </insert>
    <update>UPDATE biee_map_revenue SET DIST_CODE=@5 WHERE REV_ID = @1 </update>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    Edited by: OBIEE.vn on Feb 13, 2011 6:31 PM

  • OBIEE Write Back ERROR

    Hi All,
    Pl Help me in Resolving the Error
    "Write Back Error
    The system is unable to read the Write Back Template 'HIRING_STATUS'. Please contact your system administrator. "
    FolderPath:\\
    C:\OracleBI\web\msgdb\customMessages\Hiring_status.xml
    Here Table Name is BIDW_Final
    Column Name is Hiring_status where i am trying to write.
    <?xml version="1.0" encoding="utf-8"?>
    <WebMessageTables xmlns:sawnm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="HIRING_STATUS">
    <XML>
    <WriteBack connectionPool="RRF_TEST">
    <Insert> insert into BIDW_FINAL (HIRING_STATUS) values ('@{c1}')
    </Insert>
    <Update> </Update>
    <postUpdate>COMMIT</postUpdate>
    </WriteBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    I gave access,and done all the write back settings given (Follwing eg: OBIEE writeback
    Kindly help me in resolving the issue.
    Thanks in Advance,
    RK

    Hi,
    See the below link, it may help you,
    http://gerardnico.com/wiki/dat/obiee/write_back#support
    The write back name must be the same in the node WebMessage of the xml message
    <WebMessage name="*HIRING_STATUS*">
    Thanks,
    Balaa....
    Edited by: Balaa on Apr 30, 2010 5:09 PM
    Edited by: Balaa on Apr 30, 2010 5:11 PM

  • Write Back Error The system is unable to read the Write Back Template 'test

    Write Back Error The system is unable to read the Write Back Template 'test'. Please contact your system administrator. OK
    But, the update button is on.
    It did work and now it doesn't... nothing of course that we know of has changed. We got this message when we started and the name of the file was what we put as template name in obiee instead of webmessage name but the update button was off.... now we have update button on and same error.
    File is on unix and we have made 777 so it's open to the world.
    <?xml version="1.0" encoding="utf-8"?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="D_EXEC_METRIC">
    <WebMessage name="test">
    <XML>
    <writeBack connectionPool="writeback">
    <update>UPDATE D_EXEC_METRIC SET EXEC_METRIC_ICON_WID = @{c3}, EXEC_METRIC_COMMENT='@{c7}' WHERE SECTOR_WID=@{c0} AND EXEC_METRIC_WID=@{c2}</update>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    thanks in advance for your help!

    You're better off searching for an answer to this question in the [OBIEE Forum|http://forums.oracle.com/forums/forum.jspa?forumID=378].
    The topic is discussed at least twice a month so there's tons of posts with all the answers you need. Make a forum search for writeback and you'll have your answer.
    Cheers,
    C.

  • Write back error - 11.1.1.6.2

    Hi,
    Has anyone been able to update records using writeback in 11.1.1.6.2?
    Update works, in 10g but in 11.1.1.6.2 I get always the error "Write Back Error".
    I have tried the following steps:
    1) physical table non-cacheable.
    2) in logical column writeback option
    3) grant read/write columns in rpd
    3) LightWriteback element in the instanceconfig.xml file
    4) In Oracle BI Presentation Services, grant write-back privileges to the user
    4) pasting xml file in custommessages folders:
    D:\OBIEE11g\instances\instance1\bifoundation\OracleBIPresentationServicesComponent\coreapplication_obips1\analyticsRes\customMessages
    D:\OBIEE11g\instances\instance1\bifoundation\OracleBIPresentationServicesComponent\coreapplication_obips1\analyticsRes\WEB-INF\customMessages
    My template is:
    <?xml version="1.0" encoding="utf-8" ?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="test">
    <XML>
    <writeBack connectionPool="testdb">
    <insert>UPDATE user1.table_write_back SET val1=@{c4}, val2=@{c10} WHERE cod_month=@{c8} and cod_line = @{c9}</insert>
    <update>UPDATE user1.table_write_back SET val1=@{c4}, val2=@{c10} WHERE cod_month=@{c8} and cod_line = @{c9}</update>
         </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    Any suggestion?
    Thanks.

    Hello PeterJwindows8,
    I understand that your iPhone 5 is not recognized by iTunes. The following article may help to resolve your issue:
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    Thanks,
    Matt M.

  • Oracle BI Write Back on NULL values  - Write Back Error

    Hi together,
    Write Back Error
    An error occurred while writing to the server. Please check to make sure you have entered appropriate values. If the problem persists, contact your system administrator
    I receive this message when I try to make a update of an null value in the database.
    update value on value or value to null works fine. So the XML Message is working on production.
    Is this a BUG?
    Regards,
    Stefan
    <?xml version="1.0" encoding="utf-8" ?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="SetWriteBackGKV">
    <XML>
    <writeBack connectionPool="QS_DWH_DB">
    <insert> </insert>
    <update>UPDATE QS_DWH.CKVB_HR_EXTERNAL SET CKVB_HR_EXTERNAL.GKV_SICKNESS_PERC = '@{c7}' WHERE CKVB_HR_EXTERNAL.D_TIME ='@{c5}'</update>
         </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>

    Hi,
    http://gerardnico.com/wiki/dat/obiee/write_back -- recheck your configuration following this link step by step with screen shots.
    Note : The Problem Occurred two ways,
    1. Problem your XMl Script
    2. If null value not present in your columns in your table in the database.The problem is occured.
    please check below steps.
    1. Are you using OCI or ODBC in your connection pool? Try it with OCI Call Interface 11g.
    2.Remove the commit tag from the XML file.
    <postUpdate>COMMIT</postUpdate>
    =============================================================================================================
    This xml file working for me.
    Insert--
    A couple of small adjustments got your XML to work here:
    <?xml version="1.0"; encoding="utf-8"?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1";>
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="WriteBack">
    <XML>
    <writeBack connectionPool="Connection Pool">
    <insert> INSERT INTO FACT (PRICE,PRODUCT_KEY,REGION_KEY,SALE_UNIT,TIMEKEY,SALES_QUOTA)
    values (@{c7},@{c8},@{c9},@{c10},@{c11},@{c5} ) </insert>
    <update> </update>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    The <writeBack> tag is written with a lower case "w".
    The "connetionPool" needs an upper case "P".
    Update--
    I think that you have to specify also an SQL statement for the update tag, for example:
    <?xml version="1.0"; encoding="utf-8"?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1";>
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="pmet_update">
    <XML>
    <writeBack connectionPool="PMTCOG">
    <insert> select null from dual</insert>
    <update> UPDATE XREF_PMET_URL SET URL= '@{c1}' WHERE API='@{c0}'</update>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    The witeback wants for both the tags (<insert></insert> and <update></update>) an SQL Statement.
    Hope this help's
    Thanks
    Satya

  • Red box "Write Back Error" OBIEE 11.1.1.6.0

    Hi, are there anyone here succeed setup writeback in obiee 11.1.1.6.0 windows or linux system?
    I have tried every tutorials on the internet, but always stuck in red box "Write Back Error" and don't have any clue in the log files.
    thanks.

    hi Devarasu, thanks for reply, I have done all your instruction but still no luck, red box with "write back error" always appear. Do you know how can I track it down? Or should I patch or upgrade to 11.1.1.6.2 BP1 ?

  • OBIEE 11.1.1.5.0 Write back error.

    I am working on OBIEE 11G(11.1.1.5.0) write back feature. After all the steps which were mentioned in 11g Documentation , there's an Error message said "Write back Error" . No other detail information. Do you have any idea about it?

    Yes,
    Please note that in Oracle BI 11g, the use of PL/SQL (any non core SQL logic) is no applicable to in the writeback configuration files. Do not use ';' semi-colons. Also such things as BEGIN / END do not work as they did in Oracle BI 10g.

  • Write back error, help

    Hi all,
    In my write back report, i got this error:
    error code: OPR4ONWY:U9IM8TAC:OI2DL65P
    状态: HY000。 代码: 10058。 [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27024] The EXECUTE PHYSICAL statement must specify a physical SQL statement to execute. (HY000)
    Issue SQL: EXECUTE PHYSICAL CONNECTION POOL "connection pool" COMMIT
    I checked in database, data have changed in db, but why raise this error?
    Edited by: jacky on 2010-7-27 下午8:42

    Hi Jacky,
    I guess you should put an insert statement in place .If the column that you are updating has null values then it will look for insert statement but if you are updating a column value that already has some value then it will look for update statement.For ex : if you are updating some meaure value from 200 to 300 then it will execute update statemnt but if you are updating null to 300 then BI server will look for insert staement.
    I worked on this a long way back so if you can try puttting insert statement then we can reach at some conclusion.
    Thanks
    Sandeep

  • Obiee 10g write back error while insertion

    Hi,
    Im getting an error while trying to write back a column to oracle database.
    Error details
    An error occurred while writing to the server. Please check to make sure you have entered appropriate values. If the problem persists, contact your system administrator.
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27024] The EXECUTE PHYSICAL statement must specify a physical SQL statement to execute. (HY000)
    SQL Issued: EXECUTE PHYSICAL CONNECTION POOL orcl
    Xml issued
    <?xml version="1.0" encoding="utf-8"?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="WriteBack">
    <XML>
    <writeBack connectionPool="orcl">
    <insert> INSERT INTO writebackasim(name)values (@{c1}) </insert>
    <update> </update>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    Help me please...

    now it is updating the value...But still error message is coming
    and i have changed the code to insert..BUt now getting the error message and not inserting the value.. can you please debug this.
    ?xml version="1.0" encoding="utf-8"?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="WriteBack">
    <XML>
    <writeBack connectionPool="orcl">
    <insert>insert into writebackasim(id,name)values(@{c0},'@{c1}')</insert>
    <update>select null from dual</update>
    <postUpdate>COMMIT</postUpdate>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    error message
    An error occurred while writing to the server. Please check to make sure you have entered appropriate values. If the problem persists, contact your system administrator.
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27024] The EXECUTE PHYSICAL statement must specify a physical SQL statement to execute. (HY000)
    SQL Issued: EXECUTE PHYSICAL CONNECTION POOL orcl COMMIT
    -

  • OBIEE write back error MSG: OPR4ONWY:U9IM8TAC:OI2DL65P

    Hello there,
    I've been trying to use OBIEE write back function. I've created XML template to insert and update value in OBIEE dashboard and then to the DB. I've look into several research paper, yet I still have the problem. Your help is greatly appreciated. I thank you so much in advance for your help. Arnold
    Pls see the following detailed info concerning this error:
    Error MSG detail:
    =============
    An error occurred while writing to the server. Please check to make sure you have entered appropriate values. If the problem persists, contact your system administrator.
    Odbc driver returned an error (SQLExecDirectW).
    Error code:
    =========
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27024] The EXECUTE PHYSICAL statement must specify a physical SQL statement to execute. (HY000)
    SQL Issued: EXECUTE PHYSICAL CONNECTION POOL SH
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27024] The EXECUTE PHYSICAL statement must specify a physical SQL statement to execute. (HY000)
    SQL Issued: EXECUTE PHYSICAL CONNECTION POOL SH
    XML template:
    ==========
    <?xml version="1.0" encoding="utf-8" ?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="SHNEW">
    <XML>
    <writeBack connectionPool="SH">
    <insert>INSERT into sales (sales_quota) values(@{c0})</insert>
    <update> </update>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>

    You don't have any update statement here :
    <update> </update>
    Research when insert part is called and when update is called.

  • Write Back Error OBIEE 11g

    I am facing the following error massege in writeback funtionality.
    I checked the value ,connection pool,writable,read/write permissions but not resolved the issue.
    "An error occurred while writing to the server. Please check to make sure you have entered appropriate values. If the problem persists, contact your system administrator."
    Any help about that ?

    Hi,
    http://satyaobieesolutions.blogspot.in/2013/03/write-back.html -- recheck your configuration following this link step by step with screen shots.
    http://satyaobieesolutions.blogspot.in/2012/06/obiee-10g11g-writeback-capabilities.html
    http://satyaobieesolutions.blogspot.in/2012/06/excel-data-source-writeback-in-obiee.html Note : The Problem Occurred two ways,
    1. Problem your XMl Script
    2. If null value not present in your columns in your table in database.The ; problem has occured.
    please check below steps.
    1. Are you using OCI or ODBC in your connection pool? Try it with OCI Call Interface 11g.
    2.Remove the commit tag from the XML file.
    <postUpdate>COMMIT</postUpdate>
    =============================================================================================================
    This xml file working for me.
    Insert--
    A couple of small adjustments got your XML to work here:
    <?xml version="1.0"; encoding="utf-8"?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1";>
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="WriteBack">
    <XML>
    <writeBack connectionPool="Connection Pool">
    <insert> INSERT INTO FACT (PRICE,PRODUCT_KEY,REGION_KEY,SALE_UNIT,TIMEKEY,SALES_QUOTA)
    values (@{c7},@{c8},@{c9},@{c10},@{c11},@{c5} ) </insert>
    <update> </update>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    The <writeBack> tag is written with a lower case "w".
    The "connetionPool" needs an upper case "P".
    Update--
    I think that you have to specify also an SQL statement for the update tag, for example:
    <?xml version="1.0"; encoding="utf-8"?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1";>
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="pmet_update">
    <XML>
    <writeBack connectionPool="PMTCOG">
    <insert> select null from dual</insert>
    <update> UPDATE XREF_PMET_URL SET URL= '@{c1}' WHERE API='@{c0}'</update>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    The witeback wants for both the tags (<insert></insert> and <update></update>) an SQL Statement.
    Hope this help's
    Thanks
    Satya

  • DiskSpace Report Alert Error - Urgently Help Needed

    Hell All
    I have been take the scripts from https://gallery.technet.microsoft.com/scriptcenter/Disk-Space-Report-Reports-98e64d65
    Which is working fine , but my end of scripts out Auto Disclaimer is added and the output has little bit collapsed
    Disclaimer HAS BEEN added to the waring and critical Table which is mentioned on this script which is underlined now. and how avoid this 
    Urgent help is needed
    #  Check disk space and send an HTML report as the body of an email.        #
    #  Reports only disks on computers that have low disk space.                #
    #  Author: Mike Carmody                                                     #
    #  Some ideas extracted from Thiyagu's Exchange DiskspaceHTMLReport module. #
    #  Date: 8/10/2011                                                          #
    #  I have not added any error checking into this script yet.                #
    # Continue even if there are errors
    $ErrorActionPreference = "Continue";
    # Items to change to make it work for you.
    # EMAIL PROPERTIES
    #  - the $users that this report will be sent to.
    #  - near the end of the script the smtpserver, From and Subject.
    # REPORT PROPERTIES
    #  - you can edit the report path and report name of the html file that is the report. 
    # Set your warning and critical thresholds
    $percentWarning = 15;
    $percentCritcal = 10;
    # EMAIL PROPERTIES
    # Set the recipients of the report.
    $users = "[email protected]"
      #$users = "[email protected]" # I use this for testing by uing my email address.
    #$users = "[email protected]", "[email protected]", "[email protected]";  # can be sent to individuals.
    # REPORT PROPERTIES
    # Path to the report
    $reportPath = "D:\Jobs\DiskSpaceQuery\Reports\";
    # Report name
    $reportName = "DiskSpaceRpt_$(get-date -format ddMMyyyy).html";
    # Path and Report name together
    $diskReport = $reportPath + $reportName
    #Set colors for table cell backgrounds
    $redColor = "#FF0000"
    $orangeColor = "#FBB917"
    $whiteColor = "#FFFFFF"
    # Count if any computers have low disk space.  Do not send report if less than 1.
    $i = 0;
    # Get computer list to check disk space
    $computers = Get-Content "servers_c.txt";
    $datetime = Get-Date -Format "MM-dd-yyyy_HHmmss";
    # Remove the report if it has already been run today so it does not append to the existing report
    If (Test-Path $diskReport)
            Remove-Item $diskReport
    # Cleanup old files..
    $Daysback = "-7"
    $CurrentDate = Get-Date;
    $DateToDelete = $CurrentDate.AddDays($Daysback);
    Get-ChildItem $reportPath | Where-Object { $_.LastWriteTime -lt $DatetoDelete } | Remove-Item;
    # Create and write HTML Header of report
    $titleDate = get-date -uformat "%m-%d-%Y - %A"
    $header = "
    <html>
    <head>
    <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
    <title>DiskSpace Report</title>
    <STYLE TYPE='text/css'>
    <!--
    td {
    font-family: Tahoma;
    font-size: 11px;
    border-
    border-right: 1px solid #999999;
    border-bottom: 1px solid #999999;
    border-
    padding-
    padding-right: 0px;
    padding-bottom: 0px;
    padding-
    body {
    margin-
    margin-
    margin-right: 0px;
    margin-bottom: 10px;
    table {
    border: thin solid #000000;
    -->
    </style>
    </head>
    <body>
    <table width='100%'>
    <tr bgcolor='#CCCCCC'>
    <td colspan='7' height='25' align='center'>
    <font face='tahoma' color='#003399' size='4'><strong>AEM Environment DiskSpace Report for $titledate</strong></font>
    </td>
    </tr>
    </table>
     Add-Content $diskReport $header
    # Create and write Table header for report
     $tableHeader = "
     <table width='100%'><tbody>
    <tr bgcolor=#CCCCCC>
        <td width='10%' align='center'>Server</td>
    <td width='5%' align='center'>Drive</td>
    <td width='15%' align='center'>Drive Label</td>
    <td width='10%' align='center'>Total Capacity(GB)</td>
    <td width='10%' align='center'>Used Capacity(GB)</td>
    <td width='10%' align='center'>Free Space(GB)</td>
    <td width='5%' align='center'>Freespace %</td>
    </tr>
    Add-Content $diskReport $tableHeader
    # Start processing disk space reports against a list of servers
      foreach($computer in $computers)
    $disks = Get-WmiObject -ComputerName $computer -Class Win32_LogicalDisk -Filter "DriveType = 3"
    $computer = $computer.toupper()
    foreach($disk in $disks)
    $deviceID = $disk.DeviceID;
            $volName = $disk.VolumeName;
    [float]$size = $disk.Size;
    [float]$freespace = $disk.FreeSpace; 
    $percentFree = [Math]::Round(($freespace / $size) * 100, 2);
    $sizeGB = [Math]::Round($size / 1073741824, 2);
    $freeSpaceGB = [Math]::Round($freespace / 1073741824, 2);
            $usedSpaceGB = $sizeGB - $freeSpaceGB;
            $color = $whiteColor;
    # Set background color to Orange if just a warning
    if($percentFree -lt $percentWarning)      
      $color = $orangeColor
    # Set background color to Orange if space is Critical
          if($percentFree -lt $percentCritcal)
            $color = $redColor
     # Create table data rows 
        $dataRow = "
    <tr>
            <td width='10%'>$computer</td>
    <td width='5%' align='center'>$deviceID</td>
    <td width='15%' >$volName</td>
    <td width='10%' align='center'>$sizeGB</td>
    <td width='10%' align='center'>$usedSpaceGB</td>
    <td width='10%' align='center'>$freeSpaceGB</td>
    <td width='5%' bgcolor=`'$color`' align='center'>$percentFree</td>
    </tr>
    Add-Content $diskReport $dataRow;
    Write-Host -ForegroundColor DarkYellow "$computer $deviceID percentage free space = $percentFree";
        $i++
    # Create table at end of report showing legend of colors for the critical and warning
     $tableDescription = "
     </table><br><table width='20%'>
    <tr bgcolor='White'>
        <td width='10%' align='center' bgcolor='#FBB917'>Warning less than 15% free space</td>
    <td width='10%' align='center' bgcolor='#FF0000'>Critical less than 10% free space</td>
    </tr>
      Add-Content $diskReport $tableDescription
    Add-Content $diskReport "</body></html>"
    # Send Notification if alert $i is greater then 0
    if ($i -gt 0)
        foreach ($user in $users)
            Write-Host "Sending Email notification to $user"
    $smtpServer = "MySMTPServer"
    $smtp = New-Object Net.Mail.SmtpClient($smtpServer)
    $msg = New-Object Net.Mail.MailMessage
    $msg.To.Add($user)
            $msg.From = "[email protected]"
    $msg.Subject = "Environment DiskSpace Report for $titledate"
            $msg.IsBodyHTML = $true
            $msg.Body = get-content $diskReport
    $smtp.Send($msg)
            $body = ""
    https://gallery.technet.microsoft.com/scriptcenter/Disk-Space-Report-Reports-98e64d65

    Hi,
    I want to double confirm which version are you used, please also refer to scripting center for the similar scripts:
    Disk Space Monitoring - HTML EMAIL Report
    http://gallery.technet.microsoft.com/scriptcenter/6e935887-6b30-4654-b977-6f5d289f3a63
    Monitor Free Disk Space Information on a Computer
    http://gallery.technet.microsoft.com/scriptcenter/04c29c84-5ecc-4bf6-8dd4-2940db63d9f3
    List Available Disk Space
    http://gallery.technet.microsoft.com/scriptcenter/7fa38863-ad6f-4f46-ac91-9b7d4a30f52b
    Disk Space monitoring
    http://gallery.technet.microsoft.com/scriptcenter/fd4f5235-1a80-41ed-87e2-189278fd376c
    If you encounter any difficulties when customizing the scripts, you may submit a new question in
    The Official Scripting Guys Forum! which is a best resource for scripting related issues.
    Best Regards,
    Allen Wang

  • Write Back Error: The system was unable to generate appropriate SQL

    All,
    Have looked at the previous threads on this topic and it has usually been syntax problems in the xml file. I've been over it a million times and can't see any problems.
    The error I'm getting is when I click the "update" button to initiate the write-back;
    The system was unable to generate appropriate SQL. Please contact your system administrator.
    Template: 'UPDATE WC_DEPT_GOALS_D SET Week_Beginning = @{c0}, Week_Ending = @{c1} WHERE id = @{c2} '
    Record: '<record action="update"><value columnID="c2">142</value><value columnID="c0">04/30/2012</value><value columnID="c1">05/06/2011</value></record>'
    My xml file is as follows;
    <?xml version="1.0" encoding="utf-8" ?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="GOALS">
    <XML>
    <writeBack connectionPool="GL Oracle Data Warehouse Connection Pool">
    <insert> </insert>
    <update>UPDATE WC_DEPT_GOALS_D SET Week_Beginning = @{c0}, Week_Ending = @{c1} WHERE id = @{c2} </update>
    <postUpdate>COMMIT</postUpdate>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    Week Beginning and Week End are just two columns from WC_DEPT_GOALS_D - 44 columns in total which I want to write back to. These two are datetime, the others are int or float. I can't even get it to write back with these two, let a lone the other 42! :)
    Any suggestions? Thanks guys!
    Please note, I've also tried it without the "postUpdate" COMMIT line. Same error.
    Edited by: Ally on Jun 3, 2011 7:50 AM
    Edited by: Ally on Jun 3, 2011 8:00 AM

    If your column data type is varchar then you have to specify that in single quote
    COMMIT :if your DB supports automatic commit so you don't have to add it.
    check that the name in "<WebMessage name="GOALS">" is the exact same case as what you have in your report. i.e. it's Goals in the XML and then it cannot be GOALS in the Report or goals.
    And also try this..
    <update>UPDATE WC_DEPT_GOALS_D SET Week_Beginning = @{c0} WHERE id = @{c2}
    UPDATE WC_DEPT_GOALS_D SET Week_Ending = @{c1} WHERE id = @{c2}</update>
    Restart all the services and oc4j
    Cheers,
    Aravind
    Edited by: Aravind Addala on Jun 3, 2011 8:51 AM
    Edited by: Aravind Addala on Jun 3, 2011 8:57 AM

Maybe you are looking for