INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

SQLBase, BAT, and Truncated Output

SQLBase, BAT, and Truncated Output

(OP)
I've got two things happening that I see similar, unresolved issues on this forum.
I'm going to jump to the conclusion that one of the other folks has figured out what
they needed to get their issue resolved, and hope I can get a response as well.


RUNNING AS BAT:
<http://www.tek-tips.com/viewthread.cfm?SQID=695505&SPID=854&newpid=854&page=1>


COLUMNS WIDE ISSUE:
<http://www.tek-tips.com/viewthread.cfm?SQID=412877&SPID=854&newpid=854&page=1>


I have tried to run the query as a command line as follows:

sqltalk BAT DB=POS/STARUSER/STARUSER INPUT=c:\path\inv.sql OUTPUT=c:\path\out.txt

I've attempted to include the queries I'm using below, as well as the output that
I get from the command line "OUTPUT" versus the output I get when I run the same query
from within the SQLTALK.EXE application "OUTPUT WITHIN SQLTALK".

My goal is to get the "OUTPUT WITHIN SQLTALK" information in an automated fashion, such
as by running a .bat that executes the above command line on a regular schedule.

I attempted to add the "SET LINESIZE 5000;" line to the top of my INV.SQL file, but this
did not solve the trouble with cutoff results when running via command line.




------------------------------ INV.SQL ------------------------------
Select
PRODUCT.WEB_ITEM as WEB,
PRODUCT_SIZE.SKU as SKU,
ACTIVE_INV.ONHAND_QTY as QTY,
PRODUCT_SIZE.RETAIL_PRICE as PRICE,
PRODUCT.STYLE as STYLE,
PRODUCT.DESCRIPTION as DESC,
PRODUCT.DEPARTMENT as DEPT,
DEPARTMENT.DEPARTMENT_NAME as DEPT_NAME,
PRODUCT.CLASS as CLASS,
CLASS.CLASS_NAME as CLASS_NAME,
PRODUCT.SUBCLASS as SUBCLASS,
PROD_NOTES.NOTE as EXTENDED_NOTES
From
SYSADM.CLASS CLASS,
SYSADM.DEPARTMENT DEPARTMENT,
SYSADM.ACTIVE_INV ACTIVE_INV,
SYSADM.PROD_NOTES PROD_NOTES,
SYSADM.PRODUCT_SIZE PRODUCT_SIZE,
SYSADM.PRODUCT PRODUCT,
SYSADM.STYLE_NOTE STYLE_NOTE
Where
PRODUCT.DEPARTMENT = DEPARTMENT.DEPARTMENT
And PRODUCT.STYLE = PRODUCT_SIZE.STYLE
And PRODUCT_SIZE.SKU = ACTIVE_INV.SKU
And STYLE_NOTE.NOTE_ID = PROD_NOTES.NOTE_ID
And STYLE_NOTE.STYLE = PRODUCT.STYLE
And PRODUCT.CLASS = CLASS.CLASS
And PRODUCT.DEPARTMENT = CLASS.DEPARTMENT
;
------------------------------ END INV.SQL -------------------------


------------------------------ OUTPUT ------------------------------

