Running SQL queries through Xpress code

Hi,
Please give an idea to run the sql select, update queries through Xpress code.
The code may be there in workflows or rulelibs...
Any ideas are appreciated
Thanks,
Santoshanand

There is a set of JDBC methods in the class com.waveset.util.JdbcUtil which certainly allows for selects to take place.
check out the javadocs from the BFE especially the queryList and queryRecords methods.
I guess the sql method could be used to run any sort of sql statement you like if you want to modify the database.
From XPress these methods are invoked
e.g.
<invoke name='queryList' class='com.waveset.util.JdbcUtil'>
</invoke>

Similar Messages

  • Long Running SQL Queries

    We have a customer that runs our Crystal Reports and they have complained that some of the reports cause long running sql queries and they have to kill these queries manually from SQL Management tools. We have changed the code so that we now dispose the report source and viewer objects as we call .dispose() function on them;
    reportSource.dispose();
    viewer.dispose();
    At first this seemed work but customer later complained that the issue still occurs. Can anyone help with why some of these CR queries are still running way after report is generated (with correct set of data), and based on the customer some of them running for more than 2 hours? What else can we do to make sure that all CR related queries cease to exist once report is generated? Appreciate all the help.

    1. Run the report from with Crystal designer. You should see the query being sent to DB server. After the report is viewed and you close it in designer, do you see the DB connection being dropped? If not, this may not be a SDK\ API related issue.
    2. Try using latest set of CRJ Jars [here|http://downloads.businessobjects.com/akdlm/crystalreportsforeclipse/2_0/crjava-runtime_12.2.213.zip] in your application. Also update the crystalreportviewers folder with the new viewer found at this link.
    3. Make sure that you are calling reportClientDocument.close() at the end when user is done viewing the report.
    4. When you say logn running queries are seen in DB, are you referring to a DB connection left open? or is it actually running any query and returning results?

  • Running SQL Loader through PL/SQL

    Hi All,
    Is there a utility package that can be used to run SQL LOADER through PL/SQL?
    Regards

    External tables are new in 9i.
    If you need to call SQL*Loader in 8i, you'd be stuck with the Java stored procedure/ external procedure approach. Of course, this might also be an impetus to upgrade, since 8.1.7 leaves error correction support at the end of the year.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How to execute sql-queries through shell scripting in linux?

    How to execute sql-queries through shell scripting in linux?

    http://www.oracle.com/technology/pub/articles/saternos_scripting.html
    Two simple examples:
    #!/usr/bin/env bash
    set_orafra () {
       orafra=`echo 'set heading off
       select name from v$recovery_file_dest;
       exit' | sqlplus -s / as sysdba`
    set_orafra
    echo $orafra
    #!/usr/bin/env bash
    export ORACLE_SID=instance_name
    export ORACLE_HOME=/path_to_oracle_home_directory
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export PATH=/$ORACLE_HOME/bin/$PATH
    $ORACLE_HOME/bin/sqlplus -s <<EOF
    connect scott/tiger@my_instance_name
    INSERT INTO table VALUES (sysdate);
    exit
    EOFEdited by: Markus Waldorf on Sep 17, 2010 12:19 AM

  • Information on how to run SQL queries on the CUCM itself please

    Good Day All,
    I need to run an sql query on the CUCM to list all of my directory numbers, their partition, and their external mask values.
    I came across this excerpt below earlier so I have a bit of an idea how to do it but iw would be great to see some other examples of sql queries.
    Any assistance is most appreciated.
    Also, is there a document somewhere to tell me how to run these queries?
    Thanks in advance
    Regards
    Amanda
    Currently Being Moderated
    05/04/2011 5:18 AM (in response to Joshua Royle)
    Re: Is there a way of pulling a report off CM showing all phones that have diverts on?
    Try if running this SQL query from the CLI helps you, it should list all DN's that have CFA enabled to VM or a DN:
    run sql select dnorpattern,cfadestination,cfavoicemailenabled from CallForwardDynamic c, numplan n where c.fknumplan = n.pkid and (cfadestination != '' or cfavoicemailenabled ='t')

    Hi Amanda
    Basically it's standard SQL, so it wouldn't hurt to google 'informix select statements' and do a little reading to get the basics. There are millions of permutations of queries so it's a matter of understanding the syntax, and then applying that to the database in question. The only difference when running commands from the CLI are that:
    - You prefix the standard informix SQL statement with 'run sql'
    - You don't get any help from CUCM with the syntax, so you might be well advised to use something that understands SQL a little and colorises it as you type, and then paste the resulting commands into the CUCM SSH window. I use a text editor named JEdit, if you create a text file and save it as a file ending in .sql it will highlight your syntax.
    - Other programs are available that do reasonable syntax highlighting (e.q. SquirrelSQL) that are designed for querying the DB directly, but you can't actually query directly against the DB for security reasons. You'd still have to copy/paste the commands.
    Now... to understand the DB you'll need a reference describing all the tables etc. This is here:
    http://www.cisco.com/en/US/products/sw/voicesw/ps556/products_programming_reference_guides_list.html
    Pick your version of CUCM and download the 'Data Definition' document.
    A few notes on the command:
    run sql : is just the CLI command that tells the shell to run the following text as SQL.
    select : the SQL command to retrieve data
    dnorpattern,cfadestination,cfavoicemailenabled : the column names to retrieve
    callforwarddynamic c, numplan n : the names of two tables, and the abbreviations you want to refer to them as
    where c.fknumplan = n.pkid : this tells SQL to return values from the two tables where these fields match up. In the data definition you'll see notes that c.fknumplan (i.e. the fknumplan column in the callforwarddynamic table, as noted by the c. prefix) refers to the PKID column in the numplan field. This is a very standard type of join in the CCM DB.
    and (cfadestination != '' or cfavoicemailenabled ='t') : another clause, basically in this query we want to see only rows where cfadestination isn't blank or cfavoicefmailenabled is set to 't' for true).
    Most tables are linked in one of two ways in this database:
    - a column prefixed 'fk' refers to the pkid field (there is always only one pkid field per table) in the table following the 'fk' prefix. E.g. above fknumplan refers to the numplan table, pkid field. fkdevice would refer to the device table, pkid field.
    - a column prefiex 'tk' refers usually to an enum table which is prefixed with 'type'. This is a table that maps the number value in the 'tk' field to a string. An example would be tkmodel - this represents the phone physical model type (e.g. 7962), and maps to a table called typemodel, and the 'enum' column in that table.
    Regards
    Aaron HarrisonPrincipal Engineer at Logicalis UK
    Please rate helpful posts...

  • Running windows command through java code

    Hello
    i want to execute jar.exe through java code , i have written following piece of code , but it isn't working
    ProcessBuilder processBuilder = new ProcessBuilder(new String[]{"cmd.exe","/c","%java_home%\\bin\\jar.exe"});
              Process process = processBuilder.start();
              BufferedReader inputReader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
              String line = inputReader.readLine();
              while(line != null){
                   System.out.println(line);
                   line = inputReader.readLine();
    does anybody knows why
    Regards
    Edited by: Mayur Mitkari on Mar 5, 2013 10:19 PM
    Edited by: Mayur Mitkari on Mar 5, 2013 10:20 PM
    Edited by: Mayur Mitkari on Mar 5, 2013 10:20 PM

    sorry for that , but the
    Runtime runtime = Runtime.getRuntime();
              Process proc = runtime.exec(new String[]{"cmd.exe","/c","jar"});
              proc.waitFor();
    int i = proc.exitValue();
    this code was different from first one
    and in case of Process if runtime .exec is succesful it is wainting for long time , in this case i want if the runtime.exec is succesful something should be returned
    Regards

  • Running sql queries in Javascript

    Have built a form with numerous rows based on Stefan Cameron's methodology (http://forms.stefcameron.com/2006/10/12/displaying-all-records-from-an-odbc-data-connecti on/) and have gotten that part to work.
    Need to use a sql query to get a subset opf the data, but Stefan's and other examples use Formcalc.  I figure I just need to do a delayed query once I get the query set up and loaded.
    Drawing a blank on how and where to load the sql query string.
    Thanks in advance,
    Patrick

    Stefan's code is very useful when you want to display a single record. Typically I woudl enter a value on a field and use that entered value as part of teh record search in my SQL statement (usually with a delayed open of the DB). If you want to get a subset of records and simply navigate through them that code is not neccessary. You can change the settings when you set up the dataconnection to enter a SQL command and enter it in the 1st panel. Then when the connection is made that SQL statement will run each time.

  • SQL Inseting a Set Of Data To Run SQL Queries and Produce a Data Table

    Hello,
    I am an absolute newbie to SQL.
    I have purchased the book "Oracle 10g The Complete Reference" by Kevin Loney.
    I have read through the introductory chapters regarding relational databases and am attempting to copy and paste the following data and run an SQL search from the preset data.
    However when I attempt to start my database and enter the data by using copy and paste into the following:
    C:\Windows\system32 - "Cut Copy & Paste" rem **************** onwards
    I receive the following message: drop table Newspaper;
    'drop' is not recognised as an external or internal command, operable programme or batch file.
    Any idea how one would overcome this initial proble?
    Many thanks for any solutions to this problem.
    rem *******************
    rem The NEWSPAPER Table
    rem *******************
    drop table NEWSPAPER;
    create table NEWSPAPER (
    Feature VARCHAR2(15) not null,
    Section CHAR(1),
    Page NUMBER
    insert into NEWSPAPER values ('National News', 'A', 1);
    insert into NEWSPAPER values ('Sports', 'D', 1);
    insert into NEWSPAPER values ('Editorials', 'A', 12);
    insert into NEWSPAPER values ('Business', 'E', 1);
    insert into NEWSPAPER values ('Weather', 'C', 2);
    insert into NEWSPAPER values ('Television', 'B', 7);
    insert into NEWSPAPER values ('Births', 'F', 7);
    insert into NEWSPAPER values ('Classified', 'F', 8);
    insert into NEWSPAPER values ('Modern Life', 'B', 1);
    insert into NEWSPAPER values ('Comics', 'C', 4);
    insert into NEWSPAPER values ('Movies', 'B', 4);
    insert into NEWSPAPER values ('Bridge', 'B', 2);
    insert into NEWSPAPER values ('Obituaries', 'F', 6);
    insert into NEWSPAPER values ('Doctor Is In', 'F', 6);
    rem *******************
    rem The NEWSPAPER Table
    rem *******************
    drop table NEWSPAPER;
    create table NEWSPAPER (
    Feature VARCHAR2(15) not null,
    Section CHAR(1),
    Page NUMBER
    insert into NEWSPAPER values ('National News', 'A', 1);
    insert into NEWSPAPER values ('Sports', 'D', 1);
    insert into NEWSPAPER values ('Editorials', 'A', 12);
    insert into NEWSPAPER values ('Business', 'E', 1);
    insert into NEWSPAPER values ('Weather', 'C', 2);
    insert into NEWSPAPER values ('Television', 'B', 7);
    insert into NEWSPAPER values ('Births', 'F', 7);
    insert into NEWSPAPER values ('Classified', 'F', 8);
    insert into NEWSPAPER values ('Modern Life', 'B', 1);
    insert into NEWSPAPER values ('Comics', 'C', 4);
    insert into NEWSPAPER values ('Movies', 'B', 4);
    insert into NEWSPAPER values ('Bridge', 'B', 2);
    insert into NEWSPAPER values ('Obituaries', 'F', 6);
    insert into NEWSPAPER values ('Doctor Is In', 'F', 6);

    You need to be in SQL*Plus logged in as a user.
    This page which I created for my Oracle students may be of some help:
    http://www.morganslibrary.org/reference/setup.html
    But to logon using "/ as sysdba" you must be in SQL*Plus (sqlplus.exe).

  • Run sql queries in online sqlplus........is that possible??

    Hi,
    I am a php/mysql programmer.In my office only mysql is installed.And as a junior programmer i have no privilege to install oracle in my machine or in our server.But i want to run some small oracle queries in order to gather knowledge in Oracle.I am looking for an online SQLPLUS...
    If something like that exists...please send me the link...

    You only said to run some oracle queries for that you need oracle, there is nothing like online sqlplusWell, there is some kind of "online SQL*Plus": it's not really SQL*Plus, you have limited privileges and disk space but you can create database objects in a Oracle database and run usual SQL statements using apex.oracle.com online service.
    Message was edited by:
    Pierre Forstmann

  • Error while running sql queries..

    Hi there,
    We are suppose to run gather schema stats..
    but while running the procedure we are getting following error..
    gather_schema.sql:
    exec fnd_stats.gather_schema_statistics('CMWCONN');
    exec fnd_stats.gather_schema_statistics('CMW');
    exec fnd_stats.gather_schema_statistics('ALL');
    SQL> @gather_schema.sql;
    BEGIN fnd_stats.gather_schema_statistics('CMWCONN'); END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00201: identifier 'FND_STATS.GATHER_SCHEMA_STATISTICS' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    BEGIN fnd_stats.gather_schema_statistics('CMW'); END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00201: identifier 'FND_STATS.GATHER_SCHEMA_STATISTICS' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    BEGIN fnd_stats.gather_schema_statistics('ALL'); END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00201: identifier 'FND_STATS.GATHER_SCHEMA_STATISTICS' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Could you give me the correct pl/sql procedure to run the query.
    Thanks,.
    Balu.

    Actually the script was working fine last week..we are using the following script
    SQL> exec fnd_stats.gather_schema_statistics('ALL');     
    but it throws me the following error
    BEGIN fnd_stats.gather_schema_statistics('ALL'); END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00201: identifier 'FND_STATS.GATHER_SCHEMA_STATISTICS' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

  • Running SQL Queries in PeopleSoft Application Designer

    Hi,
    I'd like to find out which peoplesoft tables contain two fields x and y. I have the sql query to do that, but I don't know where I can run that query from in application designer. Its quite possible that it will be done from "Query" window in Application Designer.
    Can someone tell me the steps to do this? I'm very new to PeopleSoft.
    thanks.
    Askar

    1. Open the QUERY tool from the AppDesigner.
    2. File/New
    3. Expand the record
    4. Click on PSRECFIELD
    5. Drag and drop to the right part of the window
    6. At the left window, drag and drop the fields RECNAME from the left (from the record PSRECFIELD) into the tab Field at the right
    7. At the left window, expend the record hierarchy of PSRECFIELD
    8. Expand PSRECDEN Record Definition
    9. Right click on PSRECFIELD Field definition, then "New join"
    10. Choose Standard join
    11. At the right, click on tab Criteria
    12. Drag and drop the FIELDNAME field from the first PSRECFIELD (A)
    13. Double click on Expression 2
    14. In the new window, enter one of the first column name you want to retrieve
    15. Drag and drop the FIELDNAME field from the second PSRECFIELD (C)
    16. Double click on Expression 2
    17. In the new window, enter one of the second column name you want to retrieve
    18. Double click on Logical column at the right until to have "AND"
    19. Click on tab Result
    20. Click on Run query (or File/Run current query)
    21. Enjoy with your results.
    Note, QUERY tool will query the Peoplesoft tables, on the other hands, the Peoplesoft metamodel. If you have built objects directly against the database without having used AppDesigner, you won't be able to retrieve the data.
    Nicolas.

  • Update SQL queries through a browser

    Hi
    I am trying to develop the functionality for a user to modify
    a query through a browser. bacically i have the query SELECT * FROM
    tbProjMonth WHERE ID= "%VALUE%. I want the user to be able change
    the WHERE value, without loading the page up in dreamweaver. the
    VALUE has to be stored until the user wants to change the ID VALUE
    again.
    hope im making sense.
    do anyone know any ideas on how to do this??
    thanks for your help.
    kamesh

    This is a security headache, just waiting for a hacker to do
    sql injection. If you don't know what that is, check out
    http://www.unixwiz.net/techtips/sql-injection.html
    for nice tutorial.

  • Run batch files through java code

    Hi All
    I need to run a batch file using java code . I am not getting any error, but also no output. Can someone let me know the problem with my code.The code i am using is
    import java.io.*;
    public class batchtest {
         public static void main(String[] args) {
              Runtime r = Runtime.getRuntime();
         Process p= null;
         String line;
              try{
              p = r.exec("cmd /c testBatch.bat");
              BufferedReader input = new BufferedReader
              (new InputStreamReader(p.getInputStream()));
         while ((line = input.readLine()) != null) {
         System.out.println(line);
         input.close();
              System.out.println("running...");
              }catch(Exception e)
                   e.printStackTrace();
    }

    Maybe this helps:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Run sql query through batch file

    how to create a batch file so that on running the batch file,
    I should get into the database using username and password and create the table and insert values inside that table

    kindly, if you are using windows you can create 2 files as following:
    a.bat
    b.sql
    put the files under spacific folder for example d:\bat folder
    -first file a.bat will contain the following:
    sqlplus apps/apps@yourdb @d:\bat\B.sql
    exit
    -second file b.sql will contain any sql statments you want as following:
    create table a (a1 number, a2 varchar2(100))
    insert into a (a1,a2) values(1,'Test')
    commit
    exit;
    hope this help you
    Regards ...
    Edited by: shedo76 on 28/04/2012 03:14 ص

  • How to run solaris commands through java code ....

    Hi,
    actually i want to run some solaris commands for zipping some files on Solaris OS...
    any idea how can i do that ?
    thanks

    public class TABLES
    public static void main( String[] args )
                      //database is connected
            try
                   Connection con = null;
                   Statement stmt = null;
                   String strShowTables = "";
                ResultSet resultSet = null;
                   // CBA Statistics period is m_lStatisticsPeriod minutes
                   con = DriverManager.getConnection( g_strRWURI, g_strRWUsername, g_strRWPassword );
                   stmt = con.createStatement();
               ResultSet rs = stmt.executeQuery("use db");
             resultSet = stmt.executeQuery(strShowTables);
        String tableName = "";
             while(resultSet.next()){
    tableName = resultSet.getString(1);
              System.out.println(tableName);
            break;
    String strCmd = "tar cvzf file.tar.gz var/lib/mysql/db/GROUPS.*";
    Process p= Runtime.getRuntime().exec(strCmd);
    System.out.println(strCmd);
        stmt.close();
                rs.close();
                resultSet.close();
                   con.close();
              catch ( Exception e )
                   System.out.println( ": Failed to create database connection (" + e.getMessage() + ")" );
                   e.printStackTrace();
              catch ( Throwable t )
                   System.out.println( " Throwable: " + t.getMessage() );
                   t.printStackTrace();
        }//end of main mehtod
    }//END OF CLASSi hava tried the above code... what the problem is
    when is run that command on shell >    tar cvzf file.tar.gz var/lib/mysql/db/GROUPS.*i works fine but in code even though it didn't give any error but the created "file.tar.gz" is empty...
    Edited by: aftab_ali on Apr 7, 2009 7:15 AM
    Edited by: aftab_ali on Apr 7, 2009 7:17 AM

Maybe you are looking for