Once again:  Does MySQL allow multiple querys in one database transaction???

Hello to ALL!!!
The problem is:
I'm trying to make simple query (database: "myDB" (engine:
myisam/innodb - doesn't mater) with one table: "Info" with two
columns: "Id" (autoinc), "info_c" (varchar):
<cfif structkeyexists (form, "name")>
<cfquery datasource="myDB" name="qDB" >
INSERT into Info (info_c)
VALUES ('#form.name#');
SELECT @@identity AS Id
</cfquery>
</cfif>
<cfform>
<cfinput type="text" name="name">
<cfinput type="submit" name="submit">
</cfform>
BUT after "Submit" I get:
Error Executing Database Query.
You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to
use near '; select @@identity as Id' at line 2
Please, tell me WHY???
I have:
MySQL
Server information:
MySQL version: MySQL 5.1.25-rc-community via TCP/IP
Clent Information:
Version: MySQL client version 5.1.11
Coldfusion Version Information:
Version 8,0,0,176276
Great THANKS for your answers!!!

> SELECT @@identity AS Id
AFAIK, MySQL uses LAST_INSERT_ID(). @@IDENTITY is MS SQL
specific. Though SCOPE_IDENITY() is recommended over @@IDENTITY.
What version of CF are you using? ColdFusion supports the
"result" attribute, which will return the ID value for simple
inserts. See the documentation for details
http://livedocs.adobe.com/coldfusion/8/Tags_p-q_17.html
> Do JDBC drivers for MySQL prohibit the use of multiple
queries
> in a single database transaction???
For security purposes this is disabled by default. To enable
it you must modify your datasource url
http://www.petefreitag.com/item/357.cfm