Select
PRODUCT.WEB_ITEM as WEB,
PRODUCT_SIZE.SKU as SKU,
ACTIVE_INV.ONHAND_QTY as QTY,
PRODUCT_SIZE.RETAIL_PRICE as PRICE,
PRODUCT.STYLE as STYLE,
PRODUCT.DESCRIPTION as DESC,
PRODUCT.DEPARTMENT as DEPT,
DEPARTMENT.DEPARTMENT_NAME as DEPT_NAME,
PRODUCT.CLASS as CLASS,
CLASS.CLASS_NAME as CLASS_NAME,
PRODUCT.SUBCLASS as SUBCLASS,
PROD_NOTES.NOTE as EXTENDED_NOTES
From
SYSADM.CLASS CLASS,
SYSADM.DEPARTMENT DEPARTMENT,
SYSADM.ACTIVE_INV ACTIVE_INV,
SYSADM.PROD_NOTES PROD_NOTES,
SYSADM.PRODUCT_SIZE PRODUCT_SIZE,
SYSADM.PRODUCT PRODUCT,
SYSADM.STYLE_NOTE STYLE_NOTE
Where
PRODUCT.DEPARTMENT = DEPARTMENT.DEPARTMENT
And PRODUCT.STYLE = PRODUCT_SIZE.STYLE
And PRODUCT_SIZE.SKU = ACTIVE_INV.SKU
And STYLE_NOTE.NOTE_ID = PROD_NOTES.NOTE_ID
And STYLE_NOTE.STYLE = PRODUCT.STYLE
And PRODUCT.CLASS = CLASS.CLASS
And PRODUCT.DEPARTMENT = CLASS.DEPARTMENT
;

WEB SKU QTY PRICE STYLE
=== ==================== =========== =============== ===============
Y 400100170571 2 7.99 0-20239
Y 400100010242 1 6.99 rampant031
Y 400100012420 1 10.99 zone022
Y 400100007143 1 10.99 rr003

4 ROWS SELECTED IN 0.02 SECONDS
200.00 ROWS PER SECOND / 0.00 SECONDS PER ROW

----------------------------END OUTPUT ------------------------------



------------------------------ OUTPUT WITHIN SQLTALK ------------------------------

WEB SKU QTY PRICE STYLE DESC DEPT DEPT_NAME CLASS CLASS_NAME SUBCLASS EXTENDED_NOTES
=== ==================== =========== =============== =============== ============================== ========== ============================== ====== ============================== ======== ==============================================================================================================================================================================================================================================================
Y 400100170571 1 7.99 0-20239 (vc) madonna: like a virgin 1 Vinyl 999 Misc. 20 uuuuuuuuuuuuu
Y 400100010242 1 6.99 rampant031 Gorilla Pimp (b) "this is real 1 Vinyl 100 Breakbeat zzzzzzzzzzzzz
Y 400100012420 1 10.99 zone022 arksun (b/tra) "earth one" 1 Vinyl 100 Breakbeat yyyyyyyyy
Y 400100007143 1 10.99 rr003 Downpressor (b) "nine" 1 Vinyl 100 Breakbeat xxxxxxx


4 ROWS SELECTED
IN 0.02 SECONDS

200.00 ROWS PER SECOND / 0.00 SECONDS PER ROW

------------------------------ END OUTPUT WITHIN SQLTALK ------------------------------

RE: SQLBase, BAT, and Truncated Output

(OP)
Should have added this info with the original post.

SQLBase Server 7.5.1
SQLTalk 7.5.1

RE: SQLBase, BAT, and Truncated Output

(OP)
Well, I'm not sure if this is progress or not.  I modified my .sql command file
to include lines to increase the linesize, pagesize, turn the echo off, and use
the SET SPOOL command to specify the file to write out to instead of indicating
that on the command line.  So now the command line looks like this...

> sqltalk BAT DB=POS/STARUSER/STARUSER INPUT=c:\path\inv.sql

It seems that the output file is re-written on each pass, but, I am still not
getting the full output that I need. Only the first five columns are showing
up in the output file when I run this via the command line.

HOWEVER, if I actually open the sqltalk.exe application, connect to the db, and
execute the same query, I get an output file with the complete results.

So, the question is, why do I get inconsistent output using the same .sql command
file?

This is still using...


SQLBase Server 7.5.1
SQLTalk 7.5.1




------------------------------ INV.SQL ------------------------------
SET ECHO OFF;
SET LINESIZE 5000;
SET PAGESIZE 99999;

SET SPOOL OUTPUT.TXT OVERWRITE;

