Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Extracting only required length in a column in perl DBI

by Thomas Kennll (Acolyte)
on Jan 15, 2013 at 12:48 UTC ( #1013388=note: print w/replies, xml ) Need Help??


in reply to Re: Extracting only required length in a column in perl DBI
in thread Extracting only required length in a column in perl DBI

That will work.. But, I actually wanted to extract 6 characters for the 3 column... How do I achieve that??
  • Comment on Re^2: Extracting only required length in a column in perl DBI

Replies are listed 'Best First'.
Re^3: Extracting only required length in a column in perl DBI
by marto (Bishop) on Jan 15, 2013 at 12:53 UTC

    Replace the 3 in my example with a 6, you should consider learning basic SQL.

      What I meant is something like this my ($ansb_cktid, $ansb_mcn, $ansb_soc) =unpack("A3 A3 A6")

        I'm of the mind set that you shouldn't pull back more data than you need then post process it, when you can easily return only what you need.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1013388]
help
Chatterbox?
[Corion]: marto: How's things? I hope the kids are fine and you too!
[Corion]: Oh yay. I wonder why a very simple change in a program doesn't elicit a diff, and now I see that my diff program seems to have a bug ;)
[1nickt]: marto thanks for asking, so far so good. A pretty modern stack and decent procedures, although rather too much home-built stuff (e.g. a logging role that should tries to duplicate Log::Any).
[Corion]: No. It's just that I'm comparing the same output file twice, instead of comparing the output files of the two runs %-)
[Corion]: Lo and behold, running a program with the correct input files yields the correct (and expected) output. Yay me.
[1nickt]: Got a MacBook and am expected to develop directly on it, ironic given the recent thread about that.
[marto]: Corion, some not too serious issues with the kids, hopefully, other than that just dealing with commuting by car again in the winter, not much fun so far, and there's no real 'bad' weather yet :)
[marto]: 1nickt, glad to hear it, I'm sure you'll bring improvements to their stack in due course ;)
[1nickt]: Just trying to adjust to a new culture. Better doc than I am used to , but quite a bit more Agiley meta-bullshit; at least half a dozen meetings a week, strict "sprint" schedule etc. I'll adjust. And I hope to just switch off after the "scrum" each day at
[1nickt]: ... the end of the afternoon. marto How are you, snowed in? Mum and Dad expecting snow today in Surrey. (Have 5" on the ground here in NJ. And my son's high school in SOCal closed until after Xmas due to fires.)

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2017-12-11 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (289 votes). Check out past polls.

    Notices?