Sql statement  - compilation error

I have a sql statement in a method that looks something like this:
for each row in
SELECT *
FROM LASC.CMS.VW_CERTIFICATEOFGOODSTANDING1
WHERE barNum = LASC.CertificationRequest.barNum
do
display ...
end
when I try to compile it, I get an error saying:
SQL statements can only be used in functions or procedures that run on the server side.
I am fairly new to BPM, so I am not sure how to resolve this.
Any help would be greatly appreciated.
Lilach

here is the solution that Ignacio provided.
You could go to Properties tab on the right (in Studio) for this method and inside the Method Properties section, you have on boolean property called "Server Side Method". Check it on "True".
Hope this helps.
Ignacio

Similar Messages

  • SQLException: Closed Connection, SQL state [null]; error code [17002]

    Hello All,
    I am supporting a Java 5 project on Tomcat. We've used Spring and Stored Procedure in the project.
    Recently we deployed our application in a GoLive environment and have started seeing Timeout errors in log files. After around two days we also have to restart Tomcat as users are no more able to login to access the application.
    Same application runs fine without any timeout issues on another environment.
    The only difference between two environments is that the Go-Live env has a firewall between Tomcat and Database and the other environment hosts both Tomcat and Database on same machine (i.e. no firewall).
    For GoLive env the only port open on firewall for JDBC connection is 1521 and is used in the connection string url for obtaining the connections.
    When there is a Timeout error, the N/w admin guy observed that the JDBC connection was not attempted on 1521 port, but on some random port which is not open on firewall, due to which the Database server logs also do not show entry for this connection attempt as it gets blocked by the firewall.
    I am not sure why a randam port should be used to connect when a specific port is mentioned in the connection url? Also what can be making this port switching?
    Application uses Apache DBCP with Spring to obtain connections.
    Has anyone experienced similar errors?
    Any suggestions/help on this issue is greatly appreciated!
    Many Thanks,
    CD
    ===============================
    Error Log Extract:
    Error while extracting database product name - falling back to empty error codes
    org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: Closed Connection
    java.sql.SQLException: Closed Connection
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
    at oracle.jdbc.driver.PhysicalConnection.getMetaData(PhysicalConnection.java:1605)
    at org.apache.commons.dbcp.DelegatingConnection.getMetaData(DelegatingConnection.java:247)
    at org.apache.commons.dbcp.DelegatingConnection.getMetaData(DelegatingConnection.java:247)
    at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.getMetaData(PoolingDataSource.java:231)
    at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:172)
    at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:207)
    at org.springframework.jdbc.support.SQLErrorCodesFactory.getErrorCodes(SQLErrorCodesFactory.java:187)
    at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.setDataSource(SQLErrorCodeSQLExceptionTranslator.java:126)
    at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.<init>(SQLErrorCodeSQLExceptionTranslator.java:92)
    at org.springframework.jdbc.support.JdbcAccessor.getExceptionTranslator(JdbcAccessor.java:96)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:294)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:348)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:352)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:356)
    at com.o2.morse.dao.impl.sql.UserDaoImpl.batchLoad(UserDaoImpl.java:371)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
    at $Proxy3.batchLoad(Unknown Source)
    at com.o2.morse.domain.User.doHousekeeping(User.java:667)
    at com.o2.morse.domain.User$$FastClassByCGLIB$$372ff70b.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.domain.User$$EnhancerByCGLIB$$d5ac966a.doHousekeeping(<generated>)
    at com.o2.morse.scheduler.EndOfDay.run(EndOfDay.java:63)
    at com.o2.morse.scheduler.EndOfDay$$FastClassByCGLIB$$3b2d4927.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.scheduler.EndOfDay$$EnhancerByCGLIB$$488a9f86.run(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:248)
    at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:165)
    at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:90)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
    Could not close JDBC Connection
    java.sql.SQLException: Already closed.
    at org.apache.commons.dbcp.PoolableConnection.close(PoolableConnection.java:77)
    at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:180)
    at org.springframework.jdbc.datasource.DataSourceUtils.doReleaseConnection(DataSourceUtils.java:286)
    at org.springframework.jdbc.datasource.DataSourceUtils.releaseConnection(DataSourceUtils.java:247)
    at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCleanupAfterCompletion(DataSourceTransactionManager.java:297)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:754)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:615)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:560)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.doCloseTransactionAfterThrowing(TransactionAspectSupport.java:284)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:100)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
    at $Proxy3.batchLoad(Unknown Source)
    at com.o2.morse.domain.User.doHousekeeping(User.java:667)
    at com.o2.morse.domain.User$$FastClassByCGLIB$$372ff70b.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.domain.User$$EnhancerByCGLIB$$d5ac966a.doHousekeeping(<generated>)
    at com.o2.morse.scheduler.EndOfDay.run(EndOfDay.java:63)
    at com.o2.morse.scheduler.EndOfDay$$FastClassByCGLIB$$3b2d4927.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.scheduler.EndOfDay$$EnhancerByCGLIB$$488a9f86.run(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:248)
    at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:165)
    at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:90)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
    Application exception overridden by rollback exception
    org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [SELECT ID_USER_DETAILS, USERNAME, CREATED_ON, LAST_LOGIN FROM USER_DETAILS  WHERE STATUS = 157 AND SUPERUSER <> 'Y']; SQL state [null]; error code [17002] ; Io exception: Connection timed out; nested exception is java.sql.SQLException: Io exception: Connection timed out
    java.sql.SQLException: Io exception: Connection timed out
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
    at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:820)
    at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1049)
    at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:845)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1154)
    at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1313)
    at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205)
    at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205)
    at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:333)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:282)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:348)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:352)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:356)
    at com.o2.morse.dao.impl.sql.UserDaoImpl.batchLoad(UserDaoImpl.java:371)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
    at $Proxy3.batchLoad(Unknown Source)
    at com.o2.morse.domain.User.doHousekeeping(User.java:667)
    at com.o2.morse.domain.User$$FastClassByCGLIB$$372ff70b.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.domain.User$$EnhancerByCGLIB$$d5ac966a.doHousekeeping(<generated>)
    at com.o2.morse.scheduler.EndOfDay.run(EndOfDay.java:63)
    at com.o2.morse.scheduler.EndOfDay$$FastClassByCGLIB$$3b2d4927.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.scheduler.EndOfDay$$EnhancerByCGLIB$$488a9f86.run(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:248)
    at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:165)
    at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:90)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
    Batch Job Failed: org.springframework.transaction.TransactionSystemException: Could not roll back JDBC transaction; nested exception is java.sql.SQLException: Closed Connection

    I am using latest Jrockit 16)5, ojdbc6_g.jar,spring.jar Weblogic 10.3 and Oracle 10G 10.2.4 .. whatever but always get "Closed Connection"
    java.lang.Throwable: Closed Connection
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
    at oracle.jdbc.driver.PhysicalConnection.createStatement(PhysicalConnection.java:750)
    at oracle.jdbc.OracleConnectionWrapper.createStatement(OracleConnectionWrapper.java:183)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7053)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)

  • Using SQL Statements in Error Exceptions

    Is there any way to include SQL statements within my catch routines (i.e.
    catch (java.io.IOException ex) {
    System.out.println("An error occurred whilst writing to the message buffer: " + ex);
    #sql { INSERT INTO DEBUG_TBL(CURRENT_DT,PROGRAM_ID,DEBUG__MESG) VALUES (SYSDATE,'TEST',:ex) };
    #sql { COMMIT };
    As it stands I get the following error upon compile:
    Error: Unsupported Java type for host item (at position#1): java.io.IOException
    Any help would be greatly appreciated.
    Thx,
    Boybles
    null

    You can use SQL statements in your catch blocks, just not SQL statements that use Java types which do not map to SQL.
    You cannot pass exceptions from Java to SQL. You can catch a SQL exceptions as a SQLException in Java. However, any exception that is thrown by a Java Stored Procedure (including SQLException) is rendered as an "Uncaught Java exception" in SQL.
    When you receive a SQLException there is information about the originator, the error message, etc. in the exception object. See:
    http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/java.817/a83723/keyprog5.htm#1004462
    While you cannot insert a Java exception per se into a table, you can extract the message string(s)/code and insert that in a table.

  • PL/SQL Procedure Compilation error

    Hi,
    <br><br>
    I have wrote a PL/SQL Stored Procedure to read a couple of table values and then output some data to a file, when I create the procedure on the database I get the following compilation error:
    <br><br>
    LINE/COL ERROR<br>
    -------- -----------------------------------------------------------------<br>
    25/7 PLS-00103: Encountered the symbol ")" when expecting one of the<br>
    following:<br>
    ( - + case mod new null <an identifier><br>
    <a double-quoted delimited-identifier> <a bind variable> avg<br>
    count current max min prior sql stddev sum variance execute<br>
    forall merge time timestamp interval date<br>
    <a string literal with character set specification>
    <a number> <a single-quoted SQL string> pipe<br>
    The symbol "null" was substituted for ")" to continue.<br>
    <br>
    The script is below: <br><br>
    CREATE OR REPLACE <br>
         PROCEDURE TDF_EXTRACT AS<br>
    v_file UTL_FILE.FILE_TYPE;<br>
    YEAR number(4);<br>
    Q1_VALUE NUMBER(7);<br><br>
    BEGIN<br><br>
    SELECT PERSON_VALUE<br>
    INTO     Q1_VALUE<br>
    FROM PERSON<br>
    WHERE ID = 79;<br><br>
    SELECT EXTRACT(YEAR FROM SYSDATE)<br>
    INTO YEAR <br>
    FROM DUAL;<br><br>
    v_file := UTL_FILE.FOPEN(location => '/tmp',<br>
    filename => 'extratced_values.txt',<br>
    open_mode => 'W',<br>
    max_linesize => 32767);<br><br>
    UTL_FILE.PUT_LINE(v_file,<br>
    'Q1'     ||     YEAR     ||     '23'     ||     Q1_VALUE || '\r\n' ||<br>
              );<br><br>
    UTL_FILE.FCLOSE(v_file);<br><br>
    END TDF_EXTRACT;

    'Q1' || YEAR || '23' || Q1_VALUE || '\r\n' ||
    );Syntax error during concatenation, maybe?
    C.
    Message was edited by:
    cd

  • Wierd SQL Select Compile Error

    Hello.
    When I do my SQL like this:
    SQL SELECT cus_surname as "Surname",
    cus_forename as
    "FirstName",
    cus_telephone as
    "Telephone",
    cus_address as
    "Address1",
    cus_line1 as
    "Address2",
    cus_line2 as
    "Address3",
    cus_town as
    "Address4",
    cus_city as
    "Address5",
    cus_postcode as
    "Address6"
    INTO :lCustomer
    FROM msp_customers
    WHERE cus_serial = :lRefCustomer.Serial
    on session SessionToUse;
    I get this compile error:
    The read-only virtual attribute
    FoundationClasses.FoundationBusinessObject.IsNew can't be passed as an
    OUTPUT or an INPUT OUTPUT parameter.
    Yet if I remove the "as" from the SQL Select syntax it works, with no
    compile errors.
    Why? I don't understand why they are different!
    Tim Sawyer
    PanCredit
    Leeds, UK.
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    I added a DBMS_OUTPUT.put_line(l_wrap) in keith codes
    and run out put wrapped test codes in sqlplus and can see wrapped test procedure.
    create or replace procedure test wrapped
    a000000
    b2
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    abcd
    7
    11d 124
    ohyVALi7ang26ROCF0CZ3wLg6ngwgy7Q2SdqfC/p+D6E39xrRLEK0/eVVEVSORSTWoZXk1gi
    JT9nTrV3IXmGVbi5uMlIl+0C/WV9wPlFL5z37QfcEOYUdmLx8iwul2hEvDehUX0jLfiltHqx
    MhAgy16zDvWPfv5uE4HrlBvRAYoDmETXR7r10x/uyQyUxDw4sVyq6Ndh4GSFw9zp801nKSN1
    P0GOB03CtlcnrqAjQhASJKrP4sXW74oOyr373DBBP/CLndRTT0TZ1HvWVzAgL5C++Dl6PNyQ
    But I got compiled errors as
    Compilation errors for PROCEDURE SYS.TEST
    Error: PLS-00103: Encountered the symbol "ASWALLET_OPEN" when expecting one of the following:
    ( ; is with authid as cluster compress order using compiled
    wrapped external deterministic parallel_enable pipelined
    result_cache
    The symbol "is" was substituted for "ASWALLET_OPEN" to continue.
    Line: 1
    Text: create or replace procedure test wrapped
    Error: PLS-00103: Encountered the symbol "=" when expecting one of the following:
    constant exception <an identifier>
    <a double-quoted delimited-identifier> table long double ref
    char time timestamp interval date binary national character
    nchar
    The symbol "<an identifier>" was substituted for "=" to continue.
    Line: 1
    Text: create or replace procedure test wrapped
    Error: PLS-00103: Encountered the symbol "=" when expecting one of the following:
    constant exception <an identifier>
    <a double-quoted delimited-identifier> table long double ref
    char time timestamp interval date binary national character
    nchar
    Line: 1
    Text: create or replace procedure test wrapped
    .Bot trigger and procedure works well before wrapped.
    I use oracle 11g2 at window 2003.
    Thanks
    newdba

  • SQL State S0001 error code 18456 for named sql server : jdbc errors

    When I try to connect to named instance of SQL Server 2005,the error I get it
    The database user has data reader and writer rights.
    I have used sqljdbc4.jar
    url is jdbc:sqlserver://SERVER_NAME:1433;databaseName=DATABSE_NAME;user=USERNAME;password=USER_PASSWORD
    I also tried using the jtds driver and I get State 28000 error

    You might want to make sure that the instance is specified.
    For example, when connecting to SQL Server 2008 using DBVisualizer (free) with SingleSignOn authentication, you need to use the jTDS driver AND you have to specify the instance on the server in order to connect.
    Instance-less connection requests are rejected with the same error message as wrong password:
    java.sql.SQLException Error Code: 18456

  • Error in Trigger (PL/SQL: SQL Statement Ignored)

    Here is the trigger:
    CREATE OR REPLACE TRIGGER DRUGREPLACEMENT
    AFTER INSERT ON PHARMACEUTICALS
    REFERENCING NEW AS newDrugs
    FOR EACH ROW
    WHEN (newDrugs.drugname = newDrugs.genericname)
    BEGIN
    UPDATE prescription
    SET pharmaceuticalid = newDrugs.drugID
    WHERE pharmaceuticalid IN(SELECT pharmaceuticalid FROM prescription, pharmaceuticals WHERE drugid = pharmaceuticalid AND newDrugs.genericname = pharmaceutical.genericname);
    END;
    Error is:
    Error(2,1): PL/SQL: SQL Statement ignored
    Error(3,24): PL/SQL: ORA-00904: "NEWDRUGS"."DRUGID": invalid identifier
    pharmaceuticalid is a number in my prescription table.
    drugid is a number; genericname and drugname are both varchars in my pharmaceuticals table. Any idea why I am getting these errors? (I tried putting quotes around newdrugs.drugid but then it just said "newdrugs.drugid" is invalid. Thanks for your help
    -Brian

    One more thing. Your trigger is selecting from triggering table. So single row inserts will work, but multiple row inserts into PHARMACEUTICALS will fail with famous "table is mutating" error. There is no need to select from PHARMACEUTICALS. Change:
    UPDATE ************
    SET pharmaceuticalid = newDrugs.drugID
    WHERE pharmaceuticalid IN(SELECT pharmaceuticalid FROM ************, pharmaceuticals WHERE drugid = pharmaceuticalid AND newDrugs.genericname = pharmaceutical.genericname);to
    UPDATE ************
      SET pharmaceuticalid = newDrugs.drugID
      WHERE pharmaceuticalid IN (
                                 SELECT pharmaceuticalid
                                   FROM ************
                                   WHERE drugid = :newDrugs.pharmaceuticalid
                                     AND :newDrugs.genericname = pharmaceutical.genericname
                                );SY.

  • Reports compilation errors (6i to 9i)

    Hello,
    When migrating a report from Oracle 6i to Oracle 9i, I get a number of errors.
    Here are 2 sample functions and the associated errors at compile time:
    function AfterReports return boolean is
    begin
    /* Delete referenced files */
    update lot
    set ref_file = null;
    ref_filenum = null;
    where co = :p_co
    and (lot.surveyor = :p_surveyor or :p_surveyor is null)
    and ref_filenum = :p_project;
    /* Flag the project to indicate that work order as been printed */
    update thproject
    set prtwrkord = 'Y'
    where co = :p_co
    and nvl(prtwrkord,'N') = 'N'
    and project = :p_project;
    return (TRUE);
    end;
    When trying to compile this function under Reports Oracle 9i, I get the following errors:
    Error 201 at line 4, column 11
    identifier 'LOT' must be declared
    Error 0 at line 4, column 4
    SQL statement ignored
    Error 201 at line 12, column 9
    identifier 'TBPROJECT' must be declared
    Error 0 at line 12, column 2
    SQL Statement ignored.
    =====
    function BeforeReport return boolean is
    trouver BOOLEAN;
    CURSOR CURS is select c c.co
    from company c, userco u
    where c.co = u.co
    and u.userid = user;
    begin
    open curs;
    fetch curs into :p.co
    trouver := curs%FOUND;
    close curs;
    return (trouver);
    end;
    Error 201 at line 4, column 12
    identifier 'COMPANY' must be declared
    Error 0 at line 3, column 20
    SQL Statement ignored.
    =====
    1) How can I go about resolving these compilation errors and generate the corresponding *.REP file ?
    Paolo

    At first glance it seems to me that you are missing a comma between ref_file and ref_filenum as below
    /* Delete referenced files */
    update lot
    set ref_file = null;
    ref_filenum = null;
    where co = :p_co
    and (lot.surveyor = :p_surveyor or :p_surveyor is null)
    and ref_filenum = :p_project;
    should be:
    /* Delete referenced files */
    update lot
    set ref_file = null,
    ref_filenum = null;
    where co = :p_co
    and (lot.surveyor = :p_surveyor or :p_surveyor is null)
    and ref_filenum = :p_project;
    HTH

  • What does || do in a SQL statement after a where with a like?

    We have a packaged application that outputs a SQL statement with the || operator in a where clause along with a LIKE. I have never seen it before and expected it to be a syntax error. I do not see any examples of this syntax in sources such as Morgan's Library.
    For example purposes, observe in the 10g Express Edition currently up for download. Observe that the SQL statement "compiles" when the || operator is used before a like statement, but does not "compile" when used on its own - it gives the error I expected that || is not a relational operator. What does this syntax do?
    For orignal context, the relevant portion of the where clause is:
    T1.QUOTE_NUM || :3 || T1.REV_NUM LIKE :4but the below does so just off of what is available in any instance - much easier to reproduce.
      1  select * from v$sqltext
      2* where (hash_value || 3657695316 || sql_text like 'L%')
    SQL> /
    no rows selected
    SQL> edit
    Wrote file afiedt.buf
      1  select * from v$sqltext
      2* where (hash_value || 3657695316)
    SQL> /
    where (hash_value || 3657695316)
    ERROR at line 2:
    ORA-00920: invalid relational operator
    [pre]
    Thanks for your attention and advice.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    I may have answered my own question. It appears that you can use the || to concatenate strings for comparison with a relational operator as in the example below. I've just never seen this before. Can anyone confirm this is what it really does?
    SQL> select count(*) from dual;
      COUNT(*)
             1
    SQL> select count(*) from dual
      2  where '123' = '123';
      COUNT(*)
             1
    SQL> edit
    Wrote file afiedt.buf
      1  select count(*) from dual
      2* where '123' = '124'
    SQL> /
      COUNT(*)
             0
    SQL> edit
    Wrote file afiedt.buf
      1  select count(*) from dual
      2* where '1' || '23' = '123'
    SQL> /
      COUNT(*)
             1
    SQL> edit
    Wrote file afiedt.buf
      1  select count(*) from dual
      2* where '1' || '23' = '124'
    SQL> /
      COUNT(*)
             0

  • (SD 1.5.4.59.40) Compilation with coment - success with compilation error

    Hi!
    If I run this script:
    create table t(n number);
    create or replace
    TRIGGER t1
    -- Coment wiсh work!
    BEFORE UPDATE ON t
    REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW
    DECLARE
    past_due EXCEPTION;
    begin
    if 1 = 1 then
    raise_application_error(-20001, 'First trigger!' , TRUE);
    end if;
    end t1;
    +/+
    create or replace
    -- Coment with error
    TRIGGER t2
    BEFORE UPDATE ON t
    REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW
    DECLARE
    past_due EXCEPTION;
    begin
    if 1 <> 1 then
    raise_application_error(-20001, 'Second trigger!' , TRUE);
    end if;
    end;
    +/+
    Result:
    +SQL Command: create or replace --+
    Failed: ORA-24344: success with compilation error
    +24344. 00000 - "success with compilation error"+
    *Cause:    A sql/plsql compilation error occurred.+
    *Action:   Return OCI_SUCCESS_WITH_INFO along with the error code+
    anonymous block completed
    trigger text in SLD Developer:
    create or replace TRIGGER t2
    BEFORE UPDATE ON t
    REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW
    DECLARE
    past_due EXCEPTION

    It looks to me like there is a bug in the logic that determines if the current statement is SQL (terminated by ";") or PL/SQL (terminated by "/") - putting the comment before the object type you are creating is causing SQL Developer to assume it is SQL and it stops the statement at the first ";".
    The same thing happens if you try to create a package with a comment between the "create or replace" and the "package", for example:
    create or replace
    -- comment
    package xxx_pkg
    i number;
    j number;
    end;
    /creates a package with the following source, executing as a statement (so long as the cursor is between the create and the first ";"):
    package xxx_pkg
    i numbertheFurryOne

  • Newbie Trouble Figuring Out Compile Error in Procedure

    I'm inexperienced at PL/SQL programming and I've been reading through the 10gR2 PL/SQL user's guide trying to figure out what's wrong with my procedure but I'm not having any luck. I would appreciate your help.
    I wanted a procedure that I could use on small tables (which are not partitioned by date) that I could use to delete rows older than days_old days old. I wanted it to be generic so I didn't want to have to hard code the table name (table_name), table's primary key (primary_key) or the name of the column in table_name that I wanted to match dates against. Here's what I came up with:
    CREATE OR REPLACE PROCEDURE delete_old_rows (table_name VARCHAR2, primary_key VARCHAR2, date_col_name VARCHAR2, days_old NUMBER) AS
    v_sql VARCHAR2(256);
    CURSOR rows_to_delete IS
    SELECT primary_key FROM table_name WHERE date_col_name < trunc(SYSDATE) - days_old;
    BEGIN
    FOR del_rows in rows_to_delete
    LOOP
    SELECT 'DELETE FROM table_name WHERE date_col_name = del_rows.date_col_name' INTO v_sql FROM dual;
    DBMS_OUTPUT.PUT_LINE(v_sql);
    -- EXECUTE IMMEDIATE v_sql;
    END LOOP;
    END;
    SHOW ERRORS;
    The compiler seems to be okay with my use of primary_key, date_col_name, and days_old as variables but when I start using the table_name variable I get a "SQL Statement Ignored" error on the SELECT in the CURSOR and a "table or view does not exist" error on the same statement.
    So, it compiles okay without using the table_name variable but it does no compile okay when I start using it.
    And yes, I know the EXECUTE IMMEDIATE is commented out -- I'm still developing it.
    Thank you

    Currently your cursor is referring to a table called "table_name" with a column called "date_col_name". To build a dynamic cursor using the table_name etc parameter values you are going to need dynamic sql, e.g:
    OPEN c_rows_to_delete FOR
        'SELECT primary_key FROM ' || table_name || ' WHERE ' || date_col_name || ' < trunc(SYSDATE)';where c_rows_to_delete is declared as a SYS_REFCURSOR. You can't use a Cursor FOR loop on ref cursors.
    Also PL/SQL has a handy assignment operator ":=" so you don't need to SELECT INTO FROM DUAL.
    Generally dynamic code is something to be used as a last resort.

  • Compilation Error for prvtbkrs.plb execution

    I tried to solve the issue for RMAN connection and i run this script
    prvtbkrs.plb
    Warning: Package Body created with compilation errors.
    SQL> show err
    Errors for PACKAGE BODY DBMS_BACKUP_RESTORE:
    LINE/COL ERROR
    3975/7 PL/SQL: SQL Statement ignored
    3976/31 PL/SQL: ORA-00942: table or view does not exist
    4054/6 PL/SQL: SQL Statement ignored
    4054/35 PL/SQL: ORA-00942: table or view does not exist
    4072/6 PL/SQL: Statement ignored
    4072/6 PLS-00201: identifier 'SYS.DBMS_SYS_ERROR' must be declared
    5457/11 PL/SQL: SQL Statement ignored
    5459/18 PL/SQL: ORA-00942: table or view does not exist
    I cant connect using RMAN...Please help me with this issue.
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    ORA-04063: package body "SPS.DBMS_BACKUP_RESTORE" has errors
    ORA-06508: PL/SQL: could not find program unit being called: "SPS.DBMS_BACKUP_RESTORE"
    RMAN-04015: error setting target database character set to WE8MSWIN1252

    I run the script and
    SQL> @C:\app\Administrator\product\11.1.0\SPS\RDBMS\ADMIN\utlrp.sql
    SELECT dbms_registry_sys.time_stamp('utlrp_bgn') as timestamp from dual
    ERROR at line 1:
    ORA-00904: "DBMS_REGISTRY_SYS"."TIME_STAMP": invalid identifier
    DOC> The following PL/SQL block invokes UTL_RECOMP to recompile invalid
    DOC> objects in the database. Recompilation time is proportional to the
    DOC> number of invalid objects in the database, so this command may take
    DOC> a long time to execute on a database with a large number of invalid
    DOC> objects.
    DOC>
    DOC> Use the following queries to track recompilation progress:
    DOC>
    DOC> 1. Query returning the number of invalid objects remaining. This
    DOC> number should decrease with time.
    DOC> SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
    DOC>
    DOC> 2. Query returning the number of objects compiled so far. This number
    DOC> should increase with time.
    DOC> SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
    DOC>
    DOC> This script automatically chooses serial or parallel recompilation
    DOC> based on the number of CPUs available (parameter cpu_count) multiplied
    DOC> by the number of threads per CPU (parameter parallel_threads_per_cpu).
    DOC> On RAC, this number is added across all RAC nodes.
    DOC>
    DOC> UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
    DOC> recompilation. Jobs are created without instance affinity so that they
    DOC> can migrate across RAC nodes. Use the following queries to verify
    DOC> whether UTL_RECOMP jobs are being created and run correctly:
    DOC>
    DOC> 1. Query showing jobs created by UTL_RECOMP
    DOC> SELECT job_name FROM dba_scheduler_jobs
    DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
    DOC>
    DOC> 2. Query showing UTL_RECOMP jobs that are running
    DOC> SELECT job_name FROM dba_scheduler_running_jobs
    DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
    DOC>#
    utl_recomp.recomp_parallel(threads);
    ERROR at line 4:
    ORA-06550: line 4, column 4:
    PLS-00201: identifier 'UTL_RECOMP.RECOMP_PARALLEL' must be declared
    ORA-06550: line 4, column 4:
    PL/SQL: Statement ignored
    SELECT dbms_registry_sys.time_stamp('utlrp_end') as timestamp from dual
    ERROR at line 1:
    ORA-00904: "DBMS_REGISTRY_SYS"."TIME_STAMP": invalid identifier
    PL/SQL procedure successfully completed.
    DOC> The following query reports the number of objects that have compiled
    DOC> with errors (objects that compile with errors have status set to 3 in
    DOC> obj$). If the number is higher than expected, please examine the error
    DOC> messages reported with each object (using SHOW ERRORS) to see if they
    DOC> point to system misconfiguration or resource constraints that must be
    DOC> fixed before attempting to recompile these objects.
    DOC>#
    select COUNT(*) "OBJECTS WITH ERRORS" from obj$ where status = 3
    ERROR at line 1:
    ORA-00942: table or view does not exist
    DOC> The following query reports the number of errors caught during
    DOC> recompilation. If this number is non-zero, please query the error
    DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
    DOC> are due to misconfiguration or resource constraints that must be
    DOC> fixed before objects can compile successfully.
    DOC>#
    select COUNT(*) "ERRORS DURING RECOMPILATION" from utl_recomp_errors
    ERROR at line 1:
    ORA-00942: table or view does not exist
    PL/SQL procedure successfully completed.
    ERROR:
    ORA-04067: not executed, package body "SPS.DBMS_OUTPUT" does not exist
    ORA-06508: PL/SQL: could not find program unit being called: "SPS.DBMS_OUTPUT"
    ORA-06512: at line 1
    BEGIN dbms_registry_sys.validate_components; END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00201: identifier 'DBMS_REGISTRY_SYS.VALIDATE_COMPONENTS' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    ERROR:
    ORA-04067: not executed, package body "SPS.DBMS_OUTPUT" does not exist
    ORA-06508: PL/SQL: could not find program unit being called: "SPS.DBMS_OUTPUT"
    ORA-06512: at line 1
    SQL>

  • SSIS The parameterized sql statement yields metadata which does not match the main SQL statement

    Hi all,
    I'm getting the above error when trying to execute a custom lookup.  What I'm trying to do is lookup the minimum promotional price between date ranges.  The SQL executes fine in SSMS
    SELECT refTable.PRICE
    FROM ( SELECT MIN(PRICE) AS PRICE ,
    NAME ,
    ITEMRELATION ,
    FROMDATE ,
    TODATE
    FROM [dbo].[AllCustPrices]
    GROUP BY NAME ,
    ITEMRELATION ,
    FROMDATE ,
    TODATE
    ) [refTable]
    WHERE [refTable].[NAME] = ?
    AND [refTable].[ITEMRELATION] = ?
    AND ? BETWEEN [refTable].[FROMDATE]
    AND [refTable].[TODATE]
    but errors in SSIS?

    Apologies, totally forgot i posted a question on here.  I still haven't resolved this.  full error text is TITLE: Package Validation Error
    Package Validation Error
    ADDITIONAL INFORMATION:
    Error at Data Flow Task [Lookup MIN Price [440]]: The parameterized SQL statement yields metadata which does not match the main SQL statement.
    Error at Data Flow Task [SSIS.Pipeline]: "Lookup MIN Price" failed validation and returned validation status "VS_ISBROKEN".
    Error at Data Flow Task [SSIS.Pipeline]: One or more component failed validation.
    Error at Data Flow Task: There were errors during task validation.
     (Microsoft.DataTransformationServices.VsIntegration)
    BUTTONS:
    OK
    If I take off the MIN function and just put * SSIS is quite happy, it does not like MIN for some reason?
    I'm really stumped with this... checked metadata for third parameter which is W/C Date DT_DBTIMESTAMP which is same as FROMDATE, TODATE where i'm using BETWEEN...

  • Pro*C compilation error - bulk insert statement

    Guys, I am screwed up!
    There's this Pro*C application that I am working on. I made some changes in some of the functions and when I compile using Pro*C pre-compiler (Version 9), it throws an error in one of the modules that I have not even touched.
    Following is the error:
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>
    ++: Release 9.0.1.1.1 - Production on Fri May 25 20:35:30 2007
    (c) Copyright 2001 Oracle Corporation. All rights reserved.
    System default option values taken from: C:\oracle\ora90\precomp\admin\pcscfg.cfg
    Error at line 1512, column 1 in file D:\Siemens\GABS-R\Source\GSM-R_Rating\RTLRa
    ting\multimainrate_supp1_cug.pc
    EXEC SQL FOR :record_roaming
    1
    PLS-S-00382, expression is of wrong type
    Error at line 1512, column 1 in file D:\Siemens\GABS-R\Source\GSM-R_Rating\RTLRa
    ting\multimainrate_supp1_cug.pc
    EXEC SQL FOR :record_roaming
    1
    PLS-S-00000, SQL Statement ignored
    Semantic error at line 1512, column 1, file D:\Siemens\GABS-R\Source\GSM-R_Rating\RTLRating\multimainrate_supp1_cug.pc:
    EXEC SQL FOR :record_roaming
    1
    PCC-S-02346, PL/SQL found semantic errors
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    The location it is referring to is:
    EXEC SQL FOR :record_roaming
    INSERT /*+ PARALLEL(GT_RATED_ROAMING_CALLS) */
    INTO GT_RATED_ROAMING_CALLS
    (GF_SEQ_NO,
    GF_CALL_PRODUCT,
    GF_CDR_TYPE,
    GF_REC_NO,
    GF_REC_STAT,
    GF_INTER_REC_NO,
    GF_SS_REC_NO,
    GF_SS_CODE,
    GF_CALLING_NUM,
    GF_CALLED_NUM,
    GF_CALLING_IMSI,
    GF_CALLED_IMSI,
    GF_CALLED_NUM_TON,
    GF_DIALLED_DIGITS,
    GF_LAC,
    GF_CELL,
    GF_IN_CKTGRP,
    GF_IN_CKTID,
    GF_OUT_CKTGRP,
    GF_OUT_CKTID,
    GF_BS_TYPE,
    GF_BS_CODE,
    GF_DURATION,
    GF_THREAD_ID,
    GF_CARRIER,
    GF_AIR_TIM_CHARGE,
    GF_TOLL_CHARGE,
    GF_TOLL_UNITS,
    GF_ROAM_SURCHARGE,
    GF_ROAMING_CHARGES,
    GF_ADDITIONAL_CHARGES,
    GF_CUST_ID,
    GF_CONT_ID,
    GF_BILL_PRD,
    GF_STATUS,
    GF_ERROR_CODE,
    GF_RECON_STAT_LANDLINE,
    GF_RECON_STAT_ROAMING,
    GF_CALLING_IMEI,
    GF_CALLED_IMEI,
    GF_MSC_ID,
    GF_ACTION_CODE,
    GF_MSRN,
    GF_LONG_DISTANCE_AIR_CHRG,
    gf_home_zone_surcharge,
    GF_SWITCH_CODE,
    GF_BILL_DATE,
    GF_CITY_CODE,
    GF_BILL_FREQ,
    GF_CALL_START_DATE,
    GF_CALL_END_DATE,
    GF_SMS_TEXT,
    GF_TIME_STAMP_AVAILABLE,
    GF_TYPE_OF_CALL,
    GF_PEAK_OFFPEAK,
    GF_PROCESS_DATE,
    GF_MATCH_DATA,
    GF_ORIG_ZONE_CODE,
    GF_DEST_ZONE_CODE,
    GF_PRICE_PLAN_CODE
    values
    (:gt_rated_roaming_calls,sysdate,:roaming_details_match_data,:l_gf_rcd_zone,:l_gf_price_plan);
    Pls note that the host variables match exactly the number of fields in the INTO clause (anyway, the error in such a case is different).
    Please save my soul!
    Sanchit

    Hi, check Metalink Note 451413.1 Pro*C Build Fails With Error PCC-02014 on File /usr/include/standards.h
    I did workarround #2, and worked.
    *+<Moderator edi t- deleted MOS Doc content - pl do NOT post contents of MOS Docs - this is a violation of your Support agreement>+*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Compilation error in PL/SQL

    Hi All,
    Please find the strange query situation in PLSQL.
    If i run the query without PLSQL block (i.e. declar begin end) it runs well and insert data
    in table but if put the same query in PLSQL block it gives compilation error.
    Following is the spool
    SQL> select * from v$version;
    BANNER                                                                                                                                     
    Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production                                                                                 
    PL/SQL Release 8.1.7.4.0 - Production                                                                                                      
    CORE     8.1.7.0.0     Production                                                                                                                  
    TNS for IBM/AIX RISC System/6000: Version 8.1.7.4.0 - Production                                                                           
    NLSRTL Version 3.4.1.0.0 - Production                                                                                                      
    SQL> insert into smcbom_load_hours_temp
      2  select data_set_name,deptclass,dept,smcbom_flex_budget.get_period(v_date) v_period,sum(v_hr),-1,sysdate,-1,sysdate
      3  from (
      4  select plan_level,sp.data_set_name,
      5  sp.value1,smcbom_flex_budget.calculate_period_days(sp.period1),inweight ,
      6  usagerate ,operationseq,percent,
      7  sbov.group_id,sp.alloy,sp.planner_code,
      8  sbov.days,sbov.totaloffsetdays,deptclass,dept,
      9  decode(plan_level,1,(sp.value14/smcbom_flex_budget.calculate_period_days(sp.period14)) * (percent/100) * inweight * usagerate *
    10  (SELECT MAX(INWEIGHT)
    11  FROM  SMCBOM_BOM_OPERATION_VIEW
    12  WHERE ALLOY=sbov.alloy
    13  AND   PLANNER_CODE=sbov.planner_code
    14  AND   PLAN_LEVEL = 0
    15  AND   GROUP_ID = sbov.group_id ),
    16  0,(sp.value14/smcbom_flex_budget.calculate_period_days(sp.period14)) * (percent/100) * inweight * usagerate ,
    17  1) v_hr,
    18  smcbom_flex_budget.get_start_date(sp.period14)+sbov.totaloffsetdays v_date,
    19  sum(-sbov.totaloffsetdays)
    20  over (partition by sp.alloy,sp.planner_code,sbov.group_id
    21  order by plan_level asc,operationseq desc)  new_offset
    22  from smcbom_bom_operation_view sbov,smcbom_sales_prod_forecasts sp
    23  where sbov.alloy= sp.alloy
    24  and   sbov.planner_code=sp.planner_code
    25  and group_id=521136
    26  )
    27  group by data_set_name,deptclass,dept,smcbom_flex_budget.get_period(v_date);
    23 rows created.
    SQL> commit;
    Commit complete.
    SQL> declare
      2  begin
      3  insert into smcbom_load_hours_temp
      4  select data_set_name,deptclass,dept,smcbom_flex_budget.get_period(v_date) v_period,sum(v_hr),-1,sysdate,-1,sysdate
      5  from (
      6  select plan_level,sp.data_set_name,
      7  sp.value1,smcbom_flex_budget.calculate_period_days(sp.period1),inweight ,
      8  usagerate ,operationseq,percent,
      9  sbov.group_id,sp.alloy,sp.planner_code,
    10  sbov.days,sbov.totaloffsetdays,deptclass,dept,
    11  decode(plan_level,1,(sp.value14/smcbom_flex_budget.calculate_period_days(sp.period14)) * (percent/100) * inweight * usagerate *
    12  (SELECT MAX(INWEIGHT)
    13  FROM  SMCBOM_BOM_OPERATION_VIEW
    14  WHERE ALLOY=sbov.alloy
    15  AND   PLANNER_CODE=sbov.planner_code
    16  AND   PLAN_LEVEL = 0
    17  AND   GROUP_ID = sbov.group_id ),
    18  0,(sp.value14/smcbom_flex_budget.calculate_period_days(sp.period14)) * (percent/100) * inweight * usagerate ,
    19  1) v_hr,
    20  smcbom_flex_budget.get_start_date(sp.period14)+sbov.totaloffsetdays v_date,
    21  sum(-sbov.totaloffsetdays)
    22  over (partition by sp.alloy,sp.planner_code,sbov.group_id
    23  order by plan_level asc,operationseq desc)  new_offset
    24  from smcbom_bom_operation_view sbov,smcbom_sales_prod_forecasts sp
    25  where sbov.alloy= sp.alloy
    26  and   sbov.planner_code=sp.planner_code
    27  and group_id=521136
    28  )
    29  group by data_set_name,deptclass,dept,smcbom_flex_budget.get_period(v_date);
    30  end;
    31  /
    (SELECT MAX(INWEIGHT)
    ERROR at line 12:
    ORA-06550: line 12, column 2:
    PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
    ( - + mod not null others <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> avg
    count current exists max min prior sql stddev sum variance
    execute forall time timestamp interval date
    <a string literal with character set specification>
    <a number> <a single-quoted SQL string>
    ORA-06550: line 22, column 6:
    PLS-00103: Encountered the symbol "(" when expecting one of the following:
    , from
    SQL> spool off;

    In some versions of Oracle (certainly all of the 8.x versions and earlier, and possibly some of the earlier 9 versions) the SQL parsers in the SQL engine and in the PL/SQL engine were different. Some features that worked directly in SQL did not work in PL/SQL. Scalar sub-queries were one of those things.
    You have three options. You can try to re-write the insert statement to eliminate the PL/SQL unimplemented feature. You can create a view in the database for the SELECT part of the insert statement then use that view in the insert. finally, and least desirable, you can build the whole statment as a string, and use EXECUTE IMMEDIATE to run it in PL/SQL.
    HTH
    John

Maybe you are looking for

  • Refresh/Update data in a materialized view

    Hi, I have question about the data in a materialized view and how it is refreshed. My mat view has all my dimension-ids and my (for my specialize needs) aggregated measures from my fact table. I used the mat view wizard to create my view - which work

  • Browsing and playing by folders on zen style m300

    Hello Can I browse and play the music by folders on my ZEN Style M300? In menu i can only via playlist, artist, title and genre

  • Possible to swap ibook G4 dvd drive into macbook pro?

    My unibody macbook pro's dvd drive has stopped working. Whenever i put in a dvd in, it just gurgles and tries to churn the disk to no avail. I was wondering if it were possible to harvest the dvd drive out of my old ibook g4 and put it into the macbo

  • File loss over network on Mac Pro /windows

    Hi I hope someone can help, I have been using my network for over a year with no problems also networked the same for the last 4 years. I now have files and folders go missing when dragging between computers I have one mac pro and x2 windows computer

  • 1st vs 2nd monitor

    I use a Mac Pro (late 2013 model) to work on Lightroom 5. It has two monitors of different sizes. I prefer that LR 5 uses the bigger monitor as the Monitor 1. However, my LR5 current default uses the smaller monitor as the Monitor 1. Where can I chan