Select
 PRODUCT.WEB_ITEM as WEB,
 PRODUCT_SIZE.SKU as SKU,
 ACTIVE_INV.ONHAND_QTY as QTY,
 PRODUCT_SIZE.RETAIL_PRICE as PRICE,
 PRODUCT.STYLE as STYLE,
 PRODUCT.DESCRIPTION as DESC,
 PRODUCT.DEPARTMENT as DEPT,
 DEPARTMENT.DEPARTMENT_NAME as DEPT_NAME,
 PRODUCT.CLASS as CLASS,
 CLASS.CLASS_NAME as CLASS_NAME,
 PRODUCT.SUBCLASS as SUBCLASS,
 PROD_NOTES.NOTE as EXTENDED_NOTES
From
 SYSADM.CLASS CLASS,
 SYSADM.DEPARTMENT DEPARTMENT,
 SYSADM.ACTIVE_INV ACTIVE_INV,
 SYSADM.PROD_NOTES PROD_NOTES,
 SYSADM.PRODUCT_SIZE PRODUCT_SIZE,
 SYSADM.PRODUCT PRODUCT,
 SYSADM.STYLE_NOTE STYLE_NOTE
Where
 PRODUCT.DEPARTMENT = DEPARTMENT.DEPARTMENT
 And PRODUCT.STYLE = PRODUCT_SIZE.STYLE
 And PRODUCT_SIZE.SKU = ACTIVE_INV.SKU
 And STYLE_NOTE.NOTE_ID = PROD_NOTES.NOTE_ID
 And STYLE_NOTE.STYLE = PRODUCT.STYLE
 And PRODUCT.CLASS = CLASS.CLASS
 And PRODUCT.DEPARTMENT = CLASS.DEPARTMENT
;

SET SPOOL OFF;

------------------------------ END INV.SQL -------------------------


------------------------------ OUTPUT ------------------------------

Select
 PRODUCT.WEB_ITEM as WEB,
 PRODUCT_SIZE.SKU as SKU,
 ACTIVE_INV.ONHAND_QTY as QTY,
 PRODUCT_SIZE.RETAIL_PRICE as PRICE,
 PRODUCT.STYLE as STYLE,
 PRODUCT.DESCRIPTION as DESC,
 PRODUCT.DEPARTMENT as DEPT,
 DEPARTMENT.DEPARTMENT_NAME as DEPT_NAME,
 PRODUCT.CLASS as CLASS,
 CLASS.CLASS_NAME as CLASS_NAME,
 PRODUCT.SUBCLASS as SUBCLASS,
 PROD_NOTES.NOTE as EXTENDED_NOTES
From
 SYSADM.CLASS CLASS,
 SYSADM.DEPARTMENT DEPARTMENT,
 SYSADM.ACTIVE_INV ACTIVE_INV,
 SYSADM.PROD_NOTES PROD_NOTES,
 SYSADM.PRODUCT_SIZE PRODUCT_SIZE,
 SYSADM.PRODUCT PRODUCT,
 SYSADM.STYLE_NOTE STYLE_NOTE
Where
 PRODUCT.DEPARTMENT = DEPARTMENT.DEPARTMENT
 And PRODUCT.STYLE = PRODUCT_SIZE.STYLE
 And PRODUCT_SIZE.SKU = ACTIVE_INV.SKU
 And STYLE_NOTE.NOTE_ID = PROD_NOTES.NOTE_ID
 And STYLE_NOTE.STYLE = PRODUCT.STYLE
 And PRODUCT.CLASS = CLASS.CLASS
 And PRODUCT.DEPARTMENT = CLASS.DEPARTMENT
;

WEB SKU QTY PRICE STYLE
=== ==================== =========== =============== ===============
Y 400100170571 2 7.99 0-20239
Y 400100010242 1 6.99 rampant031
Y 400100012420 1 10.99 zone022
Y 400100007143 1 10.99 rr003

4 ROWS SELECTED IN 0.02 SECONDS
200.00 ROWS PER SECOND / 0.00 SECONDS PER ROW

SET SPOOL OFF;


----------------------------END OUTPUT ------------------------------

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close