Similar Messages

  • R1: tcAPIException: Duplicate schedule item for a task that does not allow multiples.

    Hi,
    I'm struggling with the following task:
    I have to assure an account exists for a given resource. I do provision it with the .tcUserOperationsIntf.provisionObject().
    I've created a createUser task to create the account.
    The task code checks if there is already matching account.
    If no account exists, is is created in the disabled state, and the object state of OIM account is set to 'Disabled' by means of task return code mapping.
    If it exists, it is 'linked' to OIM account.
    The problem is if the existing account is enabled, I have to change the OIM account state to 'Enabled' either.
    To implement this (thanks, Kevin Pinski https://forums.oracle.com/thread/2564011 )) I've created an additional task 'Switch Enable' which is triggered by a special task return code. This task always succeeds, and its only side effect is switching the object status to 'Enabled'.
    By I've getting the 'Duplicate schedule item for a task that does not allow multiples' exception constantly:
    This is the stack trace:
    Thor.API.Exceptions.tcAPIException: Duplicate schedule item for a task that does not allow multiples.\
      at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.provisionObject(tcUserOperationsBean.java:2925)\
      at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.provisionObject(tcUserOperationsBean.java:2666)\
      at Thor.API.Operations.tcUserOperationsIntfEJB.provisionObjectx(Unknown Source)\
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\
      at java.lang.reflect.Method.invoke(Method.java:601)\
      at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)\
      at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)\
      at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)\
      ...skipped
      at Thor.API.Operations.tcUserOperationsIntfDelegate.provisionObject(Unknown Source)\
      ... skipped
    What did I wrong?
    Regards,
    Vladimir

    Hi Vladimir,
    Please select 'Allow Multiple Instance' checkbox for the process task.
    Thanks,
    Pallavi

  • Does iTunes allow multiple devices (iPod nano) to share one account?

    Does iTunes allow multiple devices (iPod nano) to share one account?

    Yes, Apple are keen for you to buy as many of their devices as your pocket will support.
    The Apple support document How to use multiple iPods with one computer suggests a number of ways for managing the media content. I use method two (Sync with selected playlists) with a slight twist. Rather than regular playlists I set the grouping field to indicate which users should receive which tracks and create smart playlists based on the content of this field.
    e.g.
    "Alice's Tracks" is "Grouping contains Alice" + "Kind contains audio"
    "Bob's Videos" is "Grouping contains Bob" + "Kind does not contain audio"
    Tracks that both Alice & Bob want on their iPods have the grouping set to "Alice/Bob"
    etc.
    I currently manage our family's five iDevices using this system, each getting a different selection to suit their tastes and the capacity of their device. An advantage of using the grouping field is that it is stored in file tags (for non-wav audio files anyway) so that it is relatively easy to recreate the playlists should the iTunes library get trashed and need rebuilding. Also useful if you move files about manually as playlist membership is preserved when you delete & re-import the tracks.
    tt2
    Message was edited by: turingtest2

  • Allowing multiple users on one Skype ID

    I was wondering if allowing multiple users online one Skype ID is possible, I currently run a small business, where the majority of the customers use skype just for text chatting, not the call features.
    I was looking to hire employees, but use the same skype thats associated with my current reputation. It also helps when I get return customers, since it'll be available to all workers.
    The last 2 times I tried setting this up, my skype got locked, and I wouldn't be able to afford for it to get locked.
    I was wondering if anyone had any suggestions about the feasibility of this.

    Being doing this idea for years and really was hoping for more development.
    Bottomline when a call comes in and either I answer the call or let my staff answer the call. Then later i can see what happened.
    Unfortunity each new call is not populating outlook with an automactic new record so notes could be made.
    Currently we name the client with notes on back end eg: John Smith ..wants to buy main street call back asap.
    This is crazy way to make notes on incoming calls but there no was to conert to a task or an appointment.... One day .....i can only dream.

  • Advise on using DBMS_XA with multiple branches under one global transaction

    Dear all
    I need some advise on using DBMS_XA from PL/SQL with tightly coupled multiple branches under one global transaction. Basically, I've successfully written some PL/SQL code that in 3 different sessions attaches to 3 different branches of one global transaction and before ending each branch they can see each others uncommitted data. So far so good.
    However, I'm not sure I completely understand how each branch must call xa_end, xa_prepare and xa_commit correctly using two phase commit and my calls result in errors like:
    ORA-24767: transaction branch prepare returns read-only (XA error code 3 = Transaction was read-only and has been committed)
    ORA-24756: transaction does not exist (XA error code -4 = XID is not valid)
    ORA-02051: another session or branch in same transaction failed or finalized
    This is the structure of my programs (3 SQL*Plus sessions):
    main: Uses xid 123|0 (branch 0 of global transaction 123). This should be the coordinator that commits using two phase commit across the 3 branches
    m1.xa_start tmnoflags
    m2.DML
    m3.Wait for thread A + B to manually be started and run xa_end
    m4.xa_end tmsuccess
    m5.xa_prepare
    m6.xa_commit false
    thread A: Uses xid 123|A (branch A of global transaction 123)
    a1.xa_start tmnoflags
    a2.DML -- thread A can see main and thread B's data
    a3.xa_end tmsuccess
    a4.xa_prepare -- required?
    a5.Should we also call xa_commit false?
    thread B: Uses xid 123|B (branch B of global transaction 123)
    b1.xa_start tmnoflags
    b2.DML -- thread B can see main and thread A's data
    b3.xa_end tmsuccess
    b4.xa_prepare -- required?
    b5.Should we also call xa_commit false?
    The failing steps are:
    m5
    m6
    a4
    a5
    b4
    b5
    Before starting calling xa_end I see 3 rows in V$GLOBAL_TRANSACTION, eg (hex 7B = decimal 123):
    FORMATID GLOBALID BRANCHID BRANCHES REFCOUNT PREPARECOUNT STATE FLAGS COUPLING
    203348753 0000007B 00000000000000000000000000000000 3 3 0 ACTIVE 0 TIGHTLY COUPLED
    203348753 0000007B 0000000000000000000000000000000A 3 3 0 ACTIVE 0 TIGHTLY COUPLED
    203348753 0000007B 0000000000000000000000000000000B 3 3 0 ACTIVE 0 TIGHTLY COUPLED
    Thanks a lot in advance.
    Cheers
    Finn

    OK, I've figured it out. This is poorly documented as it's not well explained how to handle the various return codes. Turns out that all but the last xa_prepare calls return dbms_xa.xa_rdonly (tightly coupled branches are combined -- "read only" optimization), the last one returns dbms_xa.xa_ok and this is when you should call xa_commit.
    Now my next problem is that DBMS_XA doesn't work from within jobs (DBMS_JOB and DBMS_SCHEDULER), which makes it very difficult to use DBMS_XA. My purpose of using DBMS_XA is to coordinate work across multiple sessions in one transaction but if I can't easily create the multiple sessions, I'm stuck.
    When called from a job, xa_start throws:
    ORA-24789: start not allowed in recursive call
    on Oracle 11.2. In Oracle 11.1 it works, but xa_end fails with
    ORA-25352: no current transaction
    so I guess in fact the xa_start call didn't really work either, even though it returned tm_ok.
    I'm now trying to find a workaround on how to use DBMS_XA from within jobs, please comment if you have any suggestions. Or if you have any suggestions on other means of establishing the concurrent sessions (I wouldn't like to resort to external programs that need username/password to connect as password management would be a security issue).
    Thanks in advance.
    Cheers
    Finn

  • Importing CSV files into Multiple Tables in One Database

     I have a web based solution using Microsoft SharePoint and SQL Server that is created to centralize dat collection and reporting of program metrics used in montly reviews.
    A person from each program enters dat manual or by pushing the data using automated data import tools. The user then is able to generate reports and provide presentations to their stakeholders.
    There are are programs that are located in US and 2 that are located in Japan. All, including programs in Japan use the MS Project with a plug-in tool that allows them to auto input data. When the user click the "Send To.." button, the data goes
    in to multiple tables in one database.
    Everything is set up exactly the same for every program; however, we have discovered becase of a firewall, along with some of the different settings that the MS Project has over in Japan, the 2 program users are not able to auto import their data.
    The suggestion is to have the program users export the MS Project file into a CSV and email it. I will then take it and convert the data, such as the dates and place them on a Network Drive. There will be 2 folders, one for each program.
    I feel it will be an easy process just to load the data from the Network Drive into the same tables that are created for auto import.
    My Concerns/Questions:
    1. Should I create 1 SSIS package or should there be 2, one for each program?
    2. US and Japan program users send their data once a month. The converted files are going to be saved in the location marked with a date (ex:201402). How can i have it to where SSIS will automatically load the data every time i place new files in the designated
    folders or when i update an exsisting file?
    Can you provide an example with your suggestion please?
    I greatly appreciate the assistance!
    Y_Tyler

    Hello Vikash,
    Thank you! This will help me get started.
    There will be 2 folders, one with files with Program A data and the other with files with Program B data. All will have the same fields, just coming from different programs. You stated that I will be able to to load both in one package. Would there be two
    paths since there will be two separate folders?
    Using the example you provided, i am confident that I can create the package using one path into one table but not sure how to get the files from 2 paths (if there is) into multiple tables.
    Can you help clarify this for me?
    Thank you!
    Y_Tyler

  • After the initial "recharging" of my Iphone 5, is it once again necessary to allow the battery to fully die before charging?

    After the inital die/recharge of my Iphone 5, is it necessary to, once again, allow the battery to completely die before charging? Or, can I just recharge it when the battery gets low?

    You can recharge your phone whenever you want. The lithium ion battery (not just apples) have a certin amount of charge cycles like any other lithium battery. A charge cycle is a complete 0%-100%. So sticking it on the charger everytime at night doesn't count as a charge cycle. If your batter is at 80% then you charge it to 100% that is 20% of a charge cycle. Its a little confusing, but I learned it with doing a lot of asking and research. Don't worry, just charge your phone when you need to and you'll be fine.
    Its recommended to do a full charge from 0%-100% once a month to calibrate the battery meter.

  • Multiple entries in one database column

    Hello.
    I am a bit of a php/mysql newbie.  I'm trying to figure out how to select multiple data entries from one database column.
    For example, I have a column in one table called name_id.  I want to assign multiple names to a specific entry in this table.  Like, "1,4,12,18", for example.  Each of these numbers are the primary keys for my name table.  So, I'm trying to assign 4 people to one set of data in this example.
    I have seen this done before, I just don't know how to select this data once it is in there.  I think it may have something to do with arrays, but I'm not sure.
    I hope this makes sense, any help would be much appreciated.

    That's a poor design plan as it violates the basic rules of normalization and will cause  problems in the end. Just create another table to link to and store the one value in each row. If you need more details, then tell us exactly what you are trying to do.

  • On CS6 does it allow multiple computers under the one license?

    I purchased Photoshop CS 6    and need to load it on a different computer (newer & faster)    does the license allow one to three or one to five units?    I forgot and can not find the box or paperwork.

    A single user license allows you to install and activate on two machines, wherein only one can be in use at any given time.  You can install on as many as you like but are limited to only have two activated at a time.

  • Acrobat 9 Pro Extended does not allow multiple renditions

    I have tried adding several different kinds of media files (Tools > Multimedia > Video or Flash), but I can never see the Multimedia Properties dialog box, so therefore I cannot add additional renditions. I had no problem doing this in Acrobat 8 Pro. According to the documentation this functionality should be there, has anyone else had this issue?

    I've already extended the rights and made sure to save to activate that... as well as password protected the docs etc... still nothing...
    I am aware that those with Basic Adobe Reader need rights extended to be able to use functions available to Adobe Pro.

  • Does WAAZ allow multiple SP online tenants to connect to?

    We have a requirement for two SP online environments: 1 strictly internal, 1 with an option to share with externals. Both environments need to have a different URL. In both environments, I want to give all internal users a SSO experience. I read in
    blogs that it's not possible to sync an AD object (aka User) to multiple tenants in O365, but would it be possible to hook up multiple SP online tenants to WAAZ? Can't seem to find anything on that so all help is greatly appreciated.

    ADFS can be configured with Kerberos internally, and forms-based authentication on the proxy servers.  This would provide SSO suited for internal AND external users.  Having said that, your question seems more related to SharePoint, and not Azure.
     You should post in the SPO form instead.
    Mike Crowley | MVP
    My Blog --
    Planet Technologies

  • Multiple companies in one database vs. multiple databases

    Our company is going through an SAP B1 implementation.  We develop\manage shopping centers, each their own lega entity, etc.  To somewhat protect the financials, bank accounts, etc of each entity, we set each company up with its own database.  We are currently up to 22 databases.  Initially our consolidation plan relied on reports; however, the administration of the databases is more of a challenge than expected.
    Does anyone have a feel for the pros\cons of consolidating these companies into one "segmented" database?
    Thanks

    If you have multiple legal entities / companies, I would rather recommend that you create multiple databases within the SAP Business One server. This will let you manage different users, layouts, Chart of Accounts (CoA), Business Partner codes and a host of other items that would be very difficult to do if you tried to lump them all into one company.
    Of course, having to work at some form of consolidation reporting is no easy task, but I would suggest you try to standardise your CoA for all the other 22 companies as so they have the same headers / Account titles. This way, you can at least try a very basic report where you generate a TB from each company and pass it to Excel, and then work at some form of macro to draw / consol the 22 Trial Balance reports into one master copy.
    If you have SDK access, you could try doing it via SDK or maybe look at other partners with consol add on's like http://www.citixsys.com/

  • How to work with multiple users accessing one database

    I am a newbie in oracle.
    I want to give access to my oracle database for more users.
    I created oracle connection with c# project. The application allow to user to insert data to a database table. Now I want to give access to the different users with a login. Is there any way to give access other users to the same database using their username and passwords?
    I'm confused. Please help.
    thank you.

    In the database, set up your data schema with data tables, views, and stored procedures to support your application.
    That schema owner should only be a trusted data administration person.  Let's call that schema APP_DATA.
    Then you set up another schema called APP_DATA_USERS with no privileges and no data.
    Then you create an Oracle ROLE object called APP_DATA_ROLE.
    You grant the app_data_role to the app_data_user account.
    You then grant object permissions in the APP_DATA_ROLE that you want the app_data_user to have for the app_data data objects, like Create SESSION, SELECT on TABLE X. or SELECT, INSERT, UPDATE on TABLE Y.
    Now the APP_DATA_USERS only has specific permissions needed on specific app_data data objects that you control by the app_data_role.
    Then your application only opens connections to Oracle via the single APP_DATA_USERS account
    which is constrained by the APP_DATA_ROLE permissions on what can be done in the data schema APP_DATA.
    in your web or app config you create the connection information for the single app_data_user account.
    Putting the database aside, you now create the application layer with login controls so many users can use the application.
    But when they need data, the application only makes a connection to the single APP_DATA_USERS account
    Oracle ODP.NET auto handles the multiple session connections by the multiple application users to the single APP_DATA_USERS account.
    In summary the multiuser access is controlled by the application
    all making connections (sessions) with a single, limited privilege app_data_user account on the database side.

  • Update Multiple DataAdapters with one Sql Transaction

    hello, am trying to implement a save routine , common scenario master detail data . However after the first save succeed the second time the save fails with the common message.
    Concurrency Violation The Update affect....  
    I have the following function Save
    Private Function _Save() As Boolean
    _Save = False
    Dim con As New SqlClient.SqlConnection(connectionString)
    con.Open()
    Dim Tran As SqlClient.SqlTransaction = con.BeginTransaction
    Try
    MasterTA.InsertCommand = Masterbuilder.GetInsertCommand
    MasterTA.UpdateCommand = Masterbuilder.GetUpdateCommand
    MasterTA.DeleteCommand = Masterbuilder.GetDeleteCommand
    MasterTA.InsertCommand.Transaction = Tran
    MasterTA.DeleteCommand.Transaction = Tran
    MasterTA.UpdateCommand.Transaction = Tran
    MasterTA.InsertCommand.Connection = con
    MasterTA.DeleteCommand.Connection = con
    MasterTA.UpdateCommand.Connection = con
    DetailsTA.InsertCommand = DetailsBuilder.GetInsertCommand
    DetailsTA.UpdateCommand = DetailsBuilder.GetUpdateCommand
    DetailsTA.DeleteCommand = DetailsBuilder.GetDeleteCommand
    DetailsTA.InsertCommand.Transaction = Tran
    DetailsTA.UpdateCommand.Transaction = Tran
    DetailsTA.DeleteCommand.Transaction = Tran
    DetailsTA.InsertCommand.Connection = con
    DetailsTA.UpdateCommand.Connection = con
    DetailsTA.DeleteCommand.Connection = con
    MasterTA.Update(DS.Tables(0))
    DetailsTA.Update(DS.Tables(1))
    UpdateLedger(Tran)
    Tran.Commit()
    Return True
    Catch ex As Exception
    Tran.Rollback()
    MessageBox.Show(ex.Message, My.Application.Info.Title, MessageBoxButton.OK, MessageBoxImage.Error)
    Return False
    Finally
    con = Nothing
    Tran = Nothing
    End Try
    End Function
    I am using a CommandBuilder
    if the Adpater 1 pass and the adapter 2 fail , I need to Re Fill my adapters again in order to avoid the concurrency violation . I CANNOT refill because I already have changes in the  DataTables I don't want the user to loose their information
    and start writing them again.
     The FULL procedure is successfully executed if no Exception occur with in the try catch
    I was able to eliminate the concurrency violation by  setting the
    commandBuilder.ConfilctOption=ConflictOption.OverwriteChanges but this will fail to update the correct changes the 2nd time to the database
    the only possible solution that I come  close to it. Before attempt to save anything
    Is to copy the datatables
    After update Fail Or Not
    Clear the DataTables from the Dataset
    Merge The dataTables from the DataSet with the Previous Copy Tables
    Exception Occure (Violation of primary key constraint '.....' attempt to insert a duplicate key)
    My IDS are not Auto Increment .
    I Really really need to use a transaction with DataAdapters ,
    I Also try the System.Transactions.TransactionScope
    but I have 2 problems
    Sometimes raise an error from the Server
    It doesn't work always as it behaves almost the same as I describe the problems above (Works only The first time)
    stelios ----------

    this the StackTrace when the error is ExecuteReader requires the command to have....
     at System.Data.Common.DbDataAdapter.UpdatingRowStatusErrors(RowUpdatingEventArgs rowUpdatedEvent, DataRow dataRow)
       at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
       at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
       at System.Data.Common.DbDataAdapter.Update(DataTable dataTable)
    And this is the StackTrace for the error Concurrency Violation
       at System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
       at System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
       at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
       at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
       at System.Data.Common.DbDataAdapter.Update(DataTable dataTable)
    stelios ----------

  • Entering multiple records into one database

    Hi Guys,
    I have created a form that repeats the text fields. I want to
    record all the entries into an access database. I am trying to use
    the SQL Insert Command but I am receiving a mismatch criteria
    error. Here is the command:
    Command1.CommandText = "INSERT INTO tblWeek (Classdate, Week,
    Day, Activity, Location) VALUES ('strDate', 'strWeek', 'strDay',
    'strActivity', 'strLocation') "
    Any help would be greatly appreciated

    If you have multiple fields with the same name, they pass a
    single form
    value across that contains a comma delimited list.
    You need to pick up this and loop through it to grab each
    value.
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "sham!" <[email protected]> wrote in message
    news:e4fd6b$a16$[email protected]..
    > Hi Guys,
    > I have created a form that repeats the text fields. I
    want to record all
    > the
    > entries into an access database. I am trying to use the
    SQL Insert Command
    > but
    > I am receiving a mismatch criteria error. Here is the
    command:
    > Command1.CommandText = "INSERT INTO tblWeek (Classdate,
    Week, Day,
    > Activity,
    > Location) VALUES ('strDate', 'strWeek', 'strDay',
    'strActivity',
    > 'strLocation') "
    >
    > Any help would be greatly appreciated
    >

