Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: DBI Invalid Cursor State when PRINT statements are embedded in SQL

by Grygonos (Chaplain)
on Oct 18, 2004 at 18:05 UTC ( #400252=note: print w/replies, xml ) Need Help??


in reply to DBI Invalid Cursor State when PRINT statements are embedded in SQL

I have never seen this syntax, and a quick look through the DBI book doesn't yield any likening to this syntax.

You really should just fetch the rows (individually or all at once) and then loop through and print them out if you're wantin to output the contents of a select statement.

P.S. - I have been known to be wrong many many times.

edit: popped open my sql server docs and found that it's a T-SQL function. My understanding has been that you can use T-SQL via ODBC, but I don't quite think you need to use it here. This may be one function that doesn't work within DBI::ODBC due to what state the cursor needs to be in for the T-SQL command to work.

P.P.S. Again ... I have been known to be very wrong.
  • Comment on Re: DBI Invalid Cursor State when PRINT statements are embedded in SQL

Replies are listed 'Best First'.
Re^2: DBI Invalid Cursor State when PRINT statements are embedded in SQL
by JamesNC (Chaplain) on Oct 18, 2004 at 18:18 UTC
    Thanks for the help. The syntax is valid in Sybase too. And I just verified that Sybase doesn't complain if it is at the begining, or anywhere else but nothing gets printed. It must act like a "GO" in that it never sent to the interpreter ever, but MSSQL doesn't like it.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://400252]
help
Chatterbox?
[Cosmic37]: greetings earthlings please can someone improve my pathetic perl knowledge
[Cosmic37]: I have 2 files each with datetime and other data in unknown order and I want to find rows from both files matching by datetime and output them combined/ concatenated
[Corion]: Sure
[Corion]: Do you have any specific interests or general Perl knowledge?
[Cosmic37]: should I slurp? should I grep? Noble Lords I wish you good karma and beg your advice
[Corion]: Cosmic37: Ah, see perlfaq4, about How do I compute the intersection of two arrays
[Cosmic37]: I am out of practice; I use Perl for scientific programming for number crunching
[Corion]: Cosmic37: Basically, you read one file into a hash, keyed by your key, and then match the lines from the second file to that hash
[Cosmic37]: note that the two files only have datetimes which may match whereas other data per line is different format in file1 and file2 - is that really intersection?

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2017-06-29 16:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (672 votes). Check out past polls.