Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Posts
    6

    Unanswered: Accessing iAnywhere from command line

    Hi,

    I am a complete newbie to Sybase. I just installed the iAnywhere version on my Mac. Found the bundled apps like Interactive SQL etc to access the data. But I want to be able to get into the database and execute queries from the command line (the SQL prompt as we call it). I looked through the documentation but found no mention of it at all.

    Pl let me know how to do this, if its possible at all.

    TIA
    Sathya

  2. #2
    Join Date
    Jun 2005
    Location
    Singapore
    Posts
    60

    isql

    dbisql -c "uid=dba;pwd=sql;dsn=asademo"

    dbisql -c "uid=dba;pwd=sql;dsn=asademo" program.sql

    inside of program.sql is list of sql command

    SELECT LEFT(VENDOR+' ',6) VENDOR,LEFT(DELIVERY_NUMBER+' ',10) DO_NO,LEFT(JOBNO+' ',7) JOB_NO,LEFT(PARTS_NO+' ',14) PARTS,RIGHT('0000000'+CAST(TOTAL_PIECE AS CHAR),7) RECQTY,DATEFORMAT(INCOMING_DATE,'YYYYMMDD') RECDATE,serial_number unq FROM RECEIVING_ENTRY_DETAILS WHERE sent is null;
    output to 'c:\kitrcv.TXT' format fixed;
    insert into return_do(vendor,do_no,job,parts,qty,inc_date,seri al_no,trns_date) SELECT LEFT(VENDOR+' ',6),LEFT(DELIVERY_NUMBER+' ',10),LEFT(JOBNO+' ',7),LEFT(PARTS_NO+' ',14),RIGHT('0000000'+CAST(TOTAL_PIECE AS CHAR),7),DATEFORMAT(INCOMING_DATE,'YYYYMMDD'),seri al_number,getdate() FROM RECEIVING_ENTRY_DETAILS WHERE sent is null;
    update receiving_entry_details set sent='Y' where sent is null;

  3. #3
    Join Date
    Oct 2003
    Posts
    6
    Thanks chiwaki !

    Executing

    >> dbisql -c "uid=dba;pwd=sql;dsn=asademo"

    simply launches InteractiveSQL again.

    Isnt it possible to just get a "SQL>" prompt and start executing queries, describing tables etc from there ?

    Thanks.

  4. #4
    Join Date
    Feb 2002
    Location
    Willy is on vacation
    Posts
    1,208
    you can use isql insetad of the dbisql*. To make this work, you need to have the instance name and the dbname the same on server startup.

    This is done using the dbsrv9.exe -n asademo1 /ianywhere/asa9/asademo.db -nasademo1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •