?
Solved

Sybase - Print more than 512 K per output line to output - flat file

Posted on 2003-03-27
5
Medium Priority
?
409 Views
Last Modified: 2012-08-14
I want to procude a flat file, but receive errors when I try PRINT a single given line to the output file that is more than 512 bytes long.  I want to use just a single procedure if posible and not drop out to a unix shell script if it can be avoided.

I am not really use to Sybase, but more Oracle.  In Oracle I get around this constraint as follows: UTL_FILE.FOPEN(v_dir,v_file_out,'w',32767);

How can I can around the 512K limitation?  

Error is:

PRINT command failed because the resulting string exceeded the maximum length of 512 bytes.
(return status = -6)

Syntax is:

PRINT "%1!~%2!~%3!~%4!~%5!~%6!~%7!~%8!~%9!~%10!~%11!",
      @invoice_data1,
      @part_info,
      @tax_code,
      @inv_detail_totals1,
      @vendor_currency_id,
      @billto_no,
      @billto_info,
      @ship_to_info,
      @inv_detail_totals2,
      @gst_pst_tax_amts,
      @vat_amount

Thanks
Greg
0
Comment
Question by:DR_HIPPO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 6

Expert Comment

by:DaniPro
ID: 8218254
If you use Adaptive Server Anywhere you can try to use the MESSAGE STATMENT
0
 

Author Comment

by:DR_HIPPO
ID: 8219395
Thanks for the comment -

We are running Adaptive Server Enterprise not the IQ - so this does not seem to work.
0
 
LVL 13

Expert Comment

by:alpmoon
ID: 8223043
In ASE 12.5 the limit is 1024 bytes. If you are not planning to upgrade ASE, I think you may consider to use select with convert function for numeric datatypes ( like select convert(char, @invoice_data1)+'~'+ @part_info + '~' + ..... )
0
 
LVL 9

Expert Comment

by:HamdyHassan
ID: 8226159
The following from sybase User Guide manual, about print
"
The maximum output string length of format_string plus all arguments
after substitution is 512 bytes."


I can help you with unix script if you want
0
 
LVL 9

Accepted Solution

by:
HamdyHassan earned 1500 total points
ID: 8226194
I get an crazy idea, instead of print, you insert into tempdb..mytemptable

then in your main script, you use sybase bcp out

0

Featured Post

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We are witnesses that everyone is saying that our children shouldn't "play" with a technology because it is dangerous. This article is going to prove that they are wrong.
What's worse than having your data encrypted by ransomware? Getting attacked by a so-called "wiper," which simply destroys the data and offers you no hope of ever seeing it again.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month8 days, 18 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question