Is it that we cannot run sql statement in main??

Hi all,
sorry to bother again. But i have some problems. I had a program that have main method and some other small methods that contains some sql statement that call the db to retrieve info. But it keep on prompting me error: "Connection refused. Check that the hostname and port is correct, and that the postmaster is running with the -i flag, which enables TCP/IP networking.".
My program reside in the server but i really don't why i cannot run it. Is it because the main program cannot run with database and sql statement.
Please reply asap. Thank You!

This sound very much that your postgress isn't running (or if it isn't it wasn't started with the -i flag)
Are you sure postgres (=postmaster) is running
Thomas

Similar Messages

  • Run SQL statements from a textbox

    Hi
    I'm trying to execute multiple insert/update or Delete statements from a textarea of a page. I'm basically trying to replicate the same functionalility as SQL Workshop for users to access and run sql statements for it.
    I know in SQL workshop you can run multiple insert/update or delete statements using the following syntax:
    begin
    insert into table_1 (col1,col2)values('WER','QWE');
    Insert into table_1 (col1,col2)values('ABC','DEF');
    End;
    I have created a textarea called :P1_SQL with a submit button which when pressed it runs the execute immediate :P1_SQL. It works if its a single insert command. I've tried the begin...end option which bring up the following error message:
    ORA-06550: line 1, column 6: PLS-00103: Encountered the symbol "" when expecting one of the following: begin case declare exit for goto if loop mod null pragma raise return select update while with << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe The symbol "begin was inserted before "" to
    Any ideas how I could get this to work?
    Message was edited by:
    Funkymonkey2

    The process code that I have is as follows:
    Declare
    l_sql varchar2 (4000);
    begin
    l_sql := :P3_SQL;
    execute immediate l_sql;
    End;
    in the textarea I had entered the following
    begin
    insert into TBL_TEST_SQL(name,useR_id)values('abc','erf' );
    insert into TBL_TEST_SQL(name,useR_id)values('dec','erf');
    end;
    I was actually hoping to concatanate the 'begin...' part and the 'end;/' part on to the beginning and end of the sql statements.
    Any ideas??

  • RMAN-10006: error running SQL statement: alter session set remote_dependenc

    Backups are failing with following error
    RMAN-00554: initialization of internal recovery manager package failed
    RMAN-12001: could not open channel default
    RMAN-10008: could not create channel context
    RMAN-10002: ORACLE error: ORA-00096: invalid value SIGNATURE for parameter remote_dependencies_mode, must be from among MANUAL, AUTO
    RMAN-10006: error running SQL statement: alter session set remote_dependencies_mode = signature
    Not able to change to signature
    SQL> alter session set remote_dependencies_mode=signature;
    ERROR:
    ORA-00096: invalid value SIGNATURE for parameter remote_dependencies_mode, must
    be from among MANUAL, AUTO
    I dont see MANUAL or AUTO as valid value for this parameter (http://download.oracle.com/docs/cd/B10501_01/server.920/a96536/ch1175.htm#1023124) DB version is 9.2.0
    Parameter type
    String
    Syntax
    REMOTE_DEPENDENCIES_MODE = {TIMESTAMP | SIGNATURE}
    Default value
    TIMESTAMP
    Parameter class
    Dynamic: ALTER SESSION, ALTER SYSTEM
    =======================================
    I believe it could be because of following bug
    "A PRE-PATCHED ORACLE IMAGE CAN BE INSTALLED IN MEMORY "
    Refer: "https://metalink2.oracle.com/metalink/plsql/f?p=130:15:1613505143885559758::::p15_database_id,p15_docid,p15_show_header,p15_show_help,p15_black_frame,p15_font:BUG,4610411,1,1,1,helvetica"
    I appreciate your effort in fixing this issue.
    Edited by: user10610722 on Nov 25, 2008 4:37 PM

    Hi:
    It seems when you are starting RMAN it's executing some commands (one 'ALTER SESSION...'. It's seems to be a batch which has a bad value for SORT_AREA_SIZE. Find it and modify to a proper value as message shows. If you can't find start RMAN by calling directly the executable ($ORACLE_HOME/bin/rman or %ORACLE_HOME%/bin/rman.exe).

  • Where to run SQL statements in Oracle Database 11gR1 ?

    Folks,
    Hello. I have just installed Oracle Database 11gR1 and login to Database Control page. There are 4 tabs on the top: Database, Setup, Preference, Help and Logout.
    I just create a table "table1" in "Database" tap. But I don't see anywhere to run SQL statement such as Select, Insert, Update.
    Can any folk tell me where to run SQL statements in Oracle Database 11gR1 ?
    Or
    Can any folk provide a User Manual for Oracle DB 11gR1 ?

    You can run from a terminal or install an SQL client and connect from there.
    http://www.articlesbase.com/databases-articles/how-to-install-oracle-11g-client-1793770.html
    Best Regards
    mseberg
    Assuming you have an oracle OS user on Linux you can try typing sqlplus at you OS command prompt. Generally you will have a .bash_profile with setting like this:
    # User specific environment and startup programs
    PATH=$PATH:$HOME/bin
    export PATH
    # Oracle Settings
    TMP=/tmp; export TMP
    TMPDIR=$TMP; export TMPDIR
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=/u01/app/oracle/product/11.2.0
    #export DISPLAY=localhost:0.0
    export TZ=CST6CDT 
    export ORACLE_SID=ORCL
    export ORACLE_TERM=xterm
    #export TNS_ADMIN= Set if sqlnet.ora, tnsnames.ora, etc. are not in $ORACLE_HOME/network/admin
    export NLS_LANG=AMERICAN;
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
    export LD_LIBRARY_PATH
    # Set shell search paths
    PATH=/usr/sbin:$PATH; export PATH
    export PATH=$PATH:$ORACLE_HOME/bin
    # CLASSPATH:
    CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
    CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
    export EDITOR=vi
    set -o vi
    PS1='$PWD:$ORACLE_SID >'Edited by: mseberg on Jul 11, 2011 3:18 PM

  • Run sql statements in PL/Sql Developer without installing Oracle database?

    Hi all,
    I wish to ask is there any possibility to run Run sql statements in PL/Sql Developer without installing Oracle database?
    Regards.

    Hello Jimmy,
    this is the forum for the tool SQL Developer and, as the title says, *(Not for general SQL/PLSQL questions)*.
    PL/Sql Developer is not an Oracle tool, but from allound allroundautomations.
    And you need access to a database to run SQL statements. This does not need to be one installed by yourself.
    Regards
    Marcus

  • What can be the cause of Web ADI error : Cannot execute SQL statement?

    I created a custom integrator in r12.2.3 and while loading I encountered an error, Cannot execute SQL statement.
    I checked my setup in Interface attribute , the RUN_ID column has a default type SQL QUERY with a default value SELECT  XXCONV_EAM_ASSET_NUM_S.NEXTVAL FROM DUAL.
    If I have a right setup here, what can be the cause of this error?

    Hi,
    The possibilities can be of various reasons, with the sql statements,
    xml descriptors, data sources, improper drivers anything. To crack down
    the solution, kindly let me know the error messages and what exactly are
    you trying to accomplish.
    Thanks & Regards
    Raj
    manimaran t wrote:
    what may be the cause of this error java.sql.SQLException: invalid sql
    type passed to callable statement in iplanet ussing JNDI
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • Current running sql statement in procedure?

    How to identify the current running sql statement in procedure or package? From the v$sqlarea, i can see the only procedure name with parameters, but not current execution statement? is there any dba view to know the current execution statement in 9i & 10g ?

    hi
    u can also use dba_source view to know which sql statement issued by which user

  • Detect I/O before running sql statement

    Hi all,
    how do I detect I/O before running sql statement?

    do you mean:
    how do I know how much I/O is occurring before running a query?
    or
    how do I know how much I/O will be used to retrieve the data for this query?
    Which OS? You can look at OEM and "top" to see your current I/O. Detecting and deciding on whether or not you want to continue to submit the query is another problem.
    The question is: what problem are trying to solve? Is it really a problem or just something you imagine might occur???
    Don't try to fix a non-existent problem.

  • Run sql statement in green screen

    dear as/400 guru,
    i wonder how to execute sql statement in green screen ?
    my statement would be something as below
    select mandt from sapr3.usr02 where bname='kent';
    basically i want to check my id "kent" is available in which clients in an instance. and i was advised to run above sql statement.
    comment and advice will be highly appreciated.
    thanks
    regards,
    kent
    as/400 newbie

    Hi Kent,
    if you are looking for something, that reminds the old SQLs and uses a "/" for the delimiter, get the free STR(CON)SQL tool :
    http://www.easymarketplace.de/strsql-sqlutil.php
    If you do not receive a mail within 15 minutes, please drop me a mail, I will then reply with the user & pwd ...
    Regards
    Volker Gueldenpfennig, consolut international ag
    http://www.consolut.de - http://www.4soi.de - http://www.easymarketplace.de

  • Run SQL statement from APPS

    Hello
    I have SQL statement with parameters and I want client to run it from APPS.
    What should I do for this.

    What client are you talking about? Something like sql*plus? Or do you mean the Oracle Apps GUI front end?
    The best way is to properly set this up as a concurrent request. That will allow the user to enter any parameters and run it whenever. But that's an issue for a different forum.
    Whatever you do, don't give out the apps password <shudder>

  • Cannot run SQL script on Oracle Database 10g Express Edition

    I'm trying to upload a script, and the file is being uploaded fine, but in the Script Editor window where I'm going to actually run the script, the entire file content is shown on one line and the whole edit area is in red. I'm not being able to run that script. Also if I create a new script from the editor, the edit area is again in red and I'm not able to save it. Please help me understand what's to be done so that I can run my SQL scripts.

    I'd bet the database is down.
    Try a login through sqlplus ("Run SQL Command Line" in the Oracle Express Edition 'Start' menu).
    Do a CONN / AS SYSDBA
    If you get a message about database or memory area not available, try STARTUP.
    If that doesn't work, you are best off in the General Database forum or the Express Edition forum.
    You'll probably get the most expert response in General Database, but the Express Edition forum can be gentler on newbies (as it is more accepted that questioners are not and do not have access to full-time DBAs).

  • Run sql statement from batch file

    How can we execute SQL Statement using Batch file???
    I did a test.
    create batch file test.bat
    sqlplus "username@db /pass" @\script.sql
    script.sql file has following statement
    select sysdate from dual;
    exit
    it is working but I want to call sql statement in the same batch file instead of calling .sql script file. how can I do that any idea..

    This is very easy in unix shell scripting, but AFAIK, not available with Windows. It's a function of how the shell/command processor handles input redirection.

  • How do I run SQL statements with my GUI ?

    Hello,
    i created a simple GUI with a status text box on top and a text box on the bottom to type in sql commands. Can somebody help me modify my code so that I can at least run a create table command and give the status of "successful create table" in the top text box?
    One other question I have is that I already have a login screen gui that creates the sql connection and that gui calls this gui. Do I have to pass this connection to this new class or not? and if so, how do i do it? thanks again!
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.JFrame;
    import javax.swing.*;
    import java.sql.*;
    public class SqlGui extends JFrame {
            public SqlGui() {
                    super("Oracle SQL Application");
                    setDefaultCloseOperation(EXIT_ON_CLOSE);
                    JTextArea outputArea = new JTextArea("output here",20, 0);
                    outputArea.setLineWrap(true);
                    JScrollPane scrollOutputArea = new JScrollPane(outputArea);
                    JTextArea inputArea =
                            new JTextArea("enter commands here",2, 20);
                    inputArea.setLineWrap(true);
                    JScrollPane scrollInputArea = new JScrollPane(inputArea);
                    JPanel buttonPanel = new JPanel();
                    JButton executeButton = new JButton("Execute Command");
                    buttonPanel.add(executeButton);
                    // do work here?
                    JButton exitButton = new JButton("Exit");
                    exitButton.addActionListener(new ActionListener() {
                                                         public void actionPerformed(
                                                                 ActionEvent ae) {
                                                                 dispose();
                    buttonPanel.add(exitButton);
                    JPanel sqlPanel = new JPanel(new BorderLayout());
                    sqlPanel.add(scrollInputArea);
                    sqlPanel.add(buttonPanel, BorderLayout.SOUTH);
                    JSplitPane mainsplit =
                            new JSplitPane(JSplitPane.VERTICAL_SPLIT,
                            scrollOutputArea, sqlPanel);
                    getContentPane().add(mainsplit);
                    setSize(800, 500);
                    setLocationRelativeTo(null);
                    setVisible(true);
    }

    Hello,
    There are two ways to execute the SQL command in GUI , one by passing the connection object from other scree as specified by you is logic screen (write a constructor which takes connection parameter as input) else create the connection in this present GUI screen also as shown by me.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.JFrame;
    import javax.swing.*;
    import java.sql.*;
    public class SqlGui extends JFrame implements ActionListener{
         String url; // url providing the database details
         Connection connect;
         JTextArea inputArea;
         JButton executeButton;
         JTextArea outputArea;
         public SqlGui() {
              super("Oracle SQL Application");
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              try
                        url = "jdbc:odbc:dsnName";
                        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                                  // url , userid, pwd of database like scott,tiger
                        connect = DriverManager.getConnection(url,"userid",
                                                                               "password");
                        System.out.println("Connection Sucessful \n") ;
                   catch (ClassNotFoundException cnfex)
                        cnfex.printStackTrace();
                        System.out.println("Connection Failed " + cnfex.toString());
                   catch (SQLException exp)
                        System.out.println(exp);
              outputArea = new JTextArea("output here",20, 0);
              outputArea.setLineWrap(true);
              JScrollPane scrollOutputArea = new JScrollPane(outputArea);
              inputArea = new JTextArea("enter commands here",2, 20);
              inputArea.setLineWrap(true);
              JScrollPane scrollInputArea = new JScrollPane(inputArea);
              JPanel buttonPanel = new JPanel();
              executeButton = new JButton("Execute Command");
              executeButton.addActionListener(this);
              buttonPanel.add(executeButton); // do work here?
              JButton exitButton = new JButton("Exit");
              exitButton.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent ae) {
                        dispose();
              buttonPanel.add(exitButton);
              JPanel sqlPanel = new JPanel(new BorderLayout());
              sqlPanel.add(scrollInputArea);
              sqlPanel.add(buttonPanel, BorderLayout.SOUTH);
              JSplitPane mainsplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollOutputArea, sqlPanel); getContentPane().add(mainsplit);
              setSize(800, 500);
              setLocationRelativeTo(null);
              setVisible(true);
         public void actionPerformed(ActionEvent ae)     {
                   if (ae.getSource() == executeButton) {
                                                 // To clear the fields
                        create(inputArea.getText());
         public static void main(String args[]) {
         SqlGui app = new SqlGui();
         public void create(String SQLCommand) {
                   String query = SQLCommand;
                   outputArea.setText("The Result of Executing the query" + query );
                   try{
                   Statement st = connect.createStatement();
                   st.executeQuery(query);
                   JOptionPane.showMessageDialog(null,"Command Executed Sucessfully");
                   catch (SQLException sqlex) {
                        System.err.println("Unable to Execute Command :");
                        outputArea.setText("Unable to Execute Command :" +query);
                        sqlex.printStackTrace();
    Hope this sucessfully works for you.

  • Service that uses several insert sql statements

    Hello!  Is it possible to use one service, which updates two DB tables?  Also, one field in these two tables is the same, like the ProcessID? For example, here is the service:
    <tr>
      <td>EUM_WORKFLOW_UPDATE_ACTIONS</td>
      <td>Service
      3
      null
      null
      null<br>
      null</td>
      <td>2:IEumWorkflowActions:::null
            2:IEumWorkflowDocumentProcess:::null</td>-->
    </tr>
    Here are two separate SQL queries called from the above service:
    <tr>
      <td>IEumWorkflowActions</td>
      <td>INSERT INTO EUM_WORKFLOW_ACTIONS(WORKFLOWACTION, WKFLACTIONID) values (?, ?)</td>
      <td>WORKFLOWACTION varchar
      WKFLACTIONID int</td>
    </tr>
    <tr>
      <td>IEumWorkflowDocumentProcess</td>
      <td>INSERT INTO EUM_WORKFLOW_ACTIONS(WKFLACTIONID, DocumentProcessID, dDocName, dRevLabel) values (?, ?, ?, ?)</td>
      <td>WKFLACTIONIDint
      DocumentProcessID int
      dDocName varchar
      dRevLabel varchar</td>
    </tr>
    And here is how I call this service via GenericSoapPort call:  
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body xmlns:ns1="http://www.oracle.com/UCM">
        <ns1:GenericRequest webKey="cs">
          <ns1:Service IdcService="EUM_WORKFLOW_UPDATE_ACTIONS">
            <ns1:User></ns1:User>
            <ns1:Document>
              <ns1:Field name="WORKFLOWACTION">Reject</ns1:Field>
              <ns1:Field name="WKFLACTIONID">123</ns1:Field>
              <ns1:Field name="WKFLACTIONID">123</ns1:Field>
              <ns1:Field name="DocumentProcessID">45234</ns1:Field>
              <ns1:Field name="dDocName">1554322</ns1:Field>
              <ns1:Field name="dRevLabel">1A</ns1:Field>
            </ns1:Document>
          </ns1:Service>
        </ns1:GenericRequest>
      </soap:Body>
    </soap:Envelope>
    Would it be possible NOT to use the WKFLACTIONID twice in the service call somehow?
    Thank you for your help!

    Thank you for the confirmation that this would work.  I've also tried the Insert query like this:
    insert all
    into EUM_WORKFLOW_ACTIONS (WORKFLOWACTION, WKFLACTIONID) values (?, ?)
    into EUM_WORKFLOW_DOCUMENT_PROCESS (WKFLACTIONID, DOCUMENTPROCESSID) values (?, ?)
    select * from dual
    Would this single SQL be better for my purposes then the two statements?  If that would matter at all?
    Thank you!

  • Recently had my cd drive jam while using itunes, fixed that, but now itunes wont load, I get a message that: itunes cannot run because some of its required files are missing, please reinstall itunes.  I have an HP notebook that came with itunes installed,

    Ok, have itunes on my HP notebook, cant reinstall itunes unless I have a mac serial number, and don't know how I get that?

    Borbathegeek wrote:
    ... cant reinstall itunes unless I have a mac serial number, and don't know how I get that?
    That's crazy. A serial number is not required.
    Are you certain you chose the correct version to download?
    http://www.apple.com/itunes/download/
    If you are still having problems, remove and reinstall iTunes and all its components:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7

Maybe you are looking for

  • BO XI 3.1 SP3 and Excel 2010

    Hi There My BO is BO XI 3.1 SP3, and excel is 2010, my webi report has over 65523 rows, but I found in the excel, it will split into two tabs, it does not use excel 2010 feature does any one know the reason? thanks

  • JFrame not keeping focus

    How can I ensure that a JFrame will always keep focus?. I need it to always remain on top and be visible thanks

  • My ipad says charging but not

    hi can anyone help i have plugged in my ipad mini with the apple usb plug and lead it has the plug in the battery which says its charging but still after an hour it says 10% charged which it started on. the plug is the one that came with my Ipad mini

  • Running 10g forms in browser without any windows

    Hi, Is it possible to run the forms in the browser directly without any windows? I want the items in the canvas to be displayed on the browser (IE) without using windows. We are using Forms 10g release 2. Our application is a MDI application. Note: I

  • Google Earth 5, manageable?

    Hi all, I'm trying to install Google Earth 5.0 and it's a bit of a pig. It installs a "service" called "Keystone" which runs a daemon allowing Google to update their applications as they see fit (very dodgy practice obviously). Anyway, I need the sof