Credit Approval across multiple databases

Hi,
We are trying to create a credit approval across two databases i.e. set my limit in the one database but would like to have an approval fire in my other database if the combined customer balances + new transaction amount is greater than the limit set.
We get an cannot commit ADOC error.
Please have a look at the query and let us know what needs to be changed.
Thanks
Jacques
SELECT 'TRUE' FROM SBODemoUK.dbo.OCRD a, SBODemoUS.dbo.OCRD b WHERE $[a.cardcode]=$[$4.0.0] and $[b.CreditLine]< (($[a.Balance]$[b.Balance])$[$29.0.0])) and $[a.cardcode]=$[b.cardcode}

The $ before a.cardcode is not the right syntax.  Also when you are referencing the DocTotal I changed the syntax to
$[$29.0.Number]
so that we can get the value without the currency symbol
Could you please try this
SELECT DISTINCT 'TRUE' FROM SBODemoUK.dbo.OCRD a, SBODemoUS.dbo.OCRD b WHERE a.cardcode=$[$4.0.0] and b.CreditLine< ((a.Balance+b.Balance)+$[$29.0.Number]) and a.cardcode=b.cardcode

Similar Messages

  • Outer joins across multiple databases

    I'm trying to join three tables: 2 from data warehouse and 1 from Siebel database in OBIEE. I create the physical and logical joins (no errors or warnings). The model looks like this: Account Address (table 1) -> Account (table 2) -> Siebel Customer Data (table 3)
    I create two queries in Answers:
    (1) Account.Number and Siebel.Address (the query works)
    (2) Account Address.Zip, Account.Number, and Siebel.Address (the query gets the following error):
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 42019] Join condition, D901.c3 <> 0, contains predicates that are currently not supported for outer joins across multiple databases. (HY000)
    Can someone help me understand why the join between the two databases works for the first query but when I add a second table it fails?
    thanks...

    Either you can link the Oracle DB into Access (by using File/Get External Data/Link Tables)
    or you have to simulate the join in Java by doing two separate queries and looping through the results.

  • How to execute sql scripts from Powershell across multiple databases

    Re: How to execute sql scripts from Powershell across multiple databases
    I have an tsql script that I want to run across a list of databases. How is the best way to do this in Powershell? Thanks.

    My example below, using just the SMO and not breaking up the batches, the ExecuteWithResults give the following error when the .sql file contains a GO. My script files are as simple as a DECLARE and then a GO.
    WARNING: SQL Script Failed
    The object of type "Microsoft.PowerShell.Commands.Internal.Format.FormatStartData" is not valid or not in the correct sequence. This is likely caused by a user-specified "format-list" comm
    and which is conflicting with the default formatting.
        + CategoryInfo          : InvalidData: (:) [out-lineoutput], InvalidOperationException
        + FullyQualifiedErrorId : ConsoleLineOutputOutOfSequencePacket,Microsoft.PowerShell.Commands.OutLineOutputCommand
    Also, when executing from the ISE, is there a way to force the ISE to release the files. I am having to close the ISE and reopen my script every time I want to make a testing change to the .sql file.
    [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo")
    $scriptspath = "C:\temp\psExecuteSQLScripts\scripts"
    $SQLServer = "fidevc10"
    $SQLDB = "Bank03"
    # Create SMO Server Object
    $Server = New-Object ('Microsoft.SQLServer.Management.Smo.Server') $SQLServer
    # Get SMO DB Object
    $db = $Server.Databases[$SQLDB]
    # Load All SQL Scripts in Directory
    $scripts = Get-ChildItem -Path (Join-Path $scriptspath "*") -Include "*.sql" -Recurse
    # Loop through each script and execute
    foreach ($SQLScript in $scripts)
    $fullpath = $SQLScript.FullName
    # Read the Script File into Powershell Memory
    $reader = New-Object System.IO.StreamReader($fullpath)
    $script = $reader.ReadToEnd()
    # Execute SQL
    Write-Host "Executing $SQLScript on $SQLDB...."
    try
    $ds = $db.ExecuteWithResults($script)
    Foreach ($t in $ds.Tables)
    Foreach ($r in $t.Rows)
    Foreach ($c in $t.Columns)
    Write-Host $c.ColumnName "=" $r.Item($c)
    Write-Host "Complete"
    catch [Exception]
    Write-Warning "SQL Script Failed"
    echo $_.Exception|format-list -force
    Write-Host " " -BackgroundColor DarkCyan

  • Transaction across multiple databases in the same BDB environment

    Hi,
    I have multiple databases and one metadata database all in the same BDB environment. At runtime I want to create an additional database, update this database and update the metadata database in the same environment under one transaction. Are there any issues in having transactions that span multiple databases in the same environment?
    Thanks,
    Pooja

    There is virtually no difference between using multiple databases and a single database in a transaction. Concurrency is determined by other factors such as whether multiple threads access the same records. See the Writing Transactional Applications for more information:
    http://www.oracle.com/technology/documentation/berkeley-db/je/TransactionGettingStarted/index.html
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Using one user account table across multiple databases but account used as a foreign key

    I want to use one user account table from one database and use it across a couple other databases. The problem is that I want some tables to use the primary key from the user account table as a foreign key to access the data when the user logs in. Is this
    the right way of going about it? Do I have to create a user account table in all my databases? What is the best practice to handle this problem? Thanks in advance.

    You can use Triggers or using replication. 
    more info: 
    Add Foreign Key relationship between two Databases
    SQL Server Replication
    Saeid Hasani [sqldevelop]

  • Joins across multiple databases using jdbc

    I have two databases, Access and Oracle. I can read and write to them, but now I need to execute an outer join. How would I construct the join in Java? I'd also like to store the result in Access. Thanks in advance.

    Either you can link the Oracle DB into Access (by using File/Get External Data/Link Tables)
    or you have to simulate the join in Java by doing two separate queries and looping through the results.

  • Query across multiple databases

    Hi,
    One shot question: is it possible in Oracle to write a query joining two tables from different databases ?
    I used MS SQL, and it was duable there, but I have to port app to Oracle, and I did not manage to do this on oracle.
    I use oracle 9
    Thanks.
    pesq

    1. Create an account on the remote database with permissions to select from the relevent tables.
    2. Create a database link in the local database to connect to the account (step 1.) in the remote database.
    3. Now execute you query in the local database connecting to the tables in the remote database.
    SELECT local_a.col1, local_a.col2, rmt_a.col5
    FROM local_table local_a, remote_table@<name of link> rmt_a
    WHERE local_a.key = rmt_a.key;

  • Multiple databases in a single query

    I need to query multiple databases in a single query.
    e.g.
    Database d1 contains table t1 with column id
    Database d2 contains table t2 with column id
    I need a query like
    SELECT * FROM t1, t2 WHERE t1.id = t2.id;
    is this possible in jdbc? if yes can anyone help with some sample code?
    thanks,
    Ashish Saraf

    It is not possible using the JDBC API to query tables in two or more databases using a single query. The reason is that a JDBC Connection is made to a single data source.
    However, some databases support the idea of federations or linked tables. What you do is inside the database manager link or federate a table that is present in another DBMS. Then, pose a single JDBC query to the one DBMS which will have its own table and links to the external tables.
    Another approach is to use a special JDBC driver with a built-in integration engine that will perform a query across multiple databases. In effect, the system poses separate queries to the different databases and integrates and joins the data together for you automatically on the client-side. That is much easier than doing it yourself in code, but that is also possible for simple queries.
    As part of my research program, we have released a shareware version of the UnityJDBC driver that can query multiple databases using a single SQL query. For more information, see:
    http://www.unityjdbc.com
    http://www.cs.uiowa.edu/~rlawrenc/research/projects.html
    Sincerely,
    Dr. Ramon Lawrence
    Assistant Professor
    Department of Computer Science
    University of Iowa
    [email protected]

  • Using ATMI and tuxedo to institue distributed transactions across multiple DBs

    I am creating the framework for a given application that needs to ensure that data
    integrity is maintained spanning multiple databases not necessarily within an
    instance of weblogic. In other words, I need to basically have 2 phase commit
    "internet transactions" between a given coordinator and n participants without
    having any real knowlegde of their internal system.
    Originally I was thinking of using Weblogic but it appears that I may need to
    have all my particular data stores registered with my weblogic instance. This
    cannot be the case as I will not have access to that information for the other
    participating sytems.
    I next thought I would write my own TP...ouch. Everytime I get through another
    iteration I kept hitting the same issue of falling into an infinite loop trying
    to ensure that my coordinator and the set of participants were each able to perform
    the directed action.
    My next attempt has led me to the world of ATMI. Would ATMI be able to help me
    here. Granted I am using JAVA so I am assuming that I would have to use CORBA
    to make the calls but will ATMI enable me to truly manage and create distributed
    transactions across multiple databases. Please, any advice at all would be greatly
    appreciated.
    Thanks
    Chris

    Andy
    I will not have multiple instances of weblogic as I cannot enfore that
    the other participants involved in the transaction have weblogic as
    their application server. That being said, I may not have the choice
    but to use WTC.
    Does this make more sense?
    Andy Piper <[email protected]> wrote in message news:<[email protected]>...
    "Chris" <[email protected]> writes:
    I am creating the framework for a given application that needs to ensure that data
    integrity is maintained spanning multiple databases not necessarily within an
    instance of weblogic. In other words, I need to basically have 2 phase commit
    "internet transactions" between a given coordinator and n participants without
    having any real knowlegde of their internal system.
    Originally I was thinking of using Weblogic but it appears that I may need to
    have all my particular data stores registered with my weblogic instance. This
    cannot be the case as I will not have access to that information for the other
    participating sytems.I don't really understand this. From 6.0 onwards you can do 2PC
    between weblogic instances, so as long as the things you are calling
    are transaction (EJBs for instance) it should all work out fine.
    I next thought I would write my own TP...ouch. Everytime I get through another
    iteration I kept hitting the same issue of falling into an infinite loop trying
    to ensure that my coordinator and the set of participants were each able to perform
    the directed action.
    My next attempt has led me to the world of ATMI. Would ATMI be able to help me
    here. Granted I am using JAVA so I am assuming that I would have to use CORBA
    to make the calls but will ATMI enable me to truly manage and create distributed
    transactions across multiple databases. Please, any advice at all would be greatly
    appreciated.I don't see that ATMI would give you anything different. Transaction
    management Tux is fairly similar to WebLogic (it was written by the
    same people). If you are trying to do interposed transactions
    (i.e. multiple co-ordinators) then WTC would give you this but it is
    only a beta feature in WLS 6.1. Using Tux domain gateways would also
    give you interposed behaviour but would require you write your servers
    in C or C++ ....
    andy

  • Using ATMI and tuxedo for distrubuted transactions across multiple DBs

              I am creating the framework for a given application that needs to ensure that data
              integrity is maintained spanning multiple databases not necessarily within an
              instance of weblogic. In other words, I need to basically have 2 phase commit
              "internet transactions" between a given coordinator and n participants without
              having any real knowlegde of their internal system.
              Originally I was thinking of using Weblogic but it appears that I may need to
              have all my particular data stores registered with my weblogic instance. This
              cannot be the case as I will not have access to that information for the other
              participating sytems.
              I next thought I would write my own TP...ouch. Everytime I get through another
              iteration I kept hitting the same issue of falling into an infinite loop trying
              to ensure that my coordinator and the set of participants were each able to perform
              the directed action.
              My next attempt has led me to the world of ATMI. Would ATMI be able to help me
              here. Granted I am using JAVA so I am assuming that I would have to use CORBA
              to make the calls but will ATMI enable me to truly manage and create distributed
              transactions across multiple databases. Please, any advice at all would be greatly
              appreciated.
              Thanks
              Chris
              

              I am creating the framework for a given application that needs to ensure that data
              integrity is maintained spanning multiple databases not necessarily within an
              instance of weblogic. In other words, I need to basically have 2 phase commit
              "internet transactions" between a given coordinator and n participants without
              having any real knowlegde of their internal system.
              Originally I was thinking of using Weblogic but it appears that I may need to
              have all my particular data stores registered with my weblogic instance. This
              cannot be the case as I will not have access to that information for the other
              participating sytems.
              I next thought I would write my own TP...ouch. Everytime I get through another
              iteration I kept hitting the same issue of falling into an infinite loop trying
              to ensure that my coordinator and the set of participants were each able to perform
              the directed action.
              My next attempt has led me to the world of ATMI. Would ATMI be able to help me
              here. Granted I am using JAVA so I am assuming that I would have to use CORBA
              to make the calls but will ATMI enable me to truly manage and create distributed
              transactions across multiple databases. Please, any advice at all would be greatly
              appreciated.
              Thanks
              Chris
              

  • Multiple database vendor

    What is the best way to search across multiple databases vendor (oracle and SQL server)?

    What is the best way to search across multiple
    databases vendor (oracle and SQL server)?Code a Factory class to handle this. And have all the drivers available. :-)

  • Running sql query across multiple (remote) databases

    I'd like to run a query that pulls information from multiple databases which are not on the same machine. Is this possible using SQL Developer?

    If you are still interested, there is a tool that can query multiple databases and save results in a single text file that you can then modify as necessary - see www.bsutils.com/MuSQL.html

  • Multiple Database Servers Question

    Hi,
    Please forgive this ignorant question, but can someone tell
    me how one would go about using multiple database servers?
    Just as there comes a time where one would need more than
    one web server and would need to use a load balancing
    solution, what happens when one would need more than one
    Database Server?
    How does one go about implementing that solution?
    Is there some way to have two database servers carrying the
    same information with some kind of load balancing solution
    in front of it(?) or does one place some tables on one
    Database
    server, and other tables on the other database server?
    (I have no clue as to how things would work.)
    Thanks in advance,
    Joe

    Microsoft SQL allows for clustering of SQL databases, so for
    instance two servers connected to a fileshare and a virtual address
    shared across the two physical boxes. Database connections are made
    to the virtual addres which will then be handled by the active
    node. Becuase a database is ultimately a file(s) on a disk it can
    only be attached to one node at a time so you end up with an
    active/inactive cluster.

  • Can join queries in Oracle 8i and above span multiple databases

    Hi,
    In Oracle 8i and above, can join queries span multiple databases??
    For eg., I have two databases A and B, and say database A has table A_T and
    database B has table B_T. Assume that both the databases are on the same
    server.
    Can I run a join query from my application using OCI calls that spans across
    tables from multiple databases, namely, A_T and B_T?
    My query probably looks like this - Select * from A.A_T, B.B_T;
    Thank you,
    Sashi

    In Oracle 8i and above, can join queries span multiple databases??
    For eg., I have two databases A and B, and say database A has table A_T and
    database B has table B_T. Assume that both the databases are on the same
    server.
    Can I run a join query from my application using OCI calls that spans across
    tables from multiple databases, namely, A_T and B_T?
    My query probably looks like this - Select * from A.A_T, B.B_T;If you create a database link from database A to B your SQL would look something like this:
    select * from A.A_T, B.B_T@dbB where A.A_T.PK = B.B_T.PK@dbB
    The Oracle manuals should have the information you need on creating a database link.

  • Searching for links across multiple pdf files

    We have thousands of pdf files that are being moved to a new website. Some of these pdf files have links within them (either as text or as a hyperlink). This number is unknown.
    The issue is how to programmatically search across multiple pdf files (numbering in the thousands) looking for links using a regular expression or part of a path. This will have to be able to search behind the text and search for the link url.
    We first need to identify the number of files with links and create a list of the files with links that need modifying. If the number is too great to modify manually, then we would need the ability to programmatically edit these links.
    The pdf files are stored in a database. Also, the pdf files are different versions and some are password protected.
    Is there an Adobe product that will perform this? If not, are there any 3rd party vendor products that will accomplish this?
    Thanks in advance for your help.

    I have no solution, but a thought: the database factor may seem to be
    a killer. But you could look for a solution designed to read PDF files
    from a web site (by spidering or from a list), which would presumably
    load them.
    Or could do a one off extraction of the files from the database into a
    directory and use that for your process. Probably a very good idea,
    since extracting all files from the database is likely to be costly
    and hammer the server (but can be scheduled at a sensible pace), while
    the search process will (if it is possible at all) doubtless need to
    be run countless times.
    Aandi Inston

Maybe you are looking for

  • How to make full screen on safari

    how to make full screen on safari

  • How to Install Classic? I am getting Error -1.

    I would like to use Classic, but I can't get it to work. I have installed Mac OS 9.2.2 French on a specific volume names Applications. I have renamed the System Folder to avoid accentuated characters. I have tried to bless it by using the Terminal: b

  • Help please connecting PC and iMac

    I am trying to help my cousin connect his Samsung pc laptop with his brand new iMac through his wireless network. There are all kinds of partial connections going on, but the one main connection he needs still eludes me. And, that is his Samsung Lapt

  • HT4906 No photo stream

    My icloud on my mac book is not letting me click on photo stream - any ideas why not? I can't see my photos in iphoto from my imac.

  • Does anyone know of software that converts LaTex and rtf files to doc?

    Hi All: I edit documents for PhD candidates in economics. As these documents generally contain a lot of symbols, the authors use LaTex, which they sometimes convert to rtf. I prefer to edit using word and track changes. In fact, that's the only way I