How can I use a button to trigger a SQL Stored Procedure?

I have a stored procedure (UpdateAdsUsers) that performs updates on multiple tables all tied together with one
parameter - @username
(I'm using DWCS5, SQL SERVER 2008, ASP VB)
UPDATE users SET defaultview='0' WHERE user_name=@username
UPDATE db_settings SET valuestr='MM/DD/YYYY' WHERE keyword='dateformat' AND user_name=@username
UPDATE db_settings SET valuestr='Y' WHERE keyword='COPY_MSG_VIA_EMAIL' AND user_name=@username
UPDATE db_settings SET valuestr='4' WHERE keyword='web_download_rend' AND user_name=@username
UPDATE db_settings SET valuestr='Y' WHERE keyword='cpy_confirm' AND user_name=@username
UPDATE db_settings SET valuestr='WLPG:12' WHERE keyword='INITIAL_ASSETS' AND user_name=@username
UPDATE db_settings SET valuestr='20' WHERE keyword='thumb_disp_row' AND user_name=@username
UPDATE db_settings SET valuestr='20' WHERE keyword='text_disp_row' AND user_name=@username
UPDATE db_settings SET valuestr='5' WHERE keyword='para_disp_row' AND user_name=@username
UPDATE db_settings SET valuestr='a.editorial.company_name' WHERE keyword='sortorder1' AND user_name=@username
UPDATE db_settings SET valuestr='a.editorial.title' WHERE keyword='sortorder2' AND user_name=@username
UPDATE db_settings SET valuestr='a.editorial.production_type' WHERE keyword='sortorder3' AND user_name=@username
UPDATE tnailview_fields SET rendition='1', first_field='company_name', second_field='title', third_field='adsx_type', fourth_field='adsx_status' WHERE user_name=@username
UPDATE textview_fields SET rendition='1', first_field='company_name', second_field='title', third_field='title_desc', fourth_field='production_type', fifth_field='audio_summary', sixth_field='totalruntime', seventh_field='adsx_type', eighth_field='adsx_status' WHERE user_name=@username
UPDATE paraview_fields SET rendition='1', first_field='company_name', second_field='title', third_field='title_desc', fourth_field='production_type', fifth_field='audio_summary', sixth_field='totalruntime', seventh_field='adsx_type', eighth_field='adsx_status' WHERE user_name=@username
SELECT * FROM adsx_preferences WHERE user_name=@username
This functions perfectly in SQL.
Using Dreamweaver CS5, I've added the Procedure as a Command (ADS_User) with the one variable (@username).
<%
set ADS_User = Server.CreateObject("ADODB.Command")
ADS_User.ActiveConnection = MM_ADSX_STRING
ADS_User.CommandText = "dbo.UpdateAdsUser"
ADS_User.Parameters.Append ADS_User.CreateParameter("@RETURN_VALUE", 3, 4)
ADS_User.Parameters.Append ADS_User.CreateParameter("@username", 129, 1,32,ADS_User__username)
ADS_User.CommandType = 4
ADS_User.CommandTimeout = 0
ADS_User.Prepared = true
ADS_User.Execute()
%>
In a perfect world, either an image click or a form submit would run the procedure.  The parameter (@username) is currently sent to the page as a URL Querystring of the same name.
I'm sure it's something obvious, but I'm new.
Thanks in advance

I'm not sure what your question is. Is this currently failing? Or are you not able to figure out how to send the username to the script page? You really just need to create a form and pass the value in a form field.
>The parameter (@username) is currently sent to
>the page as a URL Querystring of the same name.
Never use a querystring to update data. It is too dangerous. Use the post method instead.

Similar Messages

  • How can I use the button in one panel to control the other panel's appearing and disappearing?

    How can I use the button in one panel to control the other panel's
    appearing and disappearing? What I want is when I push the button on
    one button . another panel appears to display something and when I
    push it again, that the second panel disappears.

    > How can I use the button in one panel to control the other panel's
    > appearing and disappearing? What I want is when I push the button on
    > one button . another panel appears to display something and when I
    > push it again, that the second panel disappears.
    >
    You want to use a combination of three features, a button on the panel,
    code to notice value changes using either polling in a state machine of
    some sort or an event structure, and a VI Server property node to set
    the Visible property of the VI being opened and closed.
    The button exists on the controlling panel. The code to notice value
    changes is probably on the controlling panel's diagram, and this diagram
    sets the Visible property node of a VI class property node to FALSE or
    TRUE to show or
    hide the panel. To get the VI reference to wire to the
    property node, you probably want to use the Open VI Reference node with
    the VI name.
    Greg McKaskle

  • How can I implement the connection pool in my java stored procedure

    my java stored procedures (in database 'B') have to connect to another oracle database ,let's say 'A'. And how can I implement the behavior like the so-called connection pool in my java stored procedure in 'B', as below.
    1. database B, has 2 java stored procedures sp1 and sp2
    2. both sp1 and sp2 connects to databse 'A'
    whatever I call the sp1 and sp2 and the database 'A' always only one connected session from sp1 and sp2 in database 'B'.
    THANKS A LOTS...

    my problem is I have a lots of java stored procedures need to cnnect to the remote oracle db, and I hope the remote db can only have a connected session from my java stored procedures in my local db. I try as below
    class sp{
    static Connection conn=null; //the remote db connection,
    public static void sp1(){...}//procedure 1, using conn
    public static void sp2(){...}//procedure 2, using conn,too
    I can 'see' the 'conn' variable if I invoke the sp1() and sp2() from the same client application(maybe sqlplus). But if I invoke the sp1() from client 'A' and invoke sp2() from client 'B' then the sp1() and sp2() can not see the 'conn' variable for each other. I think it's because the two clients cause oracle to create two instances of the class 'sp' and the sp1() and sp2() located in different instance seperately. Thus the sp1() and sp2() can not see 'conn' for each other. They can only see its own 'conn'.
    To connect to the remote db from the java stored procedure is easy but is it possible to connect to the remote db via database link from the java stored procedure at my local db ? If so, then I also archive my goal .
    BTW , thanks a lots...
    andrew :-)

  • How can we use CMC / events to trigger a process?

    Is there a way we can make CMC / events to trigger a stored procedure or at least a .exe file?
    how?

    There's a starter on events here:
    http://scn.sap.com/community/bi-platform/blog/2013/01/07/cmcevents-in-business-objects-and-its-usage
    Not sure exactly of your workflow, but you can also schedule a custom program object and schedule that to run based on your own timelines.
    http://scn.sap.com/docs/DOC-40837

  • How can I use the latest Berkeley DB with SQL API in PHP app?

    Hi,
    I'm a PHP developer and I already use Berkeley DB in my applications using the [DBA Functions|http://www.php.net/manual/en/ref.dba.php] . I'm very interested in the latest Berkeley DB release. How can I write a PHP program that uses the SQL API of the latest Berkeley DB release?

    Hi Kurt,
    I'm not a PHP expert (far from it), but the simplest way to get started with the Berkeley DB SQL interface is to run Berkeley DB's <tt>configure</tt> script with the <tt>--enable-sql_compat</tt> flag.  This will create a library called <tt>libsqlite3.so</tt> that you can use as a drop-in replacement for SQLite at the API level.  Database files still need to be converted with a SQLite <tt>.dump</tt> followed by a <tt>.read</tt> with the <tt>dbsql</tt> tool.
    This should then allow the existing PHP driver and application code to switch over to Berkeley DB without any code changes by setting <tt>LD_LIBRARY_PATH</tt> to find the Berkeley DB version of <tt>libsqlite3.so</tt> ahead of SQLite. Note that any other code that relies on SQLite will also run against Berkeley DB with this configuration, which can cause problems if the system libraries use SQLite (for example, on Mac OS X). For that reason, a better long term solution would be for the PHP SQLite driver to have a mode where it loads <tt>libdbsql.so</tt> rather than <tt>sqlite3.so</tt>.
    I hope this helps, please let us know how you go because I'm sure lots of other PHP developers will be interested in the answer.
    Regards,
    Michael Cahill, Oracle Berkeley DB.

  • How can i create a Global Temporary Table inside a Stored Procedure....

    Hi...
    I need to create a Global Temporary Table inside a Stored
    Procedure....
    I have no idea how to do that....
    Please....if u can send me a sample, send to me....
    Thanks a lot

    To create a global temporary table inside a stored procedure,
    the minimal syntax would be:
    CREATE OR REPLACE PROCEDURE procedure_name
    AS
    BEGIN
    EXECUTE IMMEDIATE 'CREATE GLOBAL TEMPORARY TABLE table_name'
    || '(column_name NUMBER)';
    END procedure_name;
    As Todd stated, it would probably be better to create the global
    temporary table outside of the procedure:
    SQL> CREATE GLOBAL TEMPORARY TABLE table_name
    2 (column_name NUMBER);
    Table created.
    You can also specify things like ON COMMIT PRESERVE ROWS or ON
    COMMIT DELETE ROWS.
    It may be that there is something else, like a PL/SQL table of
    records or a cursor, that would suit your needs better. It is
    difficult to guess without knowing what you want to do with it.

  • How to get multiple out parameters from a pl/sql stored procedure in ADF Jdeveloper 11g release2

    I´m trying to call from AppModuleImpl a stored procedure from my oracle DB which receives one input parameter and returns 5 out parameters. 
    I´m using jdeveloper 11g release2  ADF and I have created a java bean "ProRecallPlatesBean " with the atributes and accesors and I serialize it. just like in this article http://docs.oracle.com/cd/E24382_01/web.1112/e16182/bcadvgen.htm#sm0297
    This is my code so far:
    public ProRecallPlatesBean getCallProRecallPlates(String numPlates) {
    CallableStatement st = null;
    try {
              // 1. Define the PL/SQL block for the statement to invoke
              String stmt = "begin CTS.Pk_PreIn.proRecallPlates(?,?,?,?,?,?); end;";
              // 2. Create the CallableStatement for the PL/SQL block
              st = getDBTransaction().createCallableStatement(stmt,0);
              // 3. Register the positions and types of the OUT parameters
              st.registerOutParameter(2,Types.VARCHAR);
    st.registerOutParameter(3,Types.VARCHAR);
    st.registerOutParameter(4,Types.VARCHAR);
    st.registerOutParameter(5,Types.VARCHAR);
    st.registerOutParameter(6,Types.VARCHAR);
    // 4. Set the bind values of the IN parameters
    st.setString(1,numPlates);
    // 5. Execute the statement
    st.executeUpdate();
    // 6. Create a bean to hold the multiple return values
    ProRecallPlatesBean result = new ProRecallPlatesBean();
    // 7. Set values of properties using OUT params
    result.setSpfVal(st.getString(2));
    result.setTransportTypeVal(st.getString(3));
    result.setTransportCompanyVal(st.getString(4));
    result.setCompanyDescrVal(st.getString(5));
    result.setDGAPrint(st.getString(6));
    // 8. Return the result
    return result;
    } catch (SQLException e) {
    throw new JboException(e);
    } finally {
    if (st != null) {
    try {
    // 9. Close the JDBC CallableStatement
    st.close();
    catch (SQLException e) {}
    In Jdeveloper I went into AppModule.xml JAVA>Client Interface section and expose "getCallProRecallPlates" Then I can see "getCallProRecallPlates" in Data Controls, I drag and drop it to a JSF page, an input text component and a button are generated in order to put in there the procedure input parameter (numPlates).
    I don't know if I'm on the right track.
    When I click the button, the "result" variable is supposed to be filled with data from the stored procedure. I want each of those values to be displayed in Output text or input text adf components but I dont know how. Thank you very much in advance I´m a newbie and i'll appreciate your help!

    What version are you on?
    Works fine for me on my 11g:
    SQL> create or replace procedure testxml (clob_out out clob)
      2  is
      3     l_clob   clob;
      4     l_ctx    dbms_xmlquery.ctxhandle;
      5  begin
      6     l_ctx := dbms_xmlquery.newcontext ('select * from dual');
      7     l_clob := dbms_xmlquery.getxml (l_ctx);
      8     clob_out := l_clob;
      9     dbms_xmlquery.closecontext (l_ctx);
    10  end testxml;
    11  /
    Procedure created.
    SQL>
    SQL> variable vout clob;
    SQL>
    SQL> exec testxml (:vout)
    PL/SQL procedure successfully completed.
    SQL>
    SQL> print vout
    VOUT
    <?xml version = '1.0'?>
    <ROWSET>
       <ROW num="1">
          <DUMMY>X</DUMMY>
       </ROW>
    </ROWSET>But definitely you can optimize your proc a bit: Try
    create or replace procedure testxml (clob_out in out nocopy clob)
    is
       l_ctx    dbms_xmlquery.ctxhandle;
    begin
       l_ctx := dbms_xmlquery.newcontext ('select * from dual');
       clob_out := dbms_xmlquery.getxml (l_ctx);
       dbms_xmlquery.closecontext (l_ctx);
    end testxml;
    /

  • How can I use 3 buttons to control the transitions of my case structure?

    Hi everyone,
    Hopefully this will be an easy fix... Although I cannot seem to work it out??
    I am building a state machine inside a while-loop with the following states:
    1. System idle.
    2. Self-cal pci card.
    3. Run DAQ and do my processing.
    4. Stop the vi.
    I can do this using a enum no problems (with state 1. System idle as the initialising state for the while-loop)... But I really want to have is 4 buttons on the front panel, one for each of the 4 states, so that all the user needs to do is press the button corresponding to the state they want and the appropriate transition ocurrs... For example, when the vi first runs, the idle state is operating... When the user is ready can then hit button 2 for a self-cal... Is self-cal is ok, they hit button 3 for DAQ... Once the DAQ is finished the user can hit button 4 to stop the vi..
    My problem is that I need the current button to unlatch when another button is hit...
    Any suggestions?... This is killing me!
    Thanks,
    Jack
    Solved!
    Go to Solution.

    Here's what I had in mind. You can easily add conditions so code only executes once after a control change, for example.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    radiobuttons.vi ‏9 KB

  • How can I use Migration Assistant to read a backup stored in a folder on an external drive?

    My MacBook Pro (Mountain Lion) died on me. I removed the hard drive and copied all the folders under my /User/stewart to an external hard drive.
    I have an IMac which has just been upgraded to Mavericks. I want to transfer some of the data from my MacBook Pro to the iMac. I want to transfer my email from the MacBook Pro to the iMac, including:
    - All stored emails
    - All account settings
    I assumed that migration assistant could do this for me. But when I tried to use it, there was no option to read from a disk that wasn't a Time Machine backup or a startup disk.
    Is there any way I can move just the email onto teh Mavericks machine.
    The Macbook Pro is just about to be shipped off for repair. I could get the disk out of it again and then run Migration Assistant with it. It would be very time consuming as I don't have it with me at the moment.
    So I am hoping someone can help me with a quicker way.
    Many thanks in advance.

    Migration Assistant will recover data from a system disk or a Time Machine backup.
    Since you moved the files yourself to the external drive, you are going to have to move what you have back yourself.
    The files for email are stored in ~/Library/Mail. Since you did not copy them to the external, your emails are now lost.
    The same goes for your account settings.
    Allan

  • How can I write to a (external)file from a stored procedure

    I want to write some data to a (external) file. I have it working with the function UTL_FILE.
    My problem is I want to write to a file on a mapped drive (so a drive on a different machine). This is not working.
    Does anyone know a way to build this.
    Please send your responses to [email protected]
    Many thanks,
    Alex Nagtegaal

    an extraction out of expert one-on-one from Thomas Kyte
    <quote>
    when an oracle istance is created the services that support it are setup to 'log on as' the system (or operating system) account, this account has very few privileges and no acces to Window NT Domains. To access another Windows NT machine the OracleServiceXXXX must be setup to logon to the appropriate Windows NT Domain as a user who has acces to the required location for UTL_FILE.
    To change the default logon for the Oracle services go to (in Windows NT):
    Control Panel | Services | OracleServiceXXXX | startup | log on as; (where XXXX is the instance name)
    In Windows 2000, this would be:
    Control Panel | Administrative Tools | Services | OracleServiceXXX | Properties | Log on tab; (again XXXX is the instance name)
    Choose the This Account radio button, and then complete the appropriate domain login information. ONce the services have been setup as a user with the appropriate privileges, ther are two options dfor setting UTL_FILE_DIR:
    * Mapped Dirve: To use a mapped drive, the user that the service starts as must have setup a drive to match UTL_FILE_DIR and be logged onto the server when UTL_FILE is in use.
    * Universal Naming Convention: UNC is preferable to Mapped Drives because it does not require anyone to be logged on and utl_file_dir should be set to a name in the form \\<machine name>\<share name>\<path>
    You will of course need to stop and restart Oracle after changing the properties of the service.
    <\quote>
    I want to write some data to a (external) file. I have it working with the function UTL_FILE.
    My problem is I want to write to a file on a mapped drive (so a drive on a different machine). This is not working.
    Does anyone know a way to build this.
    Please send your responses to [email protected]
    Many thanks,
    Alex Nagtegaal

  • How can I use the media Buttons on my M40X with WinAmp?

    Hello
    Today I got my M40X and i have a question.
    There are 5 media Button left of the keybord (CD/DVD, Play/pause, Stop, <-/->)
    Is it possible to use them with WinAmp?
    In the Toshiba Assist i got the CD/DVD button used to start WinAmp (by use him to start a .exe) but the Play/pause...dont work. In the field media Apps the only Player i can choose is Win MP10 (I hate this piece of sh*t).
    How can I use these Button with WinAmp?

    Hello
    As far as I know the Toshiba Controls were tested and designed only for Microsoft Media Player and WinDVD. How this topic says:
    http://forums.computers.toshiba-europe.com/forums/thread.jspa?threadID=3621&messageID=11461#11461
    I dont have any experience with WinAmp but I found useful info in this forum about this theme:
    http://forums.computers.toshiba-europe.com/forums/thread.jspa?threadID=6673&messageID=24448#24448
    Check this.
    Bye

  • How can I get next button in preview app

    Hi,
    How can I use next button in preview app. Means in one folder I have 10 photos and I want to open each photo to view in preview app. Or any other options to use the next button , plz help
    Yas

    If you open all 10 at once in Preview, they will open together and there will be a filmstrip along the side for navigation.
    Or, if you select all 10 in the Finder and simply open QuickLook (File/QuickLook or press spacebar shortcut), you will see Previous/Next buttons in the top left corner without having to open any programs.

  • How can i use Button in BEx  7.0

    Dear Folks,
    Could you help me please ..
    In BI 7.0, for BEx analyzer i see we can use button, combo box, analysis grid.
    If i have a requirement like this:
    1. I have sales report, where it has information about sales person.
    2. And i want to filter that report with the sales person that i choose from combo box.
    For that requirement, i tried to :
    1. I Create a query to Sales info-provider for displaying sales.
    2. I Create a query to either to MD Sales person / Sales info-provider in order to get Sales persons data.
    3. I assign point no 1 to Analysis Grid.
    4. I assign point no 2 to Combo box.
    My questions are:
    a. Is my techniques correct ??
    b. How can i use button to execute filter into the corresponding report ???
    c. Is there any tutorial regarding this ?? Could you share it to me please ..
    Really need your guidances..
    regards,
    Niel..

    Hi Niel,
    You can use the method you specified.
    In Bex Analyzer you have design mode where you can have the following items Button, Analysis Grid and Combo box.
    To work with the button you need to use the Command Wizard which consists of pre-defined functions, out of those select the one which suits your requirement and supply the parameters. As it is done thorugh a Wizard it would be easy to do.
    Also,
    The Button Name displays the name of the button, which is generated automatically and is unique. This name is used on the BEx Analyzer Design Toolbar menu to refer to a particular instance of the button.
    · Range u2013 Manipulate coordinates for a cell or cells in this field to move or resize the button.
    · Button Text - The text (caption) you want to display on the button. You can use this to describe the command the button executes.
    · Command Range (optional) - Specify a three-column range of cells in the worksheet that contains command parameters. In these cells, you provide the same parameters (Name, Index, and Value) as in the Static Parameters, but in the worksheet these can be variable, changing during
    navigation based on query results or on a value you manually specify.
    Button in Bex analyzer
    Regards,
    Neelesh Jain.

  • How can we prevent back button  using java script

    how can we prevent back button using java script

    Would be quicker for you to google for javaScript
    javascript:window.history.forward(-1);

  • My iphone 4 button doesn't work. How can I use my phone without that working button?

    my iphone 4 button doesn't work. How can i use my iphone without the working button?

    Well if you restore your iPad that might work. If its a software issue, it might solve it. If that doesn't work, it might be a hardware issue that apple can fix.

Maybe you are looking for

  • Issue with 1231 AP's rebooting

    On one site we have 12 cisco AIR-AP1231G-E-K9 AP's running IOS Version 12.3(2)JA4. They are accessing a variety of applications from RF scanning to PDA's. this is standard across the company but we are having problems with 10 of these rebooting due t

  • Opening OA page in new window using Image Bean

    Hi All, We have a requirement to open a new window in one of our application. It is working when I use a link but I am not able to achieve the same functionality with an image bean. Is it possible to achieve this using an image bean? Thanks in advanc

  • How can I capture video directly into FCP without recording to tape first?

    I hooked my Sony VX2000 to the computer via firewire and opened the Log and Capture dialog box. The video from my camera shows correctly in the preview window. I click the Capture Now button and the capture window opens but no video displayed. The me

  • I can, connect my ipad to get mail

    I can't configure my ipad to work with yahoo mail

  • Iphone pre order SUCKS

    Ordered on the 3rd, yet I still have no information about when or even IF my phone will be coming.  Not a single business customer has received shipping information yet millions of consumers have their phone.  You did this to us with the Droid INC to