Unknown command invoke-sqlcmd

Hey guys.  So I have this .bat file which automates the installation of SQL Server.  Towards the end of the script, I'm trying to execute a powershell script which calls a SQL Scripts to install objects in our new instance(highlighted in bold below).
@echo off
pushd %0\..\
If NOT Exist C:\Temp\SQL2012 md C:\Temp\SQL2012
xcopy /E /I /H /R *.* C:\Temp\SQL2012
cd /d C:\Temp\SQL2012
If NOT Exist D: powershell -File C:\Temp\SQL2012\DiskPart.ps1
setup.exe /configurationfile=SQL2K12.ini /iacceptsqlserverlicenseterms
echo Return code: %ERRORLEVEL%
pause
powershell -File C:\Temp\SQL2012\Updates\standards.ps1
pause
popd
Problem is that when the powershell script tries to execute, it gives me an error saying that it doesn't recognize the invoke-sqlcmd.  So I have another bat file which I run just to test out, and it simply calls the same powershell script, and it works.
@echo off
pushd %0\..\
powershell -File C:\Temp\SQL2012\Updates\standards.ps1
pause
popd

it doesn't recognize the invoke-sqlcmd.  
The command is only available when the SqlPs commandlet is loaded; see
sqlps Utility
Olaf Helper
[ Blog] [ Xing] [ MVP]

