ACCEPT in SQL script not working

G'day
Why does the following use of the 'accept' keyword not work?
I want a user to be prompted to either commit or rollback but it does not work in the following 'experiment'
set echo on
set termout on
set feedback on
update emp set sal = sal*2 where ename = 'SCOTT';
accept action char prompt 'rollback or commit >'
&action
the following is what happens when i run the script:
SQL> @temp02.sql
SQL> set echo on
SQL> set termout on
SQL> set feedback on
SQL> update emp set sal = sal*2 where ename = 'SCOTT';
1 row updated.
SQL> accept action char prompt 'rollback or commit >'
rollback or commit >rollback
SQL> &action
SP2-0042: unknown command "&action" - rest of line ignored.
Any suggestions appreciated.
Tony

Hi, Tony,
Welcome to the forum!
SQL*Plus looks at the first word of a statement before resolving substitution variables. (I don't know why; it resolves them regardless of what the command is.) At any rate, the first word of a command that SQL*Plus interprets has to be spelled out.
"BEGIN" that starts an anonymous block counts as the first word, so you can take Andy's suggestion much further by simply saying:
BEGIN
    &action;
END;
/@ also counts as the first word, so you could also have one-line scripts called commit.sql
COMMIT;and rollback.sql,
ROLLBACK;and then say
@&action

Similar Messages

  • Force encryption on SQL Server not working?

    Hello Everyone,
    I'm running SQL Server 2008 64-bit. I've installed a self-signed cert on the box and set  "Force Encryption"  and restarted SQL server. 
    I setup a client machine to trust the authority of the cert installed on the server. When I connect to that SQL server from SSMS from a client machine and select the "encrypt connection" option in the client Connection properties, SSMS correctly complains
    that the cert on the server does not match the computer name I asked to log into . This is because, although the cert is trusted, the dns name dos not match the CN in the cert <- Perfect, exactly what I am expecting.
    When I connect to the same SQL server from the same client but  UNCHECK "encrypt connection" on the client, I'm able to login. Considering I've checked the "Force Encryption" on the server, the server should have rejected the connection. Why not?
    Ameer Deen

    Hi all,
    We are implementing a Merge Synchronization solution which involves three SQL Servers located on three Azure locations worldwide and one on-premises location. We need to secure communications between all servers. We are evaluating the encryption of all server
    communications through SSL:
    http://technet.microsoft.com/en-us/library/ms191192.aspx
    When we configure one server (let’s call it server A) to accept only encrypted connections (with Force Encryption=Yes) we still can connect from other server (let’s call it server B) that do not have the certificate installed. We would expect the server
    B to fail in the attempt of connect as server A should only accept encrypted communications and those should need the certificated to encrypt/decrypt everything (commands and data).
    We have also review the following forum post that is very similar to this one:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/bde679d9-ff83-4fa7-b402-42e336a97106/force-encryption-on-sql-server-not-working
    In all cases the Microsoft answer is:
    “When the
    Force Encryption option for the Database Engine is set to YES, all communications between client and server is encrypted no matter whether the “Encrypt
    connection” option (such as from SSMS) is checked or not. You can check it using the following DMV statement”
    When we run the provided DMV statement to check if encryption is enabled:
    -- To check whether connections are encrypted between server and clients
    SELECT encrypt_option
    FROM sys.dm_exec_connections
    We get “TRUE”. So theoretically encryption is enabled.
    Then:
    Why can we run SQL statements against server A from server B (with SSMS) without any certificate?
    Are we wrong when we expect server A to refuse any client that do not have the right certificate?
    How can server B, without any certificate, decrypt the data encrypted by server A?
    Our intention is to encrypt all server in the same way so all of them will accept only encrypted communications. We are assuming that the Merge Agent will be able to communicate with the Publisher and the Subscriber through this encrypted environment. May
    anyone please confirm ti?
    Thanks for your help.
    Best Regards
    Benjamin Moles

  • What will you do if any SQL is not working.in oracle 10g...apps 11.5.10.2

    What will you do if any SQL is not working. in oracle 10g....apps 11.5.10.2

    928714 wrote:
    yes sir.If you help me in answering my questions i wll be very thankful to you sir.
    tnx,I haven't a clue.
    As you have been advised in many of your posts, go study the documentation for whichever specific topic you are interested in.
    For me to answer your questions, I would need to go get that documentation.
    Then I would need to read that documentation.
    Then I would need to write a forum post that interprets what I think I learned from that documentation.
    It is so very much faster if YOU go do that instead of posting to a forum and expecting others to do it. You will remember what you study for a lot longer time if you teach yourself.

  • Sql is not working after changing from MsAccess into sql server

    Following Sql  is not working after changing from MsAccess into sql server. 
    sum(trn.sales) as sales,
    sum(trn.cost) as cost,
    sales - cost as profit // Here is not working . can we not use sales a column. Please advise
    from trn
    Kind Regards
    pol
    polachan

    It will not work if use two different column from the table or column  from two  different table
    Example
    sum(trn.sales * trn.rate) as salesAmount,
    sum(trn.cost) as cost,
    sum(trn.salesAmount)-sum(trn.cost) as profit ----- Here is not working . can we not use sales a column. Please advise
    from trn
    Regards
    polachan

  • SQL (Reverse) not working in Forms 6i

    Hi:
    Env 6i c/s 8i DB.
    SELECT REVERSE ( '321' ) FROM DUAL works in SQL*Plus but does not accept the REVERSE function from within a Trigger. I could put the logic in a Package on the DB but I'd like to know why it does not work in F6i ?
    Thanks
    N.

    Forms 6i uses an older version of PL/SQL than the database, so it does not recognize the newly introduced function. You will need to create a database function to call from the form.

  • SQL tab not working in V2.1 EA1 for non-DBA users -- how to fix?

    In v2.1 EA 1 the tab to show the SQL script (DDL) in the object browser is not working for non-DBA users. In the prior version, these users would see a message about DBMS_METADATA and then the message would indicate that an "internal generator" would be used to generate the DDL script. After that brief message the DDL would show up as expected. This doesn't seem to be the case in the newest version.
    I issued the following two grants to a particular user which worked, but I am reluctant to issue the grants to "PUBLIC".
    SQL> grant execute on DBMS_METADATA to XXXXX;
    SQL> grant select_catalog_role to XXXXX;
    So, my questions are:
    1) Will the old functionality (that didn't require these privileges) be added to V2 at some point?
    2) What security implications are there for issueing the above grants to PUBLIC?
    NOTE: After granting execute on the DBMS_METADATA package, it still didn't work. I left that grant in place and granted SELECT_CATAOG_ROLE, so I can't say for sure that the 1st grant was required.
    Edited by: user615070 on Nov 19, 2009 9:30 AM
    Edited by: user615070 on Nov 19, 2009 10:06 AM

    An OEM account is separate from the database account. You need to use OEM UI to create an OEM account, however, for certain tasks to be done in the databases which OEM is monitoring they will also require separate database accounts within those databases. For example, to view the performance tab in OEM UI, a database account is required.
    OEM only has two types of users, i.e. Super Administrator and Administrator, but don't go by the names. You can grant an OEM 'Administrator' account access to specific targets and what they can do within OEM, such as only viewing reports, targets, and so on. For access within a database, the user created need not be a DBA either.
    I hope you understand.

  • Sql update not working

    Hi,
    I am trying to update my database with the following code but even though the code definately runs because it does get to the echos on the line before the update, the database is not getting updated.
    if ($totalRows_rsportsale >'0') {
    $_POST['dpaid'] = 1;
    $_POST['listedby'] = $row_rsportid['listedid'];
    echo 'dpaid is: ' . $_POST['dpaid'] . '<br />';
    echo 'listedby is: ' . $_POST['listedby'] . '<br />';
    $updateSQL = sprintf("UPDATE detailstable SET dpaid=%s WHERE listedby=%s",
                                         GetSQLValueString($_POST['listedby'], "int"),
                                         GetSQLValueString($_POST['dpaid'], "int"));
      mysql_select_db($database_connUpdate, $connUpdate);
      $Result1 = mysql_query($updateSQL, $connUpdate) or die(mysql_error());
    The values that i want to update in the database are being echoed right before the update script, so the values are correct for dpaid and listedby, i have entered the update bit of the code in the sql in myphp admin and that does update the database. The connection for the database connUpdate is correct. Both fields are "int" in the database and are not primary keys or unique. Any suggestions as to why this update is not working would be much appreciated.
    Thank you in advance.

    No, I don't mean the order of SQL clauses, I mean the order of the two parameters you are using.
    $updateSQL = sprintf("UPDATE detailstable SET dpaid=%s WHERE  listedby=%s",
                                          GetSQLValueString($_POST['listedby'], "int"),
                                          GetSQLValueString($_POST['dpaid'], "int"));
    As I said, I don't know PHP or the sprintf command, but I would assume that it replaces the parameters  (%s) in the order they are listed. Your SQL statement parameters (listedby and dpaid) are in the reverse order. Try switching them.
    $updateSQL = sprintf("UPDATE detailstable SET dpaid=%s WHERE  listedby=%s",
                                          GetSQLValueString($_POST['dpaid'], "int")),
                                         GetSQLValueString($_POST['listedby'], "int");

  • JQuery script not working after DW update

    After updating to the latest DreamWeaver Version 12 build 5861 a jQuery script for collapsible panels no longer works.
    I had used the script many times in the past few years on various sites and when I open the html and php pages I created in the past the script still runs in Live View and as a web page.
    As I mentioned above since I updated to build 5861 the script no longer works for any new pages I create. I used FireFox view source to confirm the links to the jQuery engine and the actual script are correct. I have placed the engine script link above the actual script, as well as deleted additional links to other engines used by other plug-ins.
    Any thoughts would be appreciated.

    I discovered the cause but not the solution.
    After the update and the creation of a new site the first element I created involved a jQuery script and when I went to check it's functionality it failed. I have been mostly obsessing on getting various scripts to work. As I mentioned if I placed the code in the head all was fine, if I linked to a script file it failed and according to FireFox view source the html was linked to the file.
    Well a few minutes ago I bypassed the script issue and placed an image in a document and saw that Dreamweaver wrote the code as a absolute path to the image rather than a relative path.
    Before the update DW accepted a relative path for the scripts such as:
        <script type="text/javascript" src="scripts/diQuery-collapsiblePanel.js"></script>
    After the update I can get the scripts to work if I enter absolute paths:
        <script src="http://localhost/panel/scripts/diQuery-collapsiblePanel.js"></script>
    The funny thing is that the CSS files work fine with relative paths.
    I thought perhaps I set the site up incorrectly and had the links referencing the Site Root instead of the document but thats not the case. It is set to Document and should be creating Relative paths to images.
    I can not see any other Preference settings involving the way paths are written. I would really like to get back to Relative paths for all elements.
    Any thoughts?

  • 10g sql upload not working

    I am using oracle 10g xe for linux and cannot upload sql scripts from the Application Builder home.
    The upload seems to work ok but when i go to edit/run there is
    nothing there. Any one have a sugestion? I am running the latest version
    of 10g. Is this the libaio issue? I select SQL->Upload and fill in info. It even
    creates the icon but does nothing.

    No I can't view them. I logged in as Oracle and tried to upload
    and it did upload but I still could not view them. They ran and I
    could check the results but I still could not view or edit them.
    I logged back in as the user that I am trying to create the script
    for and I got the original problem. It says it uploaded, created the
    icon but I could not run, view, or edit.

  • Script not working in SharePoint content editor webpart

    Hi All,
    <html>
    <head>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script language="javascript" type="text/javascript">
    $(document).ready(function () {
    //Call your function here like
    //retrieveListItems();
    ExecuteOrDelayUntilScriptLoaded(retrieveListItems, "SP.js");
    var siteUrl = '/vceo/PMO/EPMO/';
    var close1 = ''; var close2 = ''; var high = ''; var low = ''; var medium = ''; var lowMedium = ''; var mediumHigh = '';
    var open1 = ''; var open2 = ''; var high1 = ''; var low1 = ''; var medium1 = ''; var lowMedium1 = ''; var mediumHigh1 = '';
    var count = 0; var count1 = 0;
    var initiate = 0; var planning = 0; var execution = 0; var closing = 0;
    var sumMinimal = 0; var sumModerate = 0; var sumCritical = 0; var sumSevere = 0;
    var sumHighlyLikely = 0; var sumLikely = 0; var sumSomewhat = 0; var sumUnlikely = 0;
    var sumBudget = 0; var sumCommitted = 0; var sumConsumption = 0;
    function retrieveListItems() {
    alert("Welcome to Dashboard");
    var clientContext = new SP.ClientContext(siteUrl); alert("site url");
    var oList = clientContext.get_web().get_lists().getByTitle('Project Issues and Risks');
    var oList1 = clientContext.get_web().get_lists().getByTitle('Project');
    var oList2 = clientContext.get_web().get_lists().getByTitle('Risk Impact');
    var oList3 = clientContext.get_web().get_lists().getByTitle('Risk Probability'); alert("get by title");
    var camlQuery = new SP.CamlQuery(); var camlQuery1 = new SP.CamlQuery(); var camlQuery2 = new SP.CamlQuery(); var camlQuery3 = new SP.CamlQuery(); var camlQuery4 = new SP.CamlQuery(); var camlQuery5 = new SP.CamlQuery(); var camlQuery6 = new SP.CamlQuery();
    camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Project_x0020_Issue_x0020_Status" /><Value Type="Choice">Issue</Value></Eq></Where></Query></View>');
    camlQuery1.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Project_x0020_Issue_x0020_Status" /><Value Type="Choice">Risk</Value></Eq></Where></Query></View>');
    camlQuery2.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Overall_x0020_Status" /><Value Type="Choice">Open</Value></Eq></Where></Query></View>');
    camlQuery3.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Overall_x0020_Status" /><Value Type="Choice">Closed</Value></Eq></Where></Query></View>');
    camlQuery4.set_viewXml('<View><Query><Where><IsNotNull><FieldRef Name="Project_x0020_Code" /></IsNotNull></Where></Query></View>');
    camlQuery5.set_viewXml('<View><Query><Where><IsNotNull><FieldRef Name="Project_x0020_Code" /></IsNotNull></Where></Query></View>');
    camlQuery6.set_viewXml('<View><Query><Where><IsNotNull><FieldRef Name="Project_x0020_Code" /></IsNotNull></Where></Query></View>');
    this.collListItem = oList.getItems(camlQuery); this.collListItem1 = oList.getItems(camlQuery1); this.collListItem2 = oList1.getItems(camlQuery2); this.collListItem3 = oList1.getItems(camlQuery3);
    this.collListItem4 = oList2.getItems(camlQuery4); this.collListItem5 = oList3.getItems(camlQuery5); this.collListItem6 = oList1.getItems(camlQuery6);
    clientContext.load(collListItem); clientContext.load(collListItem1); clientContext.load(collListItem2); clientContext.load(collListItem3); clientContext.load(collListItem4); clientContext.load(collListItem5); clientContext.load(collListItem6);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    alert("retrieve list");
    function onQuerySucceeded(sender, args) {
    alert("succeed");
    var listItemEnumerator = collListItem.getEnumerator(); var listItemEnumerator1 = collListItem1.getEnumerator(); var listItemEnumerator2 = collListItem2.getEnumerator();
    var listItemEnumerator3 = collListItem3.getEnumerator(); var listItemEnumerator4 = collListItem4.getEnumerator(); var listItemEnumerator5 = collListItem5.getEnumerator(); var listItemEnumerator6 = collListItem6.getEnumerator();
    var sumClose = 0; var sumClose1 = 0; var sumHigh = 0; var sumMedium = 0; var sumLow = 0; var sumLowMedium = 0; var sumMediumHigh = 0;
    var sumOpen = 0; var sumOpen1 = 0; var sumHigh1 = 0; var sumMedium1 = 0; var sumLow1 = 0; var sumLowMedium1 = 0; var sumMediumHigh1 = 0;
    while (listItemEnumerator.moveNext()) { var oListItem = listItemEnumerator.get_current(); sumClose += oListItem.get_item('Close'); sumOpen += oListItem.get_item('Open'); sumHigh += oListItem.get_item('High'); sumMedium += oListItem.get_item('Medium'); sumLow += oListItem.get_item('Low'); sumLowMedium += oListItem.get_item('LowMedium'); sumMediumHigh += oListItem.get_item('MediumHigh'); }
    while (listItemEnumerator1.moveNext()) { var oListItem1 = listItemEnumerator1.get_current(); sumClose1 += oListItem1.get_item('Close'); sumOpen1 += oListItem1.get_item('Open'); sumHigh1 += oListItem1.get_item('High'); sumMedium1 += oListItem1.get_item('Medium'); sumLow1 += oListItem1.get_item('Low'); sumLowMedium1 += oListItem1.get_item('LowMedium'); sumMediumHigh1 += oListItem1.get_item('MediumHigh'); }
    while (listItemEnumerator4.moveNext()) { var oListItem4 = listItemEnumerator4.get_current(); sumMinimal += oListItem4.get_item('Minimal'); sumModerate += oListItem4.get_item('Moderate'); sumSevere += oListItem4.get_item('Severe'); sumCritical += oListItem4.get_item('Critical'); }
    while (listItemEnumerator5.moveNext()) { var oListItem5 = listItemEnumerator5.get_current(); sumUnlikely += oListItem5.get_item('Unlikely'); sumSomewhat += oListItem5.get_item('Somewhat'); sumLikely += oListItem5.get_item('Likely'); sumHighlyLikely += oListItem5.get_item('HighlyLikely'); }
    while (listItemEnumerator6.moveNext()) { var oListItem6 = listItemEnumerator6.get_current(); sumBudget += oListItem6.get_item('Project_x0020_Budget_x0020_Amoun'); sumCommitted += oListItem6.get_item('Committed_x0020_Budget'); }
    count = this.collListItem2.get_count();
    count1 = this.collListItem3.get_count();
    while (listItemEnumerator2.moveNext()) {
    var oListItem2 = listItemEnumerator2.get_current();
    var stat = oListItem2.get_item('Project_x0020_Status');
    if (stat == "Intiation") {
    initiate = initiate + 1
    if (stat == "Planning") {
    planning = planning + 1
    if (stat == "Execution") {
    execution = execution + 1
    if (stat == "Closing") {
    closing = closing + 1
    //alert("initiate" + initiate); alert("planning" + planning); alert("execution" + execution); alert("closing" + closing);
    //alert("countOpen" + count); alert("closed:" + count1);
    window.close1 = sumClose; window.close2 = sumClose1; window.high = sumHigh; window.low = sumLow; window.medium = sumMedium; window.mediumHigh = sumMediumHigh; window.lowMedium = sumLowMedium;
    window.open1 = sumOpen; window.open2 = sumOpen1; window.high1 = sumHigh1; window.low1 = sumLow1; window.medium1 = sumMedium1; window.mediumHigh1 = sumMediumHigh1; window.lowMedium1 = sumLowMedium1;
    drawChart();
    function onQueryFailed(sender, args) { alert('Request failed.. ' + args.get_message() + '\n' + args.get_stackTrace()); }
    google.load("visualization", "1", { packages: ["corechart"] });
    function drawChart() {
    var data = google.visualization.arrayToDataTable([['Task', 'Issues'], ['Close', window.close1], ['Open', window.open1]]);
    var data1 = google.visualization.arrayToDataTable([['Task', 'Risks'], ['Close', window.close2], ['Open', window.open2]]);
    var data2 = google.visualization.arrayToDataTable([['Program', 'High', 'Medium-High', 'Medium', 'Low-Medium', 'Low'], ['Category', window.high, window.mediumHigh, window.medium, window.lowMedium, window.low]]);
    var data3 = google.visualization.arrayToDataTable([['Program', 'High', 'Medium-High', 'Medium', 'Low-Medium', 'Low'], ['Category', window.high1, window.mediumHigh1, window.medium1, window.lowMedium1, window.low1]]);
    var data4 = google.visualization.arrayToDataTable([['Project', 'Status'], ['Closed', count1], ['Open', count]]);
    var data5 = google.visualization.arrayToDataTable([['Project', 'Status'], ['Initiation', initiate], ['Planning', planning], ['Execution', execution], ['Closing', closing]]);
    var data6 = google.visualization.arrayToDataTable([['Program', 'Impact'], ['Minimal', sumMinimal], ['Moderate', sumModerate], ['Severe', sumSevere], ['Critical', sumCritical]]);
    var data7 = google.visualization.arrayToDataTable([['Program', 'Probability'], ['Highly Likely/Probable(76%-100%)', sumHighlyLikely], ['Likely(51%-76%)', sumLikely], ['Somewhat Likely(26%-50%)', sumSomewhat], ['Unlikely/Improbable(0%-25%)', sumUnlikely]]);
    var data8 = google.visualization.arrayToDataTable([['Project', 'Budget'], ['Approved', sumBudget], ['Committed', sumCommitted]]);
    var options = { title: 'Program Issues', width: 200, height: 300, legend: 'bottom', pieSliceText: 'value', pieStartAngle: 180, };
    var options1 = { title: 'Program Risks', width: 200, height: 300, legend: 'bottom', pieSliceText: 'value', pieStartAngle: 180, };
    var options2 = { width: 200, height: 200, legend: { position: 'top', maxLines: 3 }, bar: { groupWidth: '25%' }, isStacked: true, vAxis: { title: 'Open', titleTextStyle: { color: 'red' } } };
    var options3 = { width: 200, height: 200, legend: { position: 'top', maxLines: 3 }, bar: { groupWidth: '25%' }, isStacked: true, vAxis: { title: 'Open', titleTextStyle: { color: 'red' } } };
    var options4 = { title: 'Project Status', width: 225, height: 300, legend: 'bottom', pieSliceText: 'value', pieStartAngle: 180, };
    var options5 = { width: 175, height: 200, legend: { position: 'top', maxLines: 10 }, pieSliceText: 'value', };
    var options6 = { title: 'Program Risk Impact', width: 300, height: 300, legend: 'right', pieSliceText: 'value', };
    var options7 = { title: 'Program Risk Probable', width: 300, height: 300, legend: 'right', pieSliceText: 'value', };
    var options8 = { title: 'Project Budget', width: 300, height: 300, legend: 'bottom', pieSliceText: 'value', };
    var chart = new google.visualization.PieChart(document.getElementById('chart_div3'));
    chart.draw(data, options);
    var chart1 = new google.visualization.PieChart(document.getElementById('chart_div'));
    chart1.draw(data1, options1);
    var chart2 = new google.visualization.ColumnChart(document.getElementById('chart_div1'));
    chart2.draw(data2, options2);
    var chart3 = new google.visualization.ColumnChart(document.getElementById('chart_div2'));
    chart3.draw(data3, options3);
    var chart4 = new google.visualization.PieChart(document.getElementById('chart_div4'));
    chart4.draw(data4, options4);
    var chart5 = new google.visualization.PieChart(document.getElementById('chart_div5'));
    chart5.draw(data5, options5);
    var chart6 = new google.visualization.PieChart(document.getElementById('chart_div6'));
    chart6.draw(data6, options6);
    var chart7 = new google.visualization.PieChart(document.getElementById('chart_div7'));
    chart7.draw(data7, options7);
    var chart8 = new google.visualization.ColumnChart(document.getElementById('chart_div8'));
    chart8.draw(data8, options8);
    </script>
    </head>
    <body>
    <table >
    <tbody>
    <tr>
    <td id="chart_div8" colspan="2" style="border-bottom:ridge;border-left:ridge;border-top:ridge"></td>
    <td id="chart_div4" style="border-bottom:ridge;border-left:ridge;border-top:ridge"></td>
    <td id="chart_div5" style="border-bottom:ridge;border-right:ridge;border-top:ridge"></td>
    </tr>
    <tr>
    <td id="chart_div" style="border-bottom:ridge;border-left:ridge;"></td>
    <td id="chart_div2" style="border-bottom:ridge;"></td>
    <td id="chart_div3" style="border-bottom:ridge;border-left:ridge;"></td>
    <td id="chart_div1" style="border-bottom:ridge;border-right:ridge""></td>
    </tr>
    <tr>
    <td id="chart_div6" colspan="2" style="border-bottom:ridge;border-left:ridge;"></td>
    <td id="chart_div7" colspan="2" style="border-bottom:ridge;border-left:ridge;border-right:ridge"></td>
    </tr>
    </tbody>
    </table>
    </body>
    </html>
    This content editor webpart not working in sharepoint page. Once I checked out to the page then chart is working. When i checkedin function not get called. How to fix this?
    THanks in advance!

    In SharePoint 2013, sp.js and sp.runtime.js does not load on the page in published mode. You need to explicitly load these files. You can check using IE developer tools in the Script section that in published mode these files are missing.
    In order to fix this issue explictly refer these two js files on your page.
    <script type="text/javascript" src="_layouts/15/sp.runtime.js"></script>
    <script type="text/javascript" src="_layouts/15/sp.js"></script>
    Geetanjali Arora | My blogs |

  • Insert SQL does not work properly when called using CALL

    I have a stored procedure (TEST_SP) which is used to insert a record in this perticular case. The SQL statement is 2526 characters long. I'm using
    dim Params : Params=chr(1) & "Insert query" & Chr(1) & "=300"
    runsql=&"{call TEST_SP(?,?)}"&Params 
    dim db : db=dbSelect("",0,"","")
    dbExecSQL db,runsqlto execute the stored procedure. I'm facing an issue when the 2000th character on the insert SQL (pUPDSQL) is a single quote, where the SQL is not getting executed (i.e. record is not getting created).
    The same stored procedure and the same SQL when run as below
    runsql=runsql&"DECLARE "
    runsql=runsql&"PUPDSQL VARCHAR2(4000); "
    runsql=runsql&"PRES VARCHAR2(300); "
    runsql=runsql&"BEGIN "
    runsql=runsql&"PUPDSQL := 'INSERT query..."
    runsql=runsql&"PRES:=300; "
    runsql=runsql&"MRT_LKIDFULUP(PUPDSQL => PUPDSQL,PRES => PRES); "
    runsql=runsql&"END; "
    dim db : db=dbSelect("",0,"","")
    dbExecSQL db,runsqlis working fine. Does anyone know if there is a limitaion in ODBC Call function or any explanation to above behaviour? I'm connecting to a Oracle 11g database using Microsoft ODBC for Oracle driver on Window 7
    The stored procedures:
    create or replace procedure TEST_SP(pUPDSQL IN VARCHAR2,pRES OUT VARCHAR2)
    AS
    BEGIN
    DECLARE
      emsg VARCHAR2(100);
    BEGIN
    if pUPDSQL&lt;&gt;'-1' then
      emsg:='Cant exec UPDATE';
      EXECUTE IMMEDIATE pUPDSQL;
        if SQL%RowCount=0 then
        pRES:='ERR:No row updated';
        return;
      end if;
    end if;
    pRES:='OK:';
    EXCEPTION
      WHEN OTHERS THEN
       pRES:='ERR:' || emsg;
    END;
    END;Edited by: BluShadow on 11-Dec-2012 15:47
    added {noformat}{noformat} tags for readability.  Please read {message:id=9360002} and learn to do this yourself in future.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    ... I'm facing an issue when the 2000th character on the insert SQL (pUPDSQL) is a single quote, ...Perhaps you need two single quotes? like:
    runsql=runsql&"PUPDSQL := 'INSERT query...Values(..,..,,,''This value in two single quotes'',..,...)' "
    ... I'm connecting to a Oracle 11g database using Microsoft ODBC ...Dump windoze ODBC and better use the Oracle client ODBC.
    :p

  • PL/SQL program not working when connect database via SqlNet

    Hi,
    This is a segment of a PL/SQL program before opening a cursor using input descriptor. It is working fine ( to get the value of unOutputCount ) without connect to a database via SqlNet, can anyone tell me why it is not working ( unOutputCount return 0)while connecting to a database via SqlNet and how to make it work without opening a cursor before DESCRIBE OUTPUT ...?
    EXEC SQL ALLOCATE DESCRIPTOR GLOBAL 'input_111'
    WITH MAX 100;
    EXEC SQL ALLOCATE DESCRIPTOR GLOBAL 'output_111'
    WITH MAX 100;
    EXEC SQL PREPARE STMT1 FROM :psSqlStatement;
    EXEC SQL DECLARE CURSOR1 CURSOR FOR STMT1;
    EXEC SQL DESCRIBE INPUT STMT1
    USING DESCRIPTOR GLOBAL 'input_111';
    /* Get count of input parameters in statement */
    EXEC SQL GET DESCRIPTOR GLOBAL 'input_111' :unInputCount = COUNT;
    EXEC SQL DESCRIBE OUTPUT STMT1
    USING DESCRIPTOR GLOBAL 'output_111';
    /* Get count of output parameters in statement */
    EXEC SQL GET DESCRIPTOR GLOBAL 'output_111'
    :unOutputCount = COUNT;

    Hi,
    Welcome to Oracle OTN Forums!
    I changed your code a little. I think this help you
    CREATE OR REPLACE
    PROCEDURE xx_test
    IS
      v_pid VARCHAR2(100);
      v_cn  VARCHAR2(100);
      v_id  VARCHAR2(1000);
      v_val VARCHAR2(1000);
      CURSOR C1
      IS
        (SELECT product_id, 'PRODUCT_ID'  cn
            FROM product1 );
      BEGIN
        FOR V1 IN C1
        LOOP
          FETCH C1 INTO v_pid, v_cn;
          dbms_output.put_line('==== '||v_pid||'==== '||v_cn);
          EXECUTE IMMEDIATE
          'SELECT product_id, DECODE(COUNT (product_id),1,MAX (product_id))||'''||V_CN||''' as val
            FROM product1
           WHERE product_id =:a
           GROUP BY product_id)' INTO v_id, v_val USING v_pid;
          dbms_output.put_line('==== '||v_id||'==== '||v_val);
          EXECUTE IMMEDIATE 'UPDATE product2 SET '||v_cn||' = ' ||''''|| v_val ||''''|| ' WHERE product_id = :b' USING v_pid;
          dbms_output.put_line('++++ '||v_cn||'++++ '||v_val||'++++ '||v_pid);
        END LOOP;
      END xx_test;

  • My first PL/SQL block not working with using Select query within begin

    I am new to PL/SQL , just started with basics of BLOCKS .
    I am having a query here in executing a block .
    When i am doing a insert oprtation in Blocks Begin method everything is working fine , but when ever i tried to do select operation , some error is being thrown .
    First of all This is my Table :
    select from try :*
    KEY      VALUE
    Key     Value
    Key1     Value1
    Key2     Value2
    Key3     Value3
    ======================
    This is the code which is not working : Please see the code and tell me what is the problem .
    DECLARE
    v_KEY    VARCHAR2(20);
    v_VALUE   VARCHAR2(20);
    BEGIN
    select key into v_KEY FROM try where v_value='Value' ;
    dbms_output.put_line(v_KEY);
    END;
    When i run this code , it is saying Data Not Found on this line " select key into v_KEY FROM try where v_value='Value' ;"
    wheer when i run tis individually it worked fine :
    select KEY FROM try where VALUE='Value' ;"
    please share your ideas .as why it isn't running ??
    Edited by: user10503747 on Sep 20, 2010 3:16 AM

    Hi,
    user10503747 wrote:
    I am new to PL/SQL , just started with basics of BLOCKS .
    I am having a query here in executing a block .
    When i am doing a insert oprtation in Blocks Begin method everything is working fine , but when ever i tried to do select operation , some error is being thrown .
    First of all This is my Table :
    select from try :*
    KEY      VALUE
    Key     Value
    Key1     Value1
    Key2     Value2
    Key3     Value3
    ======================
    This is the code which is not working : Please see the code and tell me what is the problem .
    DECLARE
    v_KEY    VARCHAR2(20);
    v_VALUE   VARCHAR2(20);
    BEGIN
    select key into v_KEY FROM try where v_value='Value' ;
    dbms_output.put_line(v_KEY);
    END;
    When i run this code , it is saying Data Not Found on this line " select key into v_KEY FROM try where v_value='Value' ;"
    wheer when i run tis individually it worked fine :
    select KEY FROM try where VALUE='Value' ;"
    please share your ideas .as why it isn't running ??
    Edited by: user10503747 on Sep 20, 2010 3:16 AMInstead of:
    {code}
    select key into v_KEY FROM try where v_value='Value' ;
    {code}
    perhaps you meant something like:
    {code}
    v_value := 'Value1';
    select key into v_KEY FROM try where v_value=Value ; -- No quotes
    {code}
    Until you assign a vlue to a variable, like v_value, it is NULL, so your original statement was equivalent to
    {code}
    select KEY FROM try where NULL='Value' ;
    {code}
    In PL/SQL, a SELECT ... INTO statement must return exactly one row, or else you will get an error (either NO_DATA_FOUND or TOO_MANY_ROWS). This is different from SQL, where a query cn return any number of rows, including 0, without raising an error.

  • Inline transform for Sql Query not working in SAP MII 12.1 Version 12.1.8 B

    Hi All,
    I applied an xslt for an sql query which returns an xml file.
    I used inline transform icon in sql query to load an xsl file which has to return me a string
    Any idea why is not working for me..?
    My Sample XML file:
                                     <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="/XMII/CM/BatchDisposition/BatchQueueManagement/StyleSheets/ProductXsl.xsl"?>
    <Rowsets DateCreated="2011-05-05T07:27:45" EndDate="2011-05-05T07:27:45" StartDate="2011-05-05T06:27:45" Version="12.1.8 Build(20)">
         <Rowset>
              <Columns>
                   <Column Description="ProductName" MaxRange="1" MinRange="0" Name="ProductName" SQLDataType="12" SourceColumn="ProductName"/>
              </Columns>
              <Row>
                   <ProductName>Asprin 100mg Tablets 12 x10 strip</ProductName>
              </Row>
              <Row>
                   <ProductName>Asprin 300mg Tablets 12 x10 strip</ProductName>
              </Row>
              <Row><ProductName>Ibprooven 200mg Tablets 12 x 10 strip</ProductName></Row>
              <Row><ProductName>RipTide 50mg Tablets 40 x10 strip</ProductName></Row>
              <Row><ProductName>Seroquel 200mg Tablets 6 x10 strip</ProductName></Row>
              <Row><ProductName>Seroquel 400mg Tablets 12 x10 strip</ProductName></Row>
         </Rowset>
    </Rowsets>
    My Sample XSl File:
                                    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
         <xsl:text>["</xsl:text>
         <xsl:for-each select="Rowsets/Rowset/Row">
              <xsl:value-of select="ProductName"/>
              <xsl:if test="position() &lt; last()">
                   <xsl:text>","</xsl:text>
                    </xsl:if>
              <xsl:if test="position()=last()">
                           <xsl:text>"]</xsl:text>
                    </xsl:if>
         </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    Any Suggestions  are Welcome:
    Thanks

    Something like this should work...
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:template match="/">
              <Rowsets DateCreated="{Rowsets/@DateCreated}" Version="{Rowsets/@Version}" StartDate="{Rowsets/@StartDate}" EndDate="{Rowsets/@EndDate}">
                   <xsl:copy-of select="/Rowsets/FatalError"/>
                   <xsl:copy-of select="/Rowsets/Messages"/>
                   <Rowset>
                   <Columns>
                        <Column Description="Mycol1" MaxRange="1" MinRange="0" Name="Mycol1" SQLDataType="12" SourceColumn="Mycol1" />
                   </Columns>
                   <Row>
                   <Mycol1>
                   <xsl:text>["</xsl:text>
                        <xsl:for-each select="/Rowsets/Rowset/Row">
                             <xsl:value-of select="." />
                             <xsl:choose>
                                  <xsl:when test="position() &lt; last()"><xsl:text>","</xsl:text></xsl:when>
                                  <xsl:otherwise><xsl:text>"]</xsl:text></xsl:otherwise>
                             </xsl:choose>
                        </xsl:for-each>
                   </Mycol1>
                   </Row>
                   </Rowset>
              </Rowsets>
         </xsl:template>
    </xsl:stylesheet>

  • Simple button script not working

    I am using AS2 and need help figuring out why this simple button script is not working:
    stop();
    buttonWS1.onRelease = function(){
                        gotoAndStop("Stage1and2_Boss",4);
    buttonWS2.onRelease = function(){
                        nextFrame();
    //end
    My buttons are the square letter-puzzles below. They are images that I converted to "symbols" (specifically, buttons). I put their names as above (buttonWS1, buttonWS2, etc.) in the "instance names" boxes.
    I have no idea what is going on. Please help!

    Hi -
    1. Yes, buttonWS2 is the instance name
    2. The only code attached to it is the code I pasted above.
    3. onRelease does not execute because my trace statement does not appear in the output
    Here is the modified code for buttonWS2:
    buttonWS2.onRelease = function(){
                        trace("clicked!");
                        nextFrame();
    Question: It shouldn't matter if I have commented-out code within that set of codes should it?:
    buttonWS2.onRelease = function(){
              //if (puzzleschosenarray[0] == 2 || puzzleschosenarray[1] == 2) {
              // cannot be chosen -- make button non-functional
              //else{
                        //puzzleschosenarray[roundnumber-1] = 2;
                        trace("clicked!");
                        nextFrame();

Maybe you are looking for