Maybe you are looking for

  • Link error when using WebLogic 6.0 and Oracle 8.1.6

    I have installed WebLogic 6.0 on Solaris platform and verified that the server comes up and that I can connect to it via Netscape. Next step was to verify installation of WebLogic jDriver for Oracle. When I run the following: java utils.dbping ORACLE

  • No inquiry items and project assignment to sales order

    Hi Friends? I am using DP81 to create sales pricing but getting error message when entering project number that No inquiry item exist for project There are no inquiry items for project A1 Message no. VPK1111 Diagnosis A project-assigned inquiry is a

  • Flash freez and then crash, windows 7, 64 bit OS

    I have had this problem since day one, for over two years. Flash on youtube and other sites freezes and crashes the flashplayer plugin if I dont continuously move my mouse around on top of the flash window. I have used this as an solution: clicked th

  • Delivery-Substitution of Profit center

    Hi, We have a requirement of Inter company stock transfer. So PO followed by Delivery and Billing . We need to change the Profit center using substitution  at the time of delivery so the Billing will also follow the substituted Profit center. Is ther

  • About ORacle  Text

    Hi, I would like to know some points about oracle Text. I have used oracle Text to extract just the text contents from blobs(of pdf,xls,..) stored in the database. 1) Whether the same Oracle text can be used to extract the contents from the file?(so