Similar Messages

  • Powershell command invoke-sqlcmd in batch script

    I have a powershell command that I want to be run in batch script. It works well in powershell window but I cannot call it properly in batch script. the powershell command goes like this:
    invoke-sqlcmd -inputfile "D:\Reports\sql.sql" -ServerInstance Server1 | export-csv "D:\RawDataFiles\Raw\samp.csv" -Force -En UTF8
    I hope somebody could help me out. Also, is it possible to include batch variable in replace of the file path for input and output file instead of putting the whole path in powershell command (stil run inside in batch script)?
    Thanks.

    I have found that works :) to run the invoke-sqlcmd within batch script:
    I have use this line:
    powershell -Command "& {Add-PSSnapin SqlServerCmdletSnapin100; Add-PSSnapin SqlServerProviderSnapin100; invoke-sqlcmd -inputfile '%sqlPath1%' -ServerInstance %Server% | export-csv '%out_path1%\%out1_fn%' -Force -En UTF8;}"
    works like charm yay! ^_^

  • Create SQL Job with Invoke-Sqlcmd

    I'm trying to run a set of .sql files, i didn't know how to pass a common variable to all, so i've started running the statements directly in ps.  One of these creates a job but i'm running into all of the errors due to the special characters and the
    variables, can someone help?
    $Client = "C0212"
    $Instance = "SQL03\"+$Client
    $sqlscript3 = "
    --NEED TO CHANGE THE LOG LOCATION BELOW
    USE [msdb]
    GO
    /****** Object:  Job [DatabaseBackup - USER_DATABASES - FULL]    Script Date: 11/15/2013 8:40:20 AM ******/
    BEGIN TRANSACTION
    DECLARE @ReturnCode INT
    SELECT @ReturnCode = 0
    /****** Object:  JobCategory [Database Maintenance]    Script Date: 11/15/2013 8:40:20 AM ******/
    IF NOT EXISTS (SELECT name FROM msdb.dbo.syscategories WHERE name=N''Database Maintenance'' AND category_class=1)
    BEGIN
    EXEC @ReturnCode = msdb.dbo.sp_add_category @class=N''JOB'', @type=N''LOCAL'', @name=N''Database Maintenance''
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    END
    DECLARE @jobId BINARY(16)
    EXEC @ReturnCode =  msdb.dbo.sp_add_job @job_name=N''DatabaseBackup - USER_DATABASES - FULL'', 
    @enabled=1, 
    @notify_level_eventlog=2, 
    @notify_level_email=0, 
    @notify_level_netsend=0, 
    @notify_level_page=0, 
    @delete_level=0, 
    @description=N''Source: http://ola.hallengren.com'', 
    @category_name=N''Database Maintenance'', 
    @owner_login_name=N''sa'', @job_id = @jobId OUTPUT
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    /****** Object:  Step [DatabaseBackup - USER_DATABASES - FULL]    Script Date: 11/15/2013 8:40:20 AM ******/
    EXEC @ReturnCode = msdb.dbo.sp_add_jobstep @job_id=@jobId, @step_name=N''DatabaseBackup - USER_DATABASES - FULL'', 
    @step_id=1, 
    @cmdexec_success_code=0, 
    @on_success_action=1, 
    @on_success_step_id=0, 
    @on_fail_action=2, 
    @on_fail_step_id=0, 
    @retry_attempts=0, 
    @retry_interval=0, 
    @os_run_priority=0, @subsystem=N''CmdExec'', 
    @command=N''sqlcmd -E -S `$(ESCAPE_SQUOTE(SRVR)) -d DBA -Q `"EXECUTE [dbo].[DatabaseBackup] @Databases = ''''USER_DATABASES'''', @Directory = N''''T:\SQLsafe Backups\SQL Native Backup'''', @BackupType = ''''FULL'''',
    @Verify = ''''Y'''', @CleanupTime = 170, @CheckSum = ''''Y'''', @LogToTable = ''''Y''''`" -b'', 
    --NEED TO CHANGE THE LOG LOCATION BELOW
    @output_file_name=N''C:\Program Files\Microsoft SQL Server\MSSQL11.$Client\MSSQL\LOG\DatabaseBackup_`$(ESCAPE_SQUOTE(JOBID))_`$(ESCAPE_SQUOTE(STEPID))_`$(ESCAPE_SQUOTE(STRTDT))_`$(ESCAPE_SQUOTE(STRTTM)).txt'', 
    @flags=0
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    EXEC @ReturnCode = msdb.dbo.sp_update_job @job_id = @jobId, @start_step_id = 1
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    EXEC @ReturnCode = msdb.dbo.sp_add_jobschedule @job_id=@jobId, @name=N''Saturday 4am'', 
    @enabled=1, 
    @freq_type=8, 
    @freq_interval=64, 
    @freq_subday_type=1, 
    @freq_subday_interval=0, 
    @freq_relative_interval=0, 
    @freq_recurrence_factor=1, 
    @active_start_date=20131109, 
    @active_end_date=99991231, 
    @active_start_time=40000, 
    @active_end_time=235959, 
    @schedule_uid=N''5b3c3fcf-28dc-4f4c-95ce-a624667ee378''
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    EXEC @ReturnCode = msdb.dbo.sp_add_jobserver @job_id = @jobId, @server_name = N''(local)''
    IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
    COMMIT TRANSACTION
    GOTO EndSave
    QuitWithRollback:
        IF (@@TRANCOUNT > 0) ROLLBACK TRANSACTION
    EndSave:
    GO"
    Invoke-Sqlcmd –ServerInstance $Instance –Database msdb –Query $sqlscript3 -QueryTimeout 300

    So, if I try this:
    $Client = "C0212"
    Invoke-Sqlcmd -InputFile "C:\NewInstanceScripts\PSNI -3 - Create Full Backup job for ALL User Databases.sql" -Variable $Client
    and in my .sql file that line that contains the variable looks like this:
    @output_file_name=N'C:\Program Files\Microsoft SQL Server\MSSQL11.`$(Client)\MSSQL\LOG\DatabaseBackup_$(ESCAPE_SQUOTE(JOBID))_$(ESCAPE_SQUOTE(STEPID))_$(ESCAPE_SQUOTE(STRTDT))_$(ESCAPE_SQUOTE(STRTTM)).txt',
    I get the error: 
    Invoke-Sqlcmd : The format used to define the new variable for Invoke-Sqlcmd cmdlet is invalid. Please use the 'var=value' format for defining a new variable.
    If i try like this:
    Set @Client = "C0212"
    Invoke-Sqlcmd -InputFile "C:\NewInstanceScripts\PSNI -3 - Create Full Backup job for ALL User Databases.sql" -Variable @Client
    Line in .sql file like this:
    @output_file_name=N'C:\Program Files\Microsoft SQL Server\MSSQL11.@Client\MSSQL\LOG\DatabaseBackup_$(ESCAPE_SQUOTE(JOBID))_$(ESCAPE_SQUOTE(STEPID))_$(ESCAPE_SQUOTE(STRTDT))_$(ESCAPE_SQUOTE(STRTTM)).txt',
    I get the error: Set-Variable : A positional parameter cannot be found that accepts argument '2'.

  • Remotely executing an invoke-sqlcmd fails

    When remotely executing an invoke-sqlcmd fails.  A simple query such as:
    Invoke-Command -ComputerName ComputerName -ScriptBlock{
    $qry = "SELECT SERVERPROPERTY('ServerName') AS ServerName,
    SERVERPROPERTY('ProductVersion') AS ProductVersion,
    SERVERPROPERTY('ProductLevel') AS ProductLevel,
    SERVERPROPERTY('Edition') AS Edition,
    SERVERPROPERTY('EngineEdition') AS EngineEdition;"
    Invoke-Sqlcmd -Query $qry} -ConfigurationName SQLSession
    I get the following error:
    [ComputerName] Connecting to remote server failed with the following error message : The WS-Management service cannot process the request. The resource URI (http://sche
    mas.microsoft.com/powershell/SQLSession) was not found in the WS-Management catalog. The catalog contains the metadata that describes resources, or logical endpoints. For
    more information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo : OpenError: (:) [], PSRemotingTransportException
    + FullyQualifiedErrorId : PSSessionStateBroken
    I have run Enable-WSManCredSSP Server on the SQL server and  tried to run Enable-WSManCredSSP -Role Client -DelegatedCredentials * on a Windows 7 x32 workstation but I get the following error:
    Enable-WSManCredSSP : A parameter cannot be found that matches parameter name 'DelegatedCredentials'.
    At line:1 char:55
    + Enable-WSManCredSSP -Role Client -DelegatedCredentials <<<< *
    + CategoryInfo : InvalidArgument: (:) [Enable-WSManCredSSP], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.WSMan.Management.EnableWSManCredSSPCommand
    I have tried the Enable-WSManCredSSP with the actual server name instead of a wildcard and it still fails.

    Hi,
    As cmille replied, for the command, there is no DeletegatedCredentials parameter, more details about the command:
    Enable-WSManCredSSP
    http://technet.microsoft.com/en-us/library/hh849872(v=wps.620).aspx
    Did you use Server Core? Please below link to troubleshoot this issue:
    the ws-management service cannot process the request
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/27020cf2-47fc-43e3-b135-e68b80a1bb4e/the-wsmanagement-service-cannot-process-the-request?forum=winservercore
    Regards,
    Yan Li
    Regards, Yan Li

  • Com.evermind.server.rmi.RMIConnectionException: Unknown command: 0

    hei!
    I have a simple SessionBean, deployed to remote OC4J.(the bean is tested locally and is fine)
    using Jdeveloper, I create a client to call my sessionBean methods.
    If I create the client to run agains the embedded oc4j, it works fine.
    If I create a client that runs agains the remote oc4j, I get this error:
    com.evermind.server.rmi.RMIConnectionException: Unknown command: 0
    and a lot of
    java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])     
    appreciate your help
    Regards
    RT

    Russel ,
    Have you started remote OC4J Server? Also can you able to browse
    JNDI tree of Remote OC4J Server from JDeveloper?
    Also provide following information in order to understand your problem fully
    1. Which OC4J version you are using?
    2. Platform in which you are testing your application?
    3. Provide full stack trace of error that you are getting
    Cheers
    --Venky                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Disconnected: Unknown command: 7

    What ?
    simple lookup to newly, successful deployment, other modules work fine.The stacktrace is
    javax.naming.NamingException: Disconnected: Unknown command: 7
         at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:153)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at dk.son.nms.subscription.TestClient.<init>(TestClient.java:26)
         at dk.son.nms.subscription.TestClient.main(TestClient.java:38)
         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:324)
         at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
    I must say (as a customer, that cant login to metalink atm), i am not impressed. In the past day(one day), i've gotten error messages from OC4J like this;
    - javax.naming.NamingException: Disconnected: Unknown command: 7 (current)
    - internal deployer exception : ArrayIndexOutofBounds(10)
    (hadnt this been java, you'd bee rooted now)
    - internal deployer exception : null
    (I LOVE this one)
    - internal deployer exception : Syntax error in source
    (thank god ... WHAT SOURCE? .. infact it was NOT 'a' source)
    This is errors that tell me absolutly NOTHING about what is actually wrong .. I could list the causes and solutions to these but it would be a never ending list.
    This is not proffesional software !! Is it ? I am spending way WAY too much time figuring these things out, time i should be using on more productive things.. ask my boss.
    Jesus ... venting temporarily over .. I'll be throwing up a webpage soon, at least im planning to, with all these rigid error messages and my 'IMHO' oppinion about them...
    might as well vent this stuff ->void/null as well..

    Hello,
    I am with the same problem... some of my EJBs works fine, but one fails when trying to make a lookup with the correct JNDI name... I tested on OC4J 10.1.3 and all works fine, thought on OC4J 9.0.4 the problem has shown...
    Did you know what is this problem about?

  • How to Provide Windows Credentials in Invoke-sqlcmd

    Hi,
    Could you please let me know how to execute TSQL Queries using Invoke-Sqlcmd by passing Windows Credentials.
    I Know Other methods(sqlcmd, SMO) to Run, But Im looking for this Solution.
    I Tried below Commands but it is failing.
    Add-PSSnapin SqlServerCmdletSnapin100
    Add-PSSnapin SqlServerProviderSnapin100
    Invoke-Sqlcmd -ServerInstance "ABC\XYZ" -Database "master" -Query "select * from sys.databases" -Username "Domain\user_ID" -Password "Pwd"
    The credentials which I have passed is having Sysadmin access to SQL Server and it is a Domain Account.
    Note: if I Run the same command Without passing Credentials in the same machine(ABC), then Im getting the Output.
    Please help

    As Mike notes.  The username and password are only useful when you are connecting in mixed mode and you have defined a SQL standard login.  For all trusted connections you must start PowerShell as the user that you want to connect with.  There
    no alternate credentials in MSSQLServer.  The is a "Trusted" connection and a user login connection.  Logins arte not enabled by default in MSSQLServer.
    If you have sufficient priviliges in SQLServer you can act as another user and use their schema.  I recommend posting in the SQLServer forum to learn how to set up and use this.
    ¯\_(ツ)_/¯

  • Invoke-sqlcmd message handling

    Hi All. if I using invoke-sqlcmd, how to handle the information output and error output.
    for example, I update 2 rows, if successful it would show 2 rows , and command is successful in Management studio.
    if there is error during update, there will be error code, serverity , error message in Management studio
    I want to achieve the same thing in powershell ISE. any method ?

    i try to use try catch
    however i still cant output to error in powershell to an log file.

  • "SP2-0734: unknown command..." error while importing a dump file

    hello,
    i want to import a dump file into my database named orcl, and i come accross the same error after executing the import command. my import command is:
    SQL> imp mvdemo/mvdemo file=mvdemo.dmp full=y ignore=y
    i use oracle 10g enterprise edition.
    i created the user mvdemo/mvdemo.
    the error i see in my screen is:
    SP2-0734: unknown command beginning "imp mvde..." - rest of line ignored.
    for a long period of time, i havent used oracle dbms. before, i remember that i used enterprise manager in import/export processes. however, i am not able to find the enterprise manager in 10g options now. do i have to install the enterprise manager seperately in oracle 10g enterprise edition? may this problem be relational with this matter?
    if someone could answer, i would be greatful.
    best regards

    Import is run from the command prompt, not the SQL prompt.

  • Error: Could not complete your request because an unknown command was encountered.

    I've been working on a file in FreeHand 11 for a few months
    now, and for some reason after saving and closing the file about a
    week ago, I can no longer open it - on either of my computers (both
    PCs, one running XP, one running Vista). When I attempt to do so, I
    am presented with the following error message:
    Could not complete your request because an unknown command
    was encountered.
    Is there any possible way to fix this?

    Haha. I know. I was stupid... The last backup of the file is
    four months old. Unfortunately I've done quite a lot of work on it
    since then...
    One interesting thing though, is that I can still see the
    thumbnail picture in Windows Explorer. Also, I'm able to open the
    file with Fireworks, but none of the hidden layers (most of my
    work) are there.
    I just tried to open it again on my desktop. Same error
    message (but in German)...:
    "Ihre Anforderung konnte nicht ausgeführt werden. Ein
    unbekannter Fehler ist aufgetreten." :S

  • Sql select with concate of columns SP2-0734: unknown command beginning

    I am running a ksh script that does some dumpster diving and pull records out.
    It is basically reading a file does a select and at the end, you will see $i.
    AND ORD_ORDER.ADV_ORDER_TEXT_FIELD_568='$';
    I can run the script manually. (without the while loop)
    But, when I run it thru the script I get a whack of errors.
    SP2-0734: unknown command beginning "FROM ADVXR..." - rest of line ignored.
    SP2-0734: unknown command beginning "ADVXRT_HDB..." - rest of line ignored.
    SP2-0734: unknown command beginning "ADVXRT_HDB..." - rest of line ignored.
    SP2-0734: unknown command beginning "ADVXRT_HDB..." - rest of line ignored.
    SP2-0044: For a list of known commands enter HELP
    and to leave enter EXIT.
    What I need it to do is pull the selected records out and place in a file.
    Script
    cat $TICKETS_MISMATCH |while read i
    do
    $SQLPLUS -silent "advxrt_hdb/$LOGONID@hdb" <<EOF >$TICKETS_MISMATCH_FULL
    set feedback off
    set verify off
    set echo off
    set heading off
    set pagesize 7010
    SELECT ORD_ORDER.ADV_ORDER_TEXT_FIELD_568
    || ','
    || ORD_ORDER.ORDER_NUM
    || ','
    || ORD_ORDER.ADV_ORDER_SUMMARY_FIELD_012
    || ','
    || LAB_USER.NAME
    || ','
    || LAB_USER.LOGON_ID
    || ','
    || LAB_USER.ADV_EXTENDED_USER_FIELD_001
    || ','
    || TO_CHAR(MOBILECOMP1_SR.ADV_COMPLETION_TIME_FIELD_001, 'HH24:MI:SS')
    || ','
    || TO_CHAR(MOBILECOMP1_SR.ADV_COMPLETION_DATE_FIELD_001, 'DD-MON-YYYY')
    || ','
    || MOBILECOMP1_SR.ADV_COMPLETION_NOTES_FIELD_001
    || ','
    || MOBILECOMP1_SR.ADV_COMPLETION_TEXT_FIELD_003
    || ','
    || MOBILECOMP1_SR.ADV_COMPLETION_TEXT_FIELD_013
    || ','
    || MOBILECOMP1_SR.ADV_COMPLETION_TEXT_FIELD_014
    || ','
    || MOBILECOMP1_SR.ADV_COMPLETION_TEXT_FIELD_023
    || ','
    || ORD_JOB_CODE.NAME
    || ','
    || ROUND(ASN_ASSIGNMENT.TOTAL_TIME_EN_ROUTE / 60,0)
    || ','
    || ROUND(ASN_ASSIGNMENT.TOTAL_TIME_ON_SITE / 60,0)
    FROM ADVXRT_HDB.LAB_USER,
    ADVXRT_HDB.SR_REPORT,
    ADVXRT_HDB.ASN_ASSIGNMENT,
    ADVXRT_HDB.ORD_ORDER,
    ADVXRT_HDB.MOBILECOMP1_SR,
    ADVXRT_HDB.ORD_JOB_CODE
    WHERE (ASN_ASSIGNMENT.ASSIGNMENT_ID = SR_REPORT.ASSIGNMENT)
    AND (ASN_ASSIGNMENT.FOR_ORDER = ORD_ORDER.ORDER_ID)
    AND (MOBILECOMP1_SR.MOBILE_COMP1_ID = SR_REPORT.RECORD_NUMBER)
    AND (ORD_ORDER.JOB_CODE = ORD_JOB_CODE.JOB_CODE_ID)
    AND (SR_REPORT.USER_ID = LAB_USER.USER_ID(+))
    AND ORD_ORDER.COMPLETED BETWEEN ((TO_DATE('${date_entered} 00:00:00','YYYY-MM-DD HH24:MI:SS')) - ((SELECT DECODE
    (UTC_OFFSET, NULL, 0, UTC_OFFSET) FROM TZ_UTC_TO_LOCAL TZ WHERE (TO_DATE
    ('${date_entered} 00:00:00','YYYY-MM-DD HH24:MI:SS') BETWEEN TZ.STARTS_UTC AND
    TZ.ENDS_UTC)AND TZ.TIME_AUTHORITY = 1000264000000000000000000013))/(24*60*60))
    AND
    ((TO_DATE('${date_entered} 11:59:59','YYYY-MM-DD HH24:MI:SS')) - ((SELECT DECODE
    (UTC_OFFSET, NULL, 0, UTC_OFFSET) FROM TZ_UTC_TO_LOCAL TZ WHERE (TO_DATE
    ('${date_entered} 11:59:59','YYYY-MM-DD HH24:MI:SS') BETWEEN TZ.STARTS_UTC AND
    TZ.ENDS_UTC)AND TZ.TIME_AUTHORITY = 1000264000000000000000000013))/(24*60*60))
    AND ORD_ORDER.ADV_ORDER_TEXT_FIELD_568='${i}';
    exit;
    EOF
    done

    SQL> DEFINE sqlplusrelease
    DEFINE SQLPLUSRELEASE = "1002000200" (CHAR)
    cat $TICKETS_MISMATCH |while read i
    do
    $SQLPLUS -silent "advxrt_hdb/$LOGONID@hdb" <<EOF >>$TICKETS_MISMATCH_FULL
    set feedback off
    set verify off
    set echo off
    set heading off
    set pagesize 7010
    SET SQLBLANKLINES ON
    SELECT  ORD_ORDER.ADV_ORDER_TEXT_FIELD_568
        || ','
        || ORD_ORDER.ORDER_NUM
        || ','
        || ORD_ORDER.ADV_ORDER_SUMMARY_FIELD_012
        || ','
        || LAB_USER.NAME
        || ','
        || LAB_USER.LOGON_ID
        || ','
        || LAB_USER.ADV_EXTENDED_USER_FIELD_001
        || ','
        || TO_CHAR(MOBILECOMP1_SR.ADV_COMPLETION_TIME_FIELD_001, 'HH24:MI:SS')
        || ','
        || TO_CHAR(MOBILECOMP1_SR.ADV_COMPLETION_DATE_FIELD_001, 'DD-MON-YYYY')
        || ','
        || MOBILECOMP1_SR.ADV_COMPLETION_NOTES_FIELD_001
        || ','
        || MOBILECOMP1_SR.ADV_COMPLETION_TEXT_FIELD_003
        || ','
        || MOBILECOMP1_SR.ADV_COMPLETION_TEXT_FIELD_013
        || ','
        || MOBILECOMP1_SR.ADV_COMPLETION_TEXT_FIELD_014
        || ','
        || MOBILECOMP1_SR.ADV_COMPLETION_TEXT_FIELD_023
        || ','
        || ORD_JOB_CODE.NAME
        || ','
        || ROUND(ASN_ASSIGNMENT.TOTAL_TIME_EN_ROUTE / 60,0)
        || ','
        || ROUND(ASN_ASSIGNMENT.TOTAL_TIME_ON_SITE / 60,0)
    FROM ADVXRT_HDB.LAB_USER,
           ADVXRT_HDB.SR_REPORT,
           ADVXRT_HDB.ASN_ASSIGNMENT,
           ADVXRT_HDB.ORD_ORDER,
           ADVXRT_HDB.MOBILECOMP1_SR,
           ADVXRT_HDB.ORD_JOB_CODE
    WHERE     (ASN_ASSIGNMENT.ASSIGNMENT_ID = SR_REPORT.ASSIGNMENT)
           AND (ASN_ASSIGNMENT.FOR_ORDER = ORD_ORDER.ORDER_ID)
           AND (MOBILECOMP1_SR.MOBILE_COMP1_ID = SR_REPORT.RECORD_NUMBER)
           AND (ORD_ORDER.JOB_CODE = ORD_JOB_CODE.JOB_CODE_ID)
           AND (SR_REPORT.USER_ID = LAB_USER.USER_ID(+))
           AND ORD_ORDER.COMPLETED BETWEEN ((TO_DATE('${date_entered} 00:00:00','YYYY-MM-DD HH24:MI:SS')) - ((SELECT DECODE
                (UTC_OFFSET, NULL, 0, UTC_OFFSET) FROM TZ_UTC_TO_LOCAL TZ WHERE (TO_DATE
                ('${date_entered} 00:00:00','YYYY-MM-DD HH24:MI:SS') BETWEEN TZ.STARTS_UTC AND
                TZ.ENDS_UTC)AND TZ.TIME_AUTHORITY = 1000264000000000000000000013))/(24*60*60))
           AND
                ((TO_DATE('${date_entered} 11:59:59','YYYY-MM-DD HH24:MI:SS')) - ((SELECT DECODE
                (UTC_OFFSET, NULL, 0, UTC_OFFSET) FROM TZ_UTC_TO_LOCAL TZ WHERE (TO_DATE
                ('${date_entered} 11:59:59','YYYY-MM-DD HH24:MI:SS') BETWEEN TZ.STARTS_UTC AND
                TZ.ENDS_UTC)AND TZ.TIME_AUTHORITY = 1000264000000000000000000013))/(24*60*60))
            AND ORD_ORDER.ADV_ORDER_TEXT_FIELD_568='${i}';
    exit
    EOF
    done

  • Unknown command problem

    hi my problem is that i am creating a maze game. the maze is a 2d array of integers. and fed in threw a reader and loaded.
    static void play(){
    try {
    //creates a buffered reader
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    //boolean varible is set to true when the program is running until exit is typed
    boolean running = true;
    while (running){
    //a new String varible which is used for input
    String line = in.readLine();
    //when the game is being played a line string says you typed. + line
    //the +line is what the user typed
    System.out.println("You typed "+line);
    //if the user types south call the south method;
    if(line.startsWith("south")){
    south();
    //if the user types east call the east method
    else if(line.startsWith("east")){
    east();
    //if the user types west call the west method
    else if(line.startsWith("west")){
    west();
    //if the user types north then call the north method
    //this is not case sensitive
    else if(line.equalsIgnoreCase("north")){
    north();
    // check if they have reached the goal
    if(currentX == goalX && currentY == goalY)
    System.out.println("You have reached the goal!");
    //print out the maze after each turn(this was only used for testing purposes)
    print();
    //if the user types exit then change the value of running to false and exit the java console
    //it also calls the equalsIgnoreCase this method will allow entry in any case
    if (line.equalsIgnoreCase("exit")){
    running = false;
    // else
    //          System.out.print( "Unknown command: " + line );
    the problem is that if the user types in an invalid command i want to display this error message.
    when i run the program however i get the error every time even though the move happens the error message is still displayed. i only want the error message to display when an invalid command is typed
    i am a beginner so please use basic language.
    thanks jon

    Use the code formatting tags when you post code.
    hi my problem is that i am creating a maze gameTrue, if you weren't creating a game, you'd probably have no problem.
    threw a readerWhere did you throw it?
    i am a beginner so please use basic language. Put your "unknown command output" and exit check blocks directly after the check for "north"

  • Strange SP2-0042: unknown command in sqlplus

    Hello everyone,i was attemptting to execute a sql statement from an external file. But i got "SP2-0042: unknown command "ï»? - rest of line ignored.". It's works with ANSI but can not based on UTF8 encoding.My file only contains as following :
    spo db_changesfff.log
    SPO OFF
    Anyone has ideas?thanks in advance!!

    We had this problem as well and we noticed that the script file that contained the UTF-8 had two FF FE magic numbers at the beginning of the file. View your file in HEX mode of your text editor and verify that a single FF FE is at the beginning of the file. We created our UTF-8 file using Notepad. This seems to put two FF FE's in the file header. When we removed one set of FF FE, everything worked just fine.

  • Invoke-Sqlcmd problem on Windows server 2008

    We have several Web Servers running Win2008 and need to be able to use the Invoke-Sqlcmd powershell cmdlet to execute arbitrary SQL.  
    Tried installing PowerShellTools.msi but Invoke-Sqlcmd still isn't recognized.
    What do I need to do to get support for PowerShellTools.msi in PowerShell 4.0?
    SQL 2008 SP1

    here are the installation instructions:
    http://blog.smu.edu/wis/2012/11/26/sql-server-powershell-module-sqlps/
    ¯\_(ツ)_/¯
    Installed the dependencies and it still didn't work.  Did myself a favor and used this
    version.  It uses stock SqlConnection/SqlCommand and has no dependencies other than .Net framework.

  • Why the grub-mount command invoked ?

    Do we have any clue upon this question ?
    As I was on my Laptop I heard the CPU fun struggling and I ran the top command to see what's happening and I saw the grub-mount command (invoked by root) with a CPU footprint of 100%. My query is : why this command invoked ?  I certainly didn't run this command (or any other command - I wasn't in terminal at all) and I also searched in all cron folders with
    grep -Ri grub
    and
    grep -Ri fuse
    but didn't result anything.
    This is an Arch Linux with 3.13.6-1-ARCH x86_64. DE= GNOME and LXDE (I was on LXDE when this happened, if that matters, but I don't think so). I was on Firefox and browsing some pages when this happened.
    The journalctl might help you to understand (or see) something I cannot.  After some secs, I killed grub-mount (as you will notice in journal). Any other log or file to examine that could help , just tell me.
    Best Regards
    Mar 19 03:21:47 arch-power dbus[527]: [system] Activating via systemd: service name='org.freedesktop.ModemManager1' unit='dbus-org.freedesktop.ModemMa
    Mar 19 03:21:47 arch-power dbus[527]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.ModemManager1.service': Unit dbus-org.free
    Mar 19 03:23:47 arch-power dbus[527]: [system] Activating via systemd: service name='org.freedesktop.ModemManager1' unit='dbus-org.freedesktop.ModemMa
    Mar 19 03:23:47 arch-power dbus[527]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.ModemManager1.service': Unit dbus-org.free
    Mar 19 03:25:04 arch-power NetworkManager[1635]: <warn> nl_recvmsgs() error: (-33) Dump inconsistency detected, interrupted
    Mar 19 03:25:47 arch-power dbus[527]: [system] Activating via systemd: service name='org.freedesktop.ModemManager1' unit='dbus-org.freedesktop.ModemMa
    Mar 19 03:25:47 arch-power dbus[527]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.ModemManager1.service': Unit dbus-org.free
    Mar 19 03:27:05 arch-power NetworkManager[1635]: <warn> nl_recvmsgs() error: (-33) Dump inconsistency detected, interrupted
    Mar 19 03:27:47 arch-power dbus[527]: [system] Activating via systemd: service name='org.freedesktop.ModemManager1' unit='dbus-org.freedesktop.ModemMa
    Mar 19 03:27:47 arch-power dbus[527]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.ModemManager1.service': Unit dbus-org.free
    Mar 19 03:29:05 arch-power NetworkManager[1635]: <warn> nl_recvmsgs() error: (-33) Dump inconsistency detected, interrupted
    Mar 19 03:29:47 arch-power dbus[527]: [system] Activating via systemd: service name='org.freedesktop.ModemManager1' unit='dbus-org.freedesktop.ModemMa
    Mar 19 03:29:47 arch-power dbus[527]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.ModemManager1.service': Unit dbus-org.free
    Mar 19 03:31:01 arch-power anacron[9506]: Job `cron.daily' started
    Mar 19 03:31:47 arch-power dbus[527]: [system] Activating via systemd: service name='org.freedesktop.ModemManager1' unit='dbus-org.freedesktop.ModemMa
    Mar 19 03:31:47 arch-power dbus[527]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.ModemManager1.service': Unit dbus-org.free
    Mar 19 03:32:28 arch-power /etc/gdm/Xsession[1294]: Failed to open VDPAU backend libvdpau_i965.so: cannot open shared object file: No such file or dir
    Mar 19 03:33:05 arch-power NetworkManager[1635]: <warn> nl_recvmsgs() error: (-33) Dump inconsistency detected, interrupted
    Mar 19 03:33:47 arch-power dbus[527]: [system] Activating via systemd: service name='org.freedesktop.ModemManager1' unit='dbus-org.freedesktop.ModemMa
    Mar 19 03:33:47 arch-power dbus[527]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.ModemManager1.service': Unit dbus-org.free
    Mar 19 03:34:05 arch-power org.ayatana.bamf[1311]: (bamfdaemon:1504): Wnck-WARNING **: Unhandled action type _OB_WM_ACTION_UNDECORATE
    Mar 19 03:34:14 arch-power org.ayatana.bamf[1311]: (bamfdaemon:1504): Wnck-WARNING **: Unhandled action type _OB_WM_ACTION_UNDECORATE
    Mar 19 03:35:47 arch-power dbus[527]: [system] Activating via systemd: service name='org.freedesktop.ModemManager1' unit='dbus-org.freedesktop.ModemMa
    Mar 19 03:35:47 arch-power dbus[527]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.ModemManager1.service': Unit dbus-org.free
    [b]Mar 19 03:36:17 arch-power sudo[10563]: nikos : TTY=pts/0 ; PWD=/home/nikos ; USER=root ; COMMAND=/usr/bin/killall grub-mount[/b]
    Mar 19 03:36:17 arch-power sudo[10563]: pam_unix(sudo:session): session opened for user root by nikos(uid=0)
    Mar 19 03:36:17 arch-power sudo[10563]: pam_unix(sudo:session): session closed for user root
    Mar 19 03:36:17 arch-power anacron[9506]: Job `cron.daily' terminated (mailing output)
    Mar 19 03:36:17 arch-power anacron[9506]: Can't find sendmail at /usr/sbin/sendmail, not mailing output
    Mar 19 03:36:17 arch-power anacron[9506]: Normal exit (1 job run)
    Mar 19 03:36:40 arch-power /etc/gdm/Xsession[1294]: NOTE: child process received `Goodbye', closing down
    Mar 19 03:37:04 arch-power NetworkManager[1635]: <warn> nl_recvmsgs() error: (-33) Dump inconsistency detected, interrupted
    Mar 19 03:37:04 arch-power NetworkManager[1635]: <warn> nl_recvmsgs() error: (-33) Dump inconsistency detected, interrupted
    Mar 19 03:37:47 arch-power dbus[527]: [system] Activating via systemd: service name='org.freedesktop.ModemManager1' unit='dbus-org.freedesktop.ModemMa
    Mar 19 03:37:47 arch-power dbus[527]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.ModemManager1.service': Unit dbus-org.free
    Mar 19 03:39:05 arch-power NetworkManager[1635]: <warn> nl_recvmsgs() error: (-33) Dump inconsistency detected, interrupted

    I read that thread but, maybe I'm missing something, I didn't see an actual solution in the thread.  That being said, technically the man pages don't really claim mount actually supports UUID, only fstab.  I suppose diskutil probably reads it for a reference as well since mounting via diskutil does indeed work.  Unless someone comes up with a way to do with with mount I plan on just using diskutil in a LaunchAgent and making sure the correct settings are on to make sure the filesystem stays mounted without users logging in.

Maybe you are looking for

  • Data Recovery Options?

    In the process of transferring from a POP3 Account to IMAP, I deleted a POP3 Account and lost a lot of email's I still need. I've seen some data recovery options such as File Salvage, but I'm wondering if there are any cheaper options out there? Than

  • Changing OCS ports 7778 and 7777

    dear all, i have ocs r2 implemented over linux as3.0, and i want to change the login ports from http://host.domain:7778 to just http://host.domain and as you know the http://host.domain:7778 redirect you to http://host.domain:7777/pls/orasso/orasso.w

  • Standard object

    what standard object is used in lsmw direct input method for inventory balance migration

  • How to sync ACT, Gmail and BBerry address books

    A number of months ago I acquired a BBerry Bold; my current email  client is Gmail. Starting with an ACT database of about 6,000 names, addresses, phones and emails.  Tried to sync using an ACT data dump as a txt file. NOT GOOD!. I have gotten names

  • Premier Pro and USB

    Will Premier Pro CS6 work with a camera with USB? Or is Firewire required? Thanks